[systemd-devel] Why does reboot invoke kexec command?

Baoquan He bhe at redhat.com
Mon Feb 1 07:31:27 UTC 2021


On 01/28/21 at 03:24pm, Lennart Poettering wrote:
> On Do, 28.01.21 10:03, Baoquan He (bhe at redhat.com) wrote:
> 
> > Hi,
> >
> > >From systemd code, if kexec kernel is loaded, executing 'reboot' will
> > finally enter into reboot system call with KEXEC action. Wondering why
> > it has to invoke kexec command.
> 
> systemd reboots via kexec only if you ask it to. "systemctl kexec" will
> reboot via kexec, "systemctl reboot" will do a regular reboot.
> 
> > [ 1669.796863] dracut Warning: Killing all remaining processes
> > dracut Warning: Killing all remaining processes
> > [ 1670.134541] XFS (dm-0): Unmounting Filesystem
> > [ 1670.145779] dracut Warning: Unmounted /oldroot.
> > [ 1670.168229] dracut: Disassembling device-mapper devices
> > kexec: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by kexec)
> > [ 1670.197024] dracut Warning: kexec failed!
> > dracut Warning: kexec failed!
> > Rebooting.
> > [ 1670.211839] kvm: exiting hardware virtualization
> > [ 1671.457978] reboot: Restarting system
> > [ 1671.461965] reboot: machine restart
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> The logs above suggest dracut does kexec in your case, not systemd?

Ah, right. It's done in shutdown.sh, then call systemd to
reboot|poweroff|halt|kexec. Seems both dracut and systemd do the triage
of shutdown. The above failure happened in dracut firstly. I will check
in dracut side, thanks a lot for looking into this.

/usr/lib/dracut/modules.d/99shutdown/shutdown.sh

Thanks
Baoquan



More information about the systemd-devel mailing list