4
# Required-Start: $local_fs $network
5
# Required-Stop: $local_fs $network
6
# Default-Start: 2 3 4 5
8
# Short-Description: Start popfile proxy/daemon
12
PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
DAEMON=/usr/share/popfile/start_popfile.sh
16
PIDFILE=/var/run/popfile/popfile.pid
18
test -f $DAEMON || exit 0
22
if [ -e /etc/default/popfile ]
24
. /etc/default/popfile
27
if [ ! -d /var/run/popfile ] ; then
28
install -o popfile -g popfile -m 755 -d /var/run/popfile || return 2
32
if [ "$NICE_LEVEL" != "" ]
34
EXTRA_OPTS="$EXTRA_OPTS --nicelevel $NICE_LEVEL"
38
echo -n "Starting $DESC: "
40
if [ -e $PIDFILE ]; then
41
if kill -0 `cat $PIDFILE` >/dev/null 2>&1; then
42
echo "$NAME already running."
46
if [ "$NOSTART" = "0" ]; then
47
start-stop-daemon --start --exec $DAEMON --pidfile $PIDFILE \
48
--chuid popfile --background --oknodo $EXTRA_OPTS -- $DAEMON_OPTS
54
echo -n "Stopping $DESC: "
55
if [ -e $PIDFILE ]; then
56
start-stop-daemon --stop --pidfile $PIDFILE --retry 60 --oknodo
59
echo "$NAME not running."
77
echo "Usage: $N {start|stop|restart|force-reload}" >&2