annotate debian/dcc-server.init @ 4:d329bb5c36d0

Changes making it compile the new upstream release
author Peter Gervai <grin@grin.hu>
date Tue, 10 Mar 2009 14:57:12 +0100
parents f6716cb00029
children c7785b85f2d2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
1 #!/bin/sh
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
2 #
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
3 # dcc-server example file to build /etc/init.d/ scripts.
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
4 # This file should be used to construct scripts for /etc/init.d.
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
5
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
6 PATH=/sbin:/bin:/usr/sbin:/usr/bin
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
7 DAEMON=/usr/sbin/dccd
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
8 NAME=dcc-server
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
9 DESC="Distributed Checksum Clearinghouse server"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
10
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
11 test -f $DAEMON || exit 0
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
12
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
13 if [ -f /etc/default/dcc-server ]; then
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
14 . /etc/default/dcc-server
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
15 else
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
16 echo "Missing file /etc/default/dcc-server"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
17 exit 1
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
18 fi
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
19
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
20 set -e
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
21
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
22 case "$1" in
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
23 start)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
24 echo -n "Starting $DESC: $NAME"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
25 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
26 --chuid dcc:dcc --exec $DAEMON -- $OPTIONS
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
27 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
28 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
29 stop)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
30 echo -n "Stopping $DESC: $NAME"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
31 start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
32 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
33 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
34 restart)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
35 echo -n "Restarting $DESC: $NAME"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
36 start-stop-daemon --stop --quiet --pidfile \
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
37 /var/run/$NAME.pid --exec $DAEMON
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
38 sleep 1
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
39 start-stop-daemon --start --quiet --pidfile \
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
40 /var/run/$NAME.pid --exec $DAEMON -- $OPTIONS
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
41 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
42 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
43 *)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
44 N=/etc/init.d/$NAME
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
45 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
46 echo "Usage: $N {start|stop|restart}" >&2
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
47 exit 1
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
48 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
49 esac
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
50
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
51 exit 0