diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-19 13:52:10 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-19 13:52:10 +0000 |
| commit | 073db28b0718b66850b0d1e823b997329f46a16b (patch) | |
| tree | e41e581ea3c0313bec510379a352354d3b1bcd5f /scripts/rabbitmq-server | |
| parent | a640f74dc8d5dcd667fd9154bb323765fbf3e863 (diff) | |
| parent | c4a5d3eaba2fa34a8ff71a3f36496ed82b46c16e (diff) | |
| download | rabbitmq-server-git-073db28b0718b66850b0d1e823b997329f46a16b.tar.gz | |
Merge bug25374
Diffstat (limited to 'scripts/rabbitmq-server')
| -rwxr-xr-x | scripts/rabbitmq-server | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 72811adc7b..03cd80e11a 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## # Get default settings with user overrides for (RABBITMQ_)<var_name> @@ -29,6 +29,10 @@ DEFAULT_NODE_PORT=5672 [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" != "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_IP_ADDRESS=${DEFAULT_NODE_IP_ADDRESS} [ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${DEFAULT_NODE_PORT} +[ "x" = "x$RABBITMQ_DIST_PORT" ] && RABBITMQ_DIST_PORT=${DIST_PORT} +[ "x" = "x$RABBITMQ_DIST_PORT" ] && [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_DIST_PORT=$((${DEFAULT_NODE_PORT} + 20000)) +[ "x" = "x$RABBITMQ_DIST_PORT" ] && [ "x" != "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_DIST_PORT=$((${RABBITMQ_NODE_PORT} + 20000)) + [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME} [ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS} [ "x" = "x$RABBITMQ_CONFIG_FILE" ] && RABBITMQ_CONFIG_FILE=${CONFIG_FILE} @@ -81,18 +85,24 @@ case "$(uname -s)" in fi esac -export RABBITMQ_CONFIG_FILE - RABBITMQ_EBIN_ROOT="${RABBITMQ_HOME}/ebin" -if ! ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \ - -boot "${CLEAN_BOOT_FILE}" \ - -noinput \ - -hidden \ - -s rabbit_prelaunch \ - -sname rabbitmqprelaunch$$ \ - -extra "${RABBITMQ_NODENAME}"; - then - exit 1; + +RABBITMQ_CONFIG_FILE=$RABBITMQ_CONFIG_FILE \ +RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \ + ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \ + -boot "${CLEAN_BOOT_FILE}" \ + -noinput \ + -hidden \ + -s rabbit_prelaunch \ + -sname rabbitmqprelaunch$$ \ + -extra "${RABBITMQ_NODENAME}" + +PRELAUNCH_RESULT=$? +if [ ${PRELAUNCH_RESULT} = 1 ] ; then + exit 1 +elif [ ${PRELAUNCH_RESULT} = 0 ] ; then + # dist port is not mentioned in the config file, we can set it + RABBITMQ_DIST_ARG="-kernel inet_dist_listen_min ${RABBITMQ_DIST_PORT} -kernel inet_dist_listen_max ${RABBITMQ_DIST_PORT}" fi RABBITMQ_CONFIG_ARG= @@ -127,4 +137,5 @@ exec ${ERL_DIR}erl \ -os_mon start_memsup false \ -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \ ${RABBITMQ_SERVER_START_ARGS} \ + ${RABBITMQ_DIST_ARG} \ "$@" |
