watchdog: set watchdog timeout with wdctl, if available
authorHarald Hoyer <harald@redhat.com>
Wed, 1 Aug 2012 10:49:45 +0000 (12:49 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 1 Aug 2012 10:49:45 +0000 (12:49 +0200)
"wdctl -s" does not yet exist upstream. I patched
util-linux/sys-utils/wdctl.c to set the timeout.

modules.d/04watchdog/module-setup.sh
modules.d/04watchdog/watchdog.sh

index 5fc77f4..5eff390 100755 (executable)
@@ -23,5 +23,6 @@ install() {
     inst_hook cleanup   00 "$moddir/watchdog.sh"
     inst_hook cleanup   99 "$moddir/watchdog.sh"
     inst_hook emergency 02 "$moddir/watchdog-stop.sh"
+    dracut_install -o wdctl
 }
 
index ed8cc93..a3fdc26 100755 (executable)
@@ -1,7 +1,12 @@
 #!/bin/sh
 if [ -e /dev/watchdog ]; then
+       if [ ! -e /tmp/watchdog_timeout ]; then
+               wdctl -s 60 /dev/watchdog &>/dev/null
+               > /tmp/watchdog_timeout
+       fi
        info "Triggering watchdog"
        >/dev/watchdog
 else
        modprobe ib700wdt
+       modprobe i6300esb
 fi