summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-02-14 13:27:05 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-02-14 13:27:05 +0000
commita9d0297ed433b062c985c5622feaa5c7d337c0eb (patch)
tree3795565d3384b420dca02e63eccaa89605c23b82
parent4b329480306627ea62aa972e432a4a78fab339c4 (diff)
downloadrabbitmq-server-a9d0297ed433b062c985c5622feaa5c7d337c0eb.tar.gz
Make "set +e" cover rather less code.
-rw-r--r--packaging/common/rabbitmq-server.init10
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() {