#!/bin/sh

test -f /usr/sbin/uservd || exit 0

case "$1" in
start)
	echo "Starting user services daemon uservd"
	start-stop-daemon --start --quiet --exec /usr/sbin/uservd -- -daemon
	;;
stop)
	echo "Stopping user services daemon uservd"
	start-stop-daemon --stop --quiet --user root --exec /usr/sbin/uservd
	;;
reload)
	start-stop-daemon --stop --quiet --user root --exec /usr/sbin/uservd
	sleep 1
	start-stop-daemon --start --quiet --exec /usr/sbin/uservd -- -daemon
	;;
*)
	echo "Usage: /etc/init.d/userv {start|stop|reload}"
	exit 1
esac

exit 0
