scripts/rabbitmqctl
author Simon MacMullen <simon@rabbitmq.com>
Fri, 22 Aug 2014 15:20:16 +0100
changeset 13887 395c4cb104f0
parent 13692 b6b9a7cc87de
permissions -rwxr-xr-x
We can't assume encoded lengths, so do it all in lists.
     1 #!/bin/sh -e
     2 ##  The contents of this file are subject to the Mozilla Public License
     3 ##  Version 1.1 (the "License"); you may not use this file except in
     4 ##  compliance with the License. You may obtain a copy of the License
     5 ##  at http://www.mozilla.org/MPL/
     6 ##
     7 ##  Software distributed under the License is distributed on an "AS IS"
     8 ##  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
     9 ##  the License for the specific language governing rights and
    10 ##  limitations under the License.
    11 ##
    12 ##  The Original Code is RabbitMQ.
    13 ##
    14 ##  The Initial Developer of the Original Code is GoPivotal, Inc.
    15 ##  Copyright (c) 2007-2014 GoPivotal, Inc.  All rights reserved.
    16 ##
    17 
    18 # Get default settings with user overrides for (RABBITMQ_)<var_name>
    19 # Non-empty defaults should be set in rabbitmq-env
    20 . `dirname $0`/rabbitmq-env
    21 
    22 # rabbitmqctl starts distribution itself, so we need to make sure epmd
    23 # is running.
    24 ${ERL_DIR}erl -sname rabbitmqctl-prelaunch-$$ -noinput -eval 'erlang:halt().'
    25 
    26 # We specify Mnesia dir and sasl error logger since some actions
    27 # (e.g. forget_cluster_node --offline) require us to impersonate the
    28 # real node.
    29 exec ${ERL_DIR}erl \
    30     -pa "${RABBITMQ_HOME}/ebin" \
    31     -noinput \
    32     -hidden \
    33     ${RABBITMQ_CTL_ERL_ARGS} \
    34     -boot "${CLEAN_BOOT_FILE}" \
    35     -sasl errlog_type error \
    36     -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \
    37     -s rabbit_control_main \
    38     -nodename $RABBITMQ_NODENAME \
    39     -extra "$@"