3 # Provides: pgp-keyserver
4 # Required-Start: $remote_fs $syslog
5 # Required-Stop: $remote_fs $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: onak init script
9 # Description: onak is a PGP keyserver with an optional persistent
10 # backend daemon which this script starts.
13 # Author: Jonathan McDowell <noodles@earth.li>
17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
18 DESC="PGP Keyserver backend"
20 DAEMON=/usr/sbin/$NAME
22 SCRIPTNAME=/etc/init.d/onak
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 # Load the VERBOSE setting and other rcS variables
30 # Define LSB log_* functions.
31 # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
32 # and status_of_proc is working.
33 . /lib/lsb/init-functions
35 if ! grep -q -E '^use_keyd *(true|yes|1)$' /etc/onak.conf; then
41 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
42 start-stop-daemon --start --oknodo --user onak --chuid onak \
45 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
46 1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
50 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
52 start-stop-daemon --stop --oknodo --user onak --exec $DAEMON
54 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
55 1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
59 [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
61 start-stop-daemon --stop --oknodo --user onak --exec $DAEMON
62 start-stop-daemon --start --oknodo --user onak --chuid onak \
65 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
66 1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
70 status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
73 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2