aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/halt
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-03-03 19:05:42 +0000
committerBill Nottingham <notting@redhat.com>2006-03-03 19:05:42 +0000
commit58bc9c388e0ef078d6af3716f48831a30aef6bdc (patch)
treedab149b1ca94027000b02627b15a298f5add7e67 /rc.d/init.d/halt
parentcb1b7d84a851d4d7413068df70ed829b4e352d21 (diff)
downloadinitscripts-58bc9c388e0ef078d6af3716f48831a30aef6bdc.tar
initscripts-58bc9c388e0ef078d6af3716f48831a30aef6bdc.tar.gz
initscripts-58bc9c388e0ef078d6af3716f48831a30aef6bdc.tar.bz2
initscripts-58bc9c388e0ef078d6af3716f48831a30aef6bdc.tar.xz
initscripts-58bc9c388e0ef078d6af3716f48831a30aef6bdc.zip
kexec support (<jmoyer@redhat.com>)
Diffstat (limited to 'rc.d/init.d/halt')
-rwxr-xr-xrc.d/init.d/halt4
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"