From 18b0906630ab4165d1e8b4bc66d7446b17c31605 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Thu, 14 Jul 2011 18:00:49 +0100 Subject: * Improved logging. * Updated message suppression --- debian/mauvealert-server.init | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'debian/mauvealert-server.init') 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 } # -- cgit v1.2.1