File: rc.watchdog.debian

package info (click to toggle)
watchdog 5.4-10lenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 936 kB
  • ctags: 684
  • sloc: ansic: 6,294; sh: 1,266; makefile: 72
file content (45 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
#/etc/init.d/watchdog: start watchdog daemon.

test -x /usr/sbin/watchdog || exit 0

# Set run_watchdog to 1 to start watchdog or 0 to disable it.
run_watchdog=1

# Used by debmake as an argument to update-rc.d.
FLAGS="defaults 10"

case "$1" in
  start)
    if [ $run_watchdog = 1 ]
    then
	echo -n "Starting software watchdog..."
	if start-stop-daemon --start --quiet --exec /usr/sbin/watchdog -- -r /usr/sbin/repair
	then
	    echo done.
	else
	    echo failed.
	fi
    fi
    ;;

  stop)
    if [ $run_watchdog = 1 ]
    then
	echo -n "Stopping software watchdog..."
	if start-stop-daemon --stop --quiet --pidfile /var/run/watchdog.pid
	then
	    echo done.
	else
	    echo failed.
	fi
    fi
    ;;

  *)
    echo "Usage: /etc/init.d/watchdog {start|stop}"
    exit 1

esac

exit 0