Rev 71 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3 | magnus | 1 | #!/bin/sh |
2 | # |
||
3 | ### BEGIN INIT INFO |
||
4 | # Provides: prayer-accountd |
||
5 | # Required-Start: |
||
6 | # Required-Stop: |
||
7 | # Should-Start: $local_fs |
||
8 | # Should-Stop: $local_fs |
||
9 | # Default-Start: 2 3 4 5 |
||
10 | # Default-Stop: 0 1 6 |
||
11 | # Short-Description: Prayer account helper daemon |
||
12 | # Description: Lets users change passwords, manage filters and other things not supported by IMAP itself |
||
13 | ### END INIT INFO |
||
14 | |||
15 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
||
16 | DAEMON=/usr/sbin/prayer-accountd |
||
17 | PIDFILE=/var/run/prayer/accountd.pid |
||
18 | DESC="Prayer account helper server" |
||
19 | |||
20 | test -x $DAEMON || exit 0 |
||
21 | |||
22 | egrep -iq "^[[:space:]]*accountd_port[[:space:]]*=[[:space:]]*[[:digit:]]+[[:space:]]*$" /etc/prayer/accountd.cf || exit 0 |
||
23 | |||
24 | . /lib/lsb/init-functions |
||
25 | |||
26 | # Include prayer defaults if available |
||
27 | if [ -f /etc/default/prayer-accountd ] ; then |
||
28 | . /etc/default/prayer-accountd |
||
29 | fi |
||
30 | |||
31 | set +e |
||
32 | |||
33 | start() { |
||
34 | log_daemon_msg "Starting $DESC" "accountd" |
||
35 | start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE \ |
||
36 | --exec $DAEMON -- $DAEMON_OPTS |
||
37 | log_end_msg $? |
||
38 | } |
||
39 | |||
40 | stop() { |
||
41 | log_daemon_msg "Stopping $DESC" |
||
42 | if [ -f "$PIDFILE" ]; then |
||
43 | start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE |
||
44 | log_progress_msg "accountd" |
||
45 | fi |
||
46 | rm -f "$PIDFILE" |
||
47 | log_end_msg 0 |
||
48 | } |
||
49 | |||
50 | case "$1" in |
||
51 | start) |
||
52 | start |
||
53 | ;; |
||
54 | |||
55 | stop) |
||
56 | stop |
||
57 | ;; |
||
58 | |||
59 | restart|force-reload) |
||
60 | stop |
||
61 | start |
||
62 | ;; |
||
63 | *) |
||
64 | N=/etc/init.d/prayer-accountd |
||
65 | # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 |
||
66 | log_failure_msg "Usage: $N {start|stop|restart|force-reload}" >&2 |
||
67 | exit 1 |
||
68 | ;; |
||
69 | esac |
||
70 | |||
71 | exit 0 |