diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-06-18 09:58:29 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-06-18 09:58:29 +0100 |
commit | d090e69a7e4328910bf3bacb680a4f0bc0f4524e (patch) | |
tree | 62b77d7a162ccf083bdda378033ff5898ea5909f | |
parent | 91247a346135bc3b7b5cf21e0c285f73ddda28b5 (diff) | |
download | rabbitmq-server-bug26247.tar.gz |
Allow prelaunch to return error code 2 without failing.bug26247
-rwxr-xr-x | scripts/rabbitmq-server | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 18d24542..bd397441 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -87,6 +87,8 @@ esac RABBITMQ_EBIN_ROOT="${RABBITMQ_HOME}/ebin" +set +e + RABBITMQ_CONFIG_FILE=$RABBITMQ_CONFIG_FILE \ RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \ ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \ @@ -98,13 +100,18 @@ RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \ -extra "${RABBITMQ_NODENAME}" PRELAUNCH_RESULT=$? -if [ ${PRELAUNCH_RESULT} = 1 ] ; then - exit 1 +if [ ${PRELAUNCH_RESULT} = 2 ] ; then + # dist port is mentioned in config, so do not set it + true 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}" +else + exit ${PRELAUNCH_RESULT} fi +set -e + RABBITMQ_CONFIG_ARG= [ -f "${RABBITMQ_CONFIG_FILE}.config" ] && RABBITMQ_CONFIG_ARG="-config ${RABBITMQ_CONFIG_FILE}" |