aboutsummaryrefslogtreecommitdiff
path: root/debian/mauvealert-server.init
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-14 18:00:49 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-14 18:00:49 +0100
commit18b0906630ab4165d1e8b4bc66d7446b17c31605 (patch)
tree359b6018b6c7327d3c72c23516cd9378ce01a866 /debian/mauvealert-server.init
parent494b083408b354f38da9b1fc5e8ffb7238d009b3 (diff)
* Improved logging.
* Updated message suppression
Diffstat (limited to 'debian/mauvealert-server.init')
-rw-r--r--debian/mauvealert-server.init15
1 files changed, 12 insertions, 3 deletions
diff --git a/debian/mauvealert-server.init b/debian/mauvealert-server.init
index 225a9d4..accea6c 100644
--- a/debian/mauvealert-server.init
+++ b/debian/mauvealert-server.init
@@ -47,16 +47,25 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --chuid $RUNASUSER --test > /dev/null \
- || return 1
+
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --chuid $RUNASUSER --test > /dev/null \
+ || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --chuid $RUNASUSER --background --startas $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
+ count=0
+
+ while [ $((count = count + 1)) -le 5 ] ; do
+ echo -n .
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --chuid $RUNASUSER --test > /dev/null \
+ || return 0
+ done
- sleep 5
+ return 2
}
#