Skip to content

[master] RabbitMQ-server does not quit with Ctrl-C #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/rabbitmq-server
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh
## The contents of this file are subject to the Mozilla Public License
## Version 1.1 (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License
Expand All @@ -15,6 +15,10 @@
## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
##

# Exit immediately if a pipeline, which may consist of a single simple command,
# a list, or a compound command returns a non-zero status
set -e

# Get default settings with user overrides for (RABBITMQ_)<var_name>
# Non-empty defaults should be set in rabbitmq-env
. `dirname $0`/rabbitmq-env
Expand Down Expand Up @@ -288,11 +292,12 @@ else
# They are considered an abnormal process termination, the script
# exits with the job exit code.
trap "stop_rabbitmq_server; exit 0" HUP TERM TSTP
trap "stop_rabbitmq_server" INT
trap "stop_rabbitmq_server; exit 130" INT

start_rabbitmq_server "$@" &

# Block until RabbitMQ exits or a signal is caught.
# Waits for last command (which is start_rabbitmq_server)
wait $!
# This noop fixes dash's trap handling bug.
wait $! || true
fi