Skip to content

Commit

Permalink
Ensure EPMD env vars are exported if set
Browse files Browse the repository at this point in the history
Fixes #1709
  • Loading branch information
lukebakken committed Oct 11, 2018
1 parent 100e7e1 commit 4077b83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/rabbitmq-env
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ saved_RABBITMQ_PID_FILE="$RABBITMQ_PID_FILE"
[ "x" = "x$RABBITMQ_CONF_ENV_FILE" ] && RABBITMQ_CONF_ENV_FILE=${CONF_ENV_FILE}
[ -f ${RABBITMQ_CONF_ENV_FILE} ] && . ${RABBITMQ_CONF_ENV_FILE} || true

[ -n "$ERL_EPMD_PORT" ] && export ERL_EPMD_PORT
[ -n "$ERL_EPMD_ADDRESS" ] && export ERL_EPMD_ADDRESS

DEFAULT_SCHEDULER_BIND_TYPE="db"
[ -n "$SCHEDULER_BIND_TYPE" ] || SCHEDULER_BIND_TYPE="$DEFAULT_SCHEDULER_BIND_TYPE"
[ -n "$RABBITMQ_SCHEDULER_BIND_TYPE" ] || RABBITMQ_SCHEDULER_BIND_TYPE="$SCHEDULER_BIND_TYPE"
Expand Down Expand Up @@ -391,15 +394,17 @@ run_escript()
escript="${1:?escript must be defined}"
shift

# Important: do not quote RABBITMQ_CTL_ERL_ARGS as they must be
# word-split
# shellcheck disable=SC2086
exec "${ERL_DIR}erl" +B \
-boot "${CLEAN_BOOT_FILE}" \
-boot "$CLEAN_BOOT_FILE" \
-noinput -noshell -hidden -smp enable \
$RABBITMQ_CTL_ERL_ARGS \
-kernel inet_dist_listen_min "$RABBITMQ_CTL_DIST_PORT_MIN" \
-kernel inet_dist_listen_max "$RABBITMQ_CTL_DIST_PORT_MAX" \
-sasl errlog_type error \
-mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \
-mnesia dir "\"$RABBITMQ_MNESIA_DIR\"" \
-nodename "$RABBITMQ_NODENAME" \
-run escript start \
-escript main "$escript_main" \
Expand Down

0 comments on commit 4077b83

Please sign in to comment.