annotate debian/dcc-client.init @ 6:c7785b85f2d2 default tip

Init scripts try to conform LSB header
author Peter Gervai <grin@grin.hu>
date Tue, 10 Mar 2009 15:15:36 +0100
parents f6716cb00029
children
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-client 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.
6
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
5 ### BEGIN INIT INFO
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
6 # Provides: dccifd
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
7 # Required-Start: $local_fs $network $named
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
8 # Required-Stop: $local_fs $network $named
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
9 # Default-Start: 2 3 4 5
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
10 # Default-Stop: 0 1 6
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
11 # Short-Description: Start nondcc interface daemon
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
12 # Description: Start nondcc interface daemon which interfaces with the dcc network
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
13 ### END INIT INFO
2
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
14
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
15 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
16 DAEMON=/usr/sbin/dccifd
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
17 NAME=dccifd
6
c7785b85f2d2 Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents: 2
diff changeset
18 DESC="nonDCC program interface daemon"
2
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 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
21
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
22 set -e
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
23
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
24 case "$1" in
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
25 start)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
26 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
27 start-stop-daemon --start --quiet --pidfile /var/run/dcc/$NAME.pid \
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
28 --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
29 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
30 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
31 stop)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
32 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
33 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
34 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
35 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
36 restart)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
37 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
38 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
39 /var/run/dcc/$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
40 sleep 1
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
41 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
42 /var/run/dcc/$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
43 echo "."
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
44 #echo "\n"
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
45 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
46 *)
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
47 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
48 # 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
49 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
50 exit 1
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
51 ;;
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
52 esac
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
53
f6716cb00029 Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff changeset
54 exit 0