aboutsummaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown7
1 files changed, 6 insertions, 1 deletions
diff --git a/rc.shutdown b/rc.shutdown
index d0d8405..78f56c4 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -82,7 +82,12 @@ if [[ -x /run/initramfs/shutdown ]]; then
if [[ $RUNLEVEL = 0 ]]; then
action="poweroff"
else
- action="reboot"
+ { read kexec_loaded </sys/kernel/kexec_loaded; } 2>/dev/null
+ if (( kexec_loaded )); then
+ action="kexec"
+ else
+ action="reboot"
+ fi
fi
# make /run/initrafs a mount