summaryrefslogtreecommitdiff
path: root/system/watchdog/rc.watchdog
diff options
context:
space:
mode:
authorMenno Duursma <druiloor@zonnet.nl>2010-05-13 00:42:22 +0200
committerErik Hanson <erik@slackbuilds.org>2010-05-13 00:42:22 +0200
commit816f172bcddc734a6f85a54b3d52087853c770bb (patch)
treec5387bf12452d1301cffd4aa456913bcb3495797 /system/watchdog/rc.watchdog
parentdf4ccaeb30506449f1c4056ee5690af48ff658c7 (diff)
downloadslackbuilds-816f172bcddc734a6f85a54b3d52087853c770bb.tar.gz
system/watchdog: Updated for version 5.7
Diffstat (limited to 'system/watchdog/rc.watchdog')
-rw-r--r--system/watchdog/rc.watchdog43
1 files changed, 43 insertions, 0 deletions
diff --git a/system/watchdog/rc.watchdog b/system/watchdog/rc.watchdog
new file mode 100644
index 0000000000..7e07dff61f
--- /dev/null
+++ b/system/watchdog/rc.watchdog
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.watchdog
+#
+# Start/stop/restart the watchdog timer service.
+
+watchdog_start() {
+ if [ ! -e /dev/watchdog ]; then
+ echo "$0: No /dev/watchdog device node seems to exist on this system."
+ echo "$0: A kernel module probably needs to be loaded; please see:"
+ echo "$0: /usr/src/linux/Documentation/watchdog/watchdog-api.txt"
+ exit 0
+ fi
+ if [ -x /usr/sbin/watchdog -a -r /etc/watchdog.conf ]; then
+ echo "Starting the watchdog timer service: /usr/sbin/watchdog"
+ /usr/sbin/watchdog
+ fi
+}
+
+watchdog_stop() {
+ killall watchdog
+}
+
+watchdog_restart() {
+ watchdog_stop
+ sleep 10 # can take a while to die
+ watchdog_start
+}
+
+case "$1" in
+'start')
+ watchdog_start
+ ;;
+'stop')
+ watchdog_stop
+ ;;
+'restart')
+ watchdog_restart
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|restart}"
+esac
+