]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
Add restart/force-reload options to init script
authorJonathan McDowell <noodles@earth.li>
Wed, 20 Apr 2011 05:13:09 +0000 (22:13 -0700)
committerJonathan McDowell <noodles@earth.li>
Wed, 20 Apr 2011 05:13:09 +0000 (22:13 -0700)
  Debian requires these. Just do a stop and start.

debian/onak.init

index 34d0348ba415d59c1e62af4bb1da1f25907521a1..7056fc1121584b1ac0ddb2fbd6d3df534dbe727c 100755 (executable)
@@ -55,11 +55,23 @@ case "$1" in
                1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
+  restart)
+  force-reload)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
+       /usr/bin/keydctl quit
+       start-stop-daemon --stop --oknodo --user onak --exec $DAEMON
+       start-stop-daemon --start --oknodo --user onak --chuid onak \
+               --exec $DAEMON
+       case "$?" in
+               0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
   status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
   *)
-       echo "Usage: $SCRIPTNAME {start|stop|status}" >&2
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
        exit 3
        ;;
 esac