]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
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 5fc77f4e1580492742a71984865e45fab21fd687..5eff3904ccea9dc775d1344f28f09e4d907fe8fc 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 ed8cc930e4820bd9d3f529e8a303eb2ab77b598a..a3fdc265d666095a868f328e7d97d34e672ed209 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