From: Jonathan McDowell <noodles@earth.li>
Date: Wed, 20 Apr 2011 05:13:09 +0000 (-0700)
Subject: Add restart/force-reload options to init script
X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/03ac5c0515ce60eb416b574fbe8594469122b515?hp=24b8c863b154e1bee674597ffcd818d4d959c9a1

Add restart/force-reload options to init script

  Debian requires these. Just do a stop and start.
---

diff --git a/debian/onak.init b/debian/onak.init
index 34d0348..7056fc1 100755
--- a/debian/onak.init
+++ b/debian/onak.init
@@ -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