summaryrefslogtreecommitdiff
path: root/packaging/common
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-01-26 16:12:13 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-01-26 16:12:13 +0000
commitcfca23b81c44262977f879ec53e6bfac0792c8b8 (patch)
treefa32bd7e589ea9eb277f791ab619a1aaa896f172 /packaging/common
parent2357faab24e32a9bf84529949c907276abc9f7e6 (diff)
downloadrabbitmq-server-cfca23b81c44262977f879ec53e6bfac0792c8b8.tar.gz
rabbitmqctl status is not adequate to wait for the server as it can return
successfully when the vm has started but not the app. The app can then fail. Therefore introduce a new command to wait for the app to start. Note that this subcommand contains a timeout to wait for the VM to start, but will wait indefinitely for the app to start once the VM has.
Diffstat (limited to 'packaging/common')
-rw-r--r--packaging/common/rabbitmq-server.init15
1 files changed, 1 insertions, 14 deletions
diff --git a/packaging/common/rabbitmq-server.init b/packaging/common/rabbitmq-server.init
index 54fd39b7..8ef1000b 100644
--- a/packaging/common/rabbitmq-server.init
+++ b/packaging/common/rabbitmq-server.init
@@ -22,7 +22,6 @@ DAEMON=/usr/sbin/${NAME}
CONTROL=/usr/sbin/rabbitmqctl
DESC=rabbitmq-server
USER=rabbitmq
-TIMEOUT=10
ROTATE_SUFFIX=
INIT_LOG_DIR=/var/log/rabbitmq
@@ -40,7 +39,7 @@ start_rabbitmq () {
set +e
nohup $DAEMON > ${INIT_LOG_DIR}/startup_log \
2> ${INIT_LOG_DIR}/startup_err &
- wait_for_rabbitmq
+ $CONTROL wait >/dev/null 2>&1
case "$?" in
0)
echo SUCCESS
@@ -59,18 +58,6 @@ start_rabbitmq () {
fi
}
-wait_for_rabbitmq() {
- WAITED=0
- while [ $WAITED != $TIMEOUT ]; do
- if status_rabbitmq quiet ; then
- return 0
- fi
- sleep 1
- WAITED=`expr $WAITED + 1`
- done
- return 1
-}
-
stop_rabbitmq () {
set +e
status_rabbitmq quiet