File: binkd.init

package info (click to toggle)
binkd 0.9.9%2Brel-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,704 kB
  • ctags: 1,424
  • sloc: ansic: 14,278; makefile: 413; sh: 227; perl: 89
file content (47 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          binkd
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

OPTS="/etc/binkd/binkd.cfg -q"
PIDFILE=/var/run/ftn/binkd.pid
DAEMON=/usr/sbin/binkd

test -f $DAEMON || exit 0

# don't start binkd if it is started by inetd
grep -q '^binkp[[:space:]]' /etc/inetd.conf && exit 0

case "$1" in
  start)
    echo -n "Starting FTN mailer: binkd"
    start-stop-daemon --start --background --pidfile $PIDFILE \
	--chuid ftn:ftn	--exec $DAEMON -- $OPTS
    echo "."
    ;;
  stop)
    echo -n "Stopping FTN mailer: binkd"
    start-stop-daemon --oknodo --stop --pidfile $PIDFILE --exec $DAEMON
    echo "."
    ;;
  reload)
    echo -n "Reloading FTN mailer: binkd"
    start-stop-daemon --stop --signal 1 --pidfile $PIDFILE --exec $DAEMON
    echo "."
    ;;
  restart|force-reload)
    sh $0 stop
    sleep 1
    sh $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/binkd {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0