#! /bin/sh
# /etc/init.d/decaf-killd: start and stop the user timeout daemon.
#
# Based on skeleton 1.9.1 by Miquel van Smoorenburg <miquels@cistron.nl>.

DAEMON=/usr/sbin/decaf-killd
NAME=decaf-killd
DESC="decaf session daemon"

test -x $DAEMON || exit 0

#set -e

case "$1" in
  start)
	echo -n "Starting $DESC: $NAME"
	start-stop-daemon --start --oknodo --quiet --exec $DAEMON
	echo "."
	;;
  stop)
	echo -n "Stopping $DESC: $NAME"
	start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
	echo "."
	;;
  reload|force-reload)
	echo -n "Reloading $DESC configuration..."
	start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
	echo "done."
  	;;
  restart)
	echo -n "Restarting $DESC: $NAME"
	start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
	sleep 1
	start-stop-daemon --start --quiet --exec $DAEMON
	echo "."
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	exit 1
	;;
esac

exit 0
