diff options
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/halt | 4 |
1 files changed, 4 insertions, 0 deletions
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" |