Mercurial > notdcc
annotate debian/dcc-server.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 |
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. |
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: dccd |
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 local server |
c7785b85f2d2
Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents:
2
diff
changeset
|
12 # Description: Start nondcc server 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/dccd |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
17 NAME=dcc-server |
6
c7785b85f2d2
Init scripts try to conform LSB header
Peter Gervai <grin@grin.hu>
parents:
2
diff
changeset
|
18 DESC="Not Distributed Checksum Clearinghouse server" |
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 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
|
23 . /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
|
24 else |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
25 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
|
26 exit 1 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
27 fi |
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 set -e |
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 case "$1" in |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
32 start) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
33 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
|
34 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
|
35 --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
|
36 echo "." |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
37 ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
38 stop) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
39 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
|
40 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
|
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 restart) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
44 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
|
45 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
|
46 /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
|
47 sleep 1 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
48 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
|
49 /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
|
50 echo "." |
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 *) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
53 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
|
54 # 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
|
55 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
|
56 exit 1 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
57 ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
58 esac |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
59 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
60 exit 0 |