diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-02-14 13:27:05 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-02-14 13:27:05 +0000 |
commit | a9d0297ed433b062c985c5622feaa5c7d337c0eb (patch) | |
tree | 3795565d3384b420dca02e63eccaa89605c23b82 | |
parent | 4b329480306627ea62aa972e432a4a78fab339c4 (diff) | |
download | rabbitmq-server-a9d0297ed433b062c985c5622feaa5c7d337c0eb.tar.gz |
Make "set +e" cover rather less code.
-rw-r--r-- | packaging/common/rabbitmq-server.init | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packaging/common/rabbitmq-server.init b/packaging/common/rabbitmq-server.init index ea21f098..21e22eab 100644 --- a/packaging/common/rabbitmq-server.init +++ b/packaging/common/rabbitmq-server.init @@ -43,27 +43,28 @@ start_rabbitmq () { setsid sh -c "$DAEMON > ${INIT_LOG_DIR}/startup_log \ 2> ${INIT_LOG_DIR}/startup_err" & $CONTROL wait >/dev/null 2>&1 - case "$?" in + RETVAL=$? + set -e + case "$RETVAL" in 0) echo SUCCESS [ -n "$LOCK_FILE" ] && touch $LOCK_FILE - RETVAL=0 ;; *) echo FAILED - check ${INIT_LOG_DIR}/startup_\{log, _err\} RETVAL=1 ;; esac - set -e fi } stop_rabbitmq () { - set +e status_rabbitmq quiet if [ $RETVAL = 0 ] ; then + set +e $CONTROL stop > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err RETVAL=$? + set -e if [ $RETVAL = 0 ] ; then [ -n "$LOCK_FILE" ] && rm -rf $LOCK_FILE else @@ -73,7 +74,6 @@ stop_rabbitmq () { echo RabbitMQ is not running RETVAL=0 fi - set -e } status_rabbitmq() { |