Skip to content

Commit 8189125

Browse files
Merge pull request #15036 from amazon-mq/lukebakken/rabbitmq-server-detached
Restore `-detached` argument detection in `rabbitmq-server`
2 parents ebc3369 + a48ea81 commit 8189125

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

deps/rabbit/scripts/rabbitmq-server

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ SCRIPTS_DIR=$(dirname "$0")
1616

1717
[ "$NOTIFY_SOCKET" ] && RUNNING_UNDER_SYSTEMD=true
1818

19+
for opt in "$@"; do
20+
if [ "$opt" = "-detached" ]; then
21+
detached="true"
22+
fi
23+
done
24+
1925
RABBITMQ_DEFAULT_ALLOC_ARGS="+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30"
2026

2127
check_start_params() {
@@ -94,13 +100,12 @@ stop_rabbitmq_server() {
94100
fi
95101
}
96102

97-
if [ "$RABBITMQ_ALLOW_INPUT" -o "$RUNNING_UNDER_SYSTEMD" -o "$detached" ]; then
98-
# Run erlang VM directly, completely replacing current shell
99-
# process - so the pid file written in the code above will be
100-
# valid (unless detached, which is also handled in the code
101-
# above).
103+
# Note: the docker-library/rabbitmq#778 change exports "RUNNING_UNDER_SYSTEMD=true" to start
104+
# the erl process using exec via the start_rabbitmq_server.
105+
if [ "$RABBITMQ_ALLOW_INPUT" ] || [ "$RUNNING_UNDER_SYSTEMD" ] || [ "$detached" ]; then
106+
# Run erlang VM directly, completely replacing current shell process
102107
#
103-
# And also this is the correct mode to run the broker under
108+
# This is also the correct mode to run the broker under
104109
# systemd - there is no need in a proxy process that converts
105110
# signals to graceful shutdown command, the unit file should already
106111
# contain instructions for graceful shutdown. Also by removing

0 commit comments

Comments
 (0)