diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rabbitmq-env | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env index d0f170ed9e..ab9483f912 100755 --- a/scripts/rabbitmq-env +++ b/scripts/rabbitmq-env @@ -54,9 +54,24 @@ if [ -f /etc/rabbitmq/rabbitmq.conf ] && \ echo "location has moved to ${CONF_ENV_FILE}" fi +# We save the current value of $RABBITMQ_PID_FILE in case it was set by +# an init script. If $CONF_ENV_FILE overrides it again, we must ignore +# it and warn the user. +saved_RABBITMQ_PID_FILE=$RABBITMQ_PID_FILE + ## Get configuration variables from the configure environment file [ -f ${CONF_ENV_FILE} ] && . ${CONF_ENV_FILE} || true +if [ "$saved_RABBITMQ_PID_FILE" -a \ + "$saved_RABBITMQ_PID_FILE" != "$RABBITMQ_PID_FILE" ]; then + echo "WARNING: RABBITMQ_PID_FILE was already set by the init script to:" 1>&2 + echo " $saved_RABBITMQ_PID_FILE" 1>&2 + echo " The value set in rabbitmq-env.conf is ignored because it" 1>&2 + echo " would break the init script." 1>&2 + + RABBITMQ_PID_FILE="$saved_RABBITMQ_PID_FILE" +fi + [ "x" = "x$RABBITMQ_USE_LONGNAME" ] && RABBITMQ_USE_LONGNAME=${USE_LONGNAME} if [ "xtrue" = "x$RABBITMQ_USE_LONGNAME" ] ; then RABBITMQ_NAME_TYPE=-name |
