@@ -83,7 +83,7 @@ start_rabbitmq_server() {
8383stop_rabbitmq_server () {
8484 if test " $rabbitmq_server_pid " ; then
8585 kill -TERM " $rabbitmq_server_pid "
86- wait " $rabbitmq_server_pid " || exit " $? "
86+ wait " $rabbitmq_server_pid "
8787 fi
8888}
8989
@@ -129,23 +129,12 @@ else
129129 trap " stop_rabbitmq_server; exit 130" INT
130130
131131 start_rabbitmq_server " $@ " &
132- export rabbitmq_server_pid=$!
132+ export rabbitmq_server_pid=" $! "
133133
134134 # Block until RabbitMQ exits or a signal is caught.
135135 # Waits for last command (which is start_rabbitmq_server)
136- #
137- # The "|| true" is here to work around an issue with Dash. Normally
138- # in a Bourne shell, if `wait` is interrupted by a signal, the
139- # signal handlers defined above are executed and the script
140- # terminates with the exit code of `wait` (unless the signal handler
141- # overrides that).
142- # In the case of Dash, it looks like `set -e` (set at the beginning
143- # of this script) gets precedence over signal handling. Therefore,
144- # when `wait` is interrupted, its exit code is non-zero and because
145- # of `set -e`, the script terminates immediately without running the
146- # signal handler. To work around this issue, we use "|| true" to
147- # force that statement to succeed and the signal handler to properly
148- # execute. Because the statement below has an exit code of 0, the
149- # signal handler has to restate the expected exit code.
150- wait " $rabbitmq_server_pid " || exit " $? "
136+ # In a POSIX Bourne shell, if `wait` is interrupted by a signal, the signal
137+ # handlers defined above are executed and the script terminates with the
138+ # exit code of `wait` (unless the signal handler overrides that).
139+ wait " $rabbitmq_server_pid "
151140fi
0 commit comments