From 2a37ba38529c9de732262ec49e8479b2184977a3 Mon Sep 17 00:00:00 2001 From: Xin Li Date: Fri, 16 Dec 2011 13:35:47 -0800 Subject: [PATCH 17/65] Set a hardware watchdog when restarting. --- etc/rc.shutdown | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/etc/rc.shutdown b/etc/rc.shutdown index dc1ca13..d74d295 100644 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -67,6 +67,7 @@ _rcshutdown_watchdog= if [ -n "$rcshutdown_timeout" ]; then debug "Initiating watchdog timer." sleep $rcshutdown_timeout && ( + [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] || /usr/sbin/watchdog -t 32 _msg="$rcshutdown_timeout second watchdog" _msg="$_msg timeout expired. Shutdown terminated." logger -t rc.shutdown "$_msg" @@ -101,6 +102,9 @@ if [ -n "$_rcshutdown_watchdog" ]; then pkill -TERM -P $_rcshutdown_watchdog >/dev/null 2>&1 fi +# Set final watchdog to 32 seconds +[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] || /usr/sbin/watchdog -t 32 + # Insert other shutdown procedures here -- 1.7.8.3