diff options
Diffstat (limited to 'debian/mauvealert-server.init')
-rw-r--r-- | debian/mauvealert-server.init | 15 |
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 } # |