misc sysv fixes
authorElan Ruusamäe <glen@delfi.ee>
Fri, 4 Nov 2016 16:20:48 +0000 (18:20 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 4 Nov 2016 16:20:48 +0000 (18:20 +0200)
gitlab-ci-multi-runner.init

index 4980dee..9b4d037 100755 (executable)
@@ -35,6 +35,14 @@ do_stop() {
        start-stop-daemon --stop --pidfile "$PIDFILE" --user "$USER" --exec "$DAEMON" --quiet
 }
 
+okfail() {
+       if [ "$1" = 0 ]; then
+               ok
+       else
+               fail
+       fi
+}
+
 start() {
        # Check if the service is already running?
        if [ -f /var/lock/subsys/$NAME ]; then
@@ -45,6 +53,7 @@ start() {
        msg_starting "$DESC"
        do_start
        RETVAL=$?
+       okfail $RETVAL
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
 }
 
@@ -57,6 +66,7 @@ stop() {
        # Stop daemons.
        msg_stopping "$DESC"
        do_stop
+       okfail $?
        rm -f /var/lock/subsys/$NAME
 }
 
@@ -95,7 +105,7 @@ case "$1" in
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.061938 seconds and 4 git commands to generate.