diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-18 13:43:45 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-18 13:43:45 +0000 |
| commit | 85506c113f88092ffd4f544a43123715f5d9212f (patch) | |
| tree | 8c904c4591274e0c23126a890dcbc95cb86319ba /scripts/rabbitmq-server | |
| parent | a20c6cd9018645d65f7ee7009208feb4ebf8f9e0 (diff) | |
| parent | 7a7c1a3c0757353319c17a9567a6340185905491 (diff) | |
| download | rabbitmq-server-git-85506c113f88092ffd4f544a43123715f5d9212f.tar.gz | |
Merge bug25722
Diffstat (limited to 'scripts/rabbitmq-server')
| -rwxr-xr-x | scripts/rabbitmq-server | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index a9a0439be8..7907031597 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -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,23 @@ case "$(uname -s)" in fi esac -export RABBITMQ_CONFIG_FILE +export RABBITMQ_CONFIG_FILE RABBITMQ_DIST_PORT 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; +${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 +136,5 @@ exec ${ERL_DIR}erl \ -os_mon start_memsup false \ -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \ ${RABBITMQ_SERVER_START_ARGS} \ + ${RABBITMQ_DIST_ARG} \ "$@" |
