From 58bc9c388e0ef078d6af3716f48831a30aef6bdc Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 3 Mar 2006 19:05:42 +0000 Subject: kexec support () --- rc.d/init.d/halt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rc.d/init.d/halt') diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 44d4eaaf..25fba6f7 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -38,6 +38,7 @@ case "$0" in *reboot) message=$"Please stand by while rebooting the system..." command="/sbin/reboot" + kexec_command="/sbin/kexec" ;; *) echo $"$0: call me as 'halt' or 'reboot' please!" @@ -236,6 +237,9 @@ if [ "$command" = /sbin/halt -a -r /etc/ups/upsmon.conf -a -f /etc/killpower -a fi fi +# First, try kexec. If that fails, fall back to rebooting the old way. +[ -n "$kexec_command" ] && $kexec_command -e >& /dev/null + HALTARGS="-i -d" [ -f /poweroff -o ! -f /halt ] && HALTARGS="$HALTARGS -p" -- cgit v1.2.1