"systemctl kexec" reboots
Bug #1862300 reported by
Alex Badea
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
finalrd (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
kexec-tools (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
After the introduction of finalrd, "systemctl kexec" (with a kernel preloaded by "kexec -l ...") no longer kexec()s -- it reboots instead.
Can be reproduced for example using a livecd (say, xubuntu-
sudo -i
apt-get update
apt-get install kexec-tools finalrd
systemctl start finalrd # optional
kexec -l /cdrom/
systemctl kexec
Expected results: the system kexec's into the kernel and panics (due to lack of /init, since we haven't given it an initrd).
Actual results: the system reboots (e.g. the livecd's bootloader menu runs).
If we don't install "finalrd" above, kexec works normally.
To post a comment you must log in.
Turns out, systemd's shutdown implementation fork/execs the kexec binary from kexec-tools; this is missing from the /run/initramfs finalrd. systemd then falls through to reboot: https:/ /github. com/systemd/ systemd/ blob/a859abf062 cef1511e4879c4e e39c6036ebeaec8 /src/shutdown/ shutdown. c#L557
One way to fix it might be for finalrd to "copy_exec /sbin/kexec" if it exists. Alternatively, the kexec-tools package might ship a finalrd hook instead.