diff options
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-x | rc.shutdown | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rc.shutdown b/rc.shutdown index d0d8405..c708b92 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -71,7 +71,7 @@ if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then stat_done fi -[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] && +[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] && status "Deactivating LVM2 groups" vgchange --sysinit -a n &>/dev/null run_hook shutdown_poweroff @@ -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 |