X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/8fc4c5cd7e7c8590b55bf41e4f984a4952374b4b..b0f66028a9a17a845590a4fe737a4f5e46f6b778:/debian/become.init diff --git a/debian/become.init b/debian/become.init new file mode 100755 index 0000000..c3170ea --- /dev/null +++ b/debian/become.init @@ -0,0 +1,63 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux +# by Ian Murdock . +# +# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/become +NAME=become +DESC="Become authentication server" + +test -x $DAEMON || exit 0 +START=false +test -f /etc/default/$NAME && . /etc/default/$NAME +if test "$START" != true; then + echo "Not starting $DESC -- disabled in /etc/default/$NAME." + exit 0 +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: $NAME" + start-stop-daemon --start --quiet --pidfile /var/run/become.pid \ + --exec $DAEMON -- --daemon + echo "." + ;; + stop) + echo -n "Stopping $DESC: $NAME" + start-stop-daemon --stop --oknodo --quiet \ + --pidfile /var/run/become.pid --exec $DAEMON + echo "." + ;; + reload|force-reload) + echo -n "Reloading $DESC configuration..." + start-stop-daemon --stop --signal 1 --quiet --pidfile \ + /var/run/become.pid --exec $DAEMON + echo "done." + ;; + restart) + echo -n "Restarting $DESC: $NAME" + start-stop-daemon --stop --quiet --pidfile \ + /var/run/become.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/become.pid --exec $DAEMON -- --daemon + echo "." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0