summaryrefslogtreecommitdiff
path: root/system/watchdog/config
diff options
context:
space:
mode:
authorMenno Duursma <druiloor@zonnet.nl>2010-09-17 04:49:28 -0400
committerRobby Workman <rworkman@slackbuilds.org>2010-09-21 22:09:38 -0500
commitb0e9330a8bb8a7808a0459096ea0653a0f201d7c (patch)
treeb408b39b97b532e43036c0bb123e8ecb637ff99d /system/watchdog/config
parentf521bebc4ceb289fb95e940cdff0338969b2456d (diff)
downloadslackbuilds-b0e9330a8bb8a7808a0459096ea0653a0f201d7c.tar.gz
system/watchdog: Added (Linux watchdog timer daemon)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'system/watchdog/config')
-rw-r--r--system/watchdog/config/rc.watchdog43
1 files changed, 43 insertions, 0 deletions
diff --git a/system/watchdog/config/rc.watchdog b/system/watchdog/config/rc.watchdog
new file mode 100644
index 0000000000..7e07dff61f
--- /dev/null
+++ b/system/watchdog/config/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
+