the systemd magic that detects whether to do kexec or not, is only
applied if we invoke reboot. systemd internally maps reboot to one or
the other of 'systemctl reboot' or 'systemctl kexec'. Therefore the
current implementation which just call 'systemctl reboot' does not
transparently detect for kexec. As we don't want to rely on the
magic behind the reboot call we explicitly call systemctl with
reboot or kecec depending on the configured soft_reboot
configuration option. This is then also in line with the code
that runs 'kexec load' which also depends on the configured
soft_reboot value.
the systemd magic that detects whether to do kexec or not, is only applied if we invoke reboot. systemd internally maps reboot to one or the other of 'systemctl reboot' or 'systemctl kexec'. Therefore the current implementation which just call 'systemctl reboot' does not transparently detect for kexec. As we don't want to rely on the magic behind the reboot call we explicitly call systemctl with reboot or kecec depending on the configured soft_reboot configuration option. This is then also in line with the code that runs 'kexec load' which also depends on the configured soft_reboot value.