File: init.d

package info (click to toggle)
drac 1.12-7.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 160 kB
  • sloc: ansic: 878; makefile: 119; sh: 83
file content (55 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
55
#!/bin/sh -e
# 2002-02-26, v0.0.1, Nol Kthe, noel@debian.org
### BEGIN INIT INFO
# Provides:          drac
# Required-Start:    $local_fs $remote_fs $portmap
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $syslog
# Should-Stop:       $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start or stop the drac daemon.
### END INIT INFO

DAEMON=/usr/sbin/rpc.dracd
OPTIONS="-i -e 30 /var/lib/drac/dracd.db"
NAME=rpc.dracd
DESC="drac - dynamic relay authorization control"

[ -x $DAEMON ] || exit 0

. /lib/lsb/init-functions

set -e

checkportmap () {
   if ! /usr/bin/rpcinfo -u localhost portmapper >/dev/null 2>&1; then
      log_action_msg "WARNING: portmapper inactive - RPC services unavailable!"
   fi
}

case "$1" in
  start)
  	checkportmap
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --background --exec ${DAEMON} -- ${OPTIONS}
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON}
        echo "$NAME."
        ;;
  restart|force-reload)
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0