Skip to content

Commit ec851de

Browse files
committed
rabbitmq-script-wrapper: Use "exec" to execute the subsequent script
Without this, a new process is spawned to execute the script. This new process won't receive the signals delivered to the process initially started. A user reported this problem with RabbitMQ in Docker: when the service must be stopped, the SIGTERM doesn't make it to the server which continues to run.
1 parent 05d9b5d commit ec851de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packaging/common/rabbitmq-script-wrapper

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ cd /var/lib/rabbitmq
3030
SCRIPT=`basename $0`
3131

3232
if [ `id -u` = `id -u rabbitmq` -a "$SCRIPT" = "rabbitmq-server" ] ; then
33-
/usr/lib/rabbitmq/bin/rabbitmq-server "$@" @STDOUT_STDERR_REDIRECTION@
33+
exec /usr/lib/rabbitmq/bin/rabbitmq-server "$@" @STDOUT_STDERR_REDIRECTION@
3434
elif [ `id -u` = `id -u rabbitmq` -o "$SCRIPT" = "rabbitmq-plugins" ] ; then
3535
if [ -f $PWD/.erlang.cookie ] ; then
3636
export HOME=.
3737
fi
38-
/usr/lib/rabbitmq/bin/${SCRIPT} "$@"
38+
exec /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
3939
elif [ `id -u` = 0 ] ; then
40-
@SU_RABBITMQ_SH_C@ "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
40+
exec @SU_RABBITMQ_SH_C@ "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
4141
else
4242
/usr/lib/rabbitmq/bin/${SCRIPT}
4343
echo

0 commit comments

Comments
 (0)