From 04f4d9a55d00ae76693417d04e214789c1054bb6 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 21 Jul 2017 10:29:10 -0400 Subject: [PATCH] Fix stop / restart for zuul-web init script We don't yet have socket support for zuul-web, revert to default way of doing this. Change-Id: I2ec2c928c43def839d0ba8a212135d5414da9a52 Signed-off-by: Paul Belanger --- files/zuul-web.init | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/files/zuul-web.init b/files/zuul-web.init index 07deb49..f0fd3fa 100644 --- a/files/zuul-web.init +++ b/files/zuul-web.init @@ -66,15 +66,29 @@ do_start() # do_stop() { - $DAEMON stop - return 0 + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --signal 9 --pidfile $PIDFILE + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + rm -f /var/run/$NAME/* + return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { - $DAEMON reconfigure + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + start-stop-daemon \ + --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 }