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 | d5a2458053273ed4d5a9c5ca11db993cc4a76cf5 (patch) | |
| tree | 62b77d7a162ccf083bdda378033ff5898ea5909f | |
| parent | a5e394ddfd8a0affcd96320051451300e7bf8b76 (diff) | |
| download | rabbitmq-server-git-d5a2458053273ed4d5a9c5ca11db993cc4a76cf5.tar.gz | |
Allow prelaunch to return error code 2 without failing.
| -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 18d24542e3..bd397441a9 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}" |
