On Fri, 22 Sept 2023 at 20:41, Khalid Aziz <kha...@debian.org> wrote: > > Hello, > > I implemented automatic kexec reboot support to kexec-tools package many > years ago when Debian used init. It worked well except for some corner > cases. To support this, I also added a package config option to enable > kexec reboots on reboot command. Since Debian started using systemd, > automatic kexec reboot had been hit or miss depending upon the changes > in systemd. I got it back to working state by requiring users to do > kexec reboots using "systemctl kexec". Now Debian has switched to > systemd fully and I am removing init scripts from kexec-tools package. > Systemd maintainers made a change to systemctl command around 2021 that > caused "systemctl kexec" to no longer work the same way again. In short, > systemctl now has taken over the task of loading a kexec kernel which > was previously delegated to systemd service provided by kexec-tools. > systemctl loads kexec'able kernel only on the systems that support boot > loader spec which Debian does not. Now kexec-tools package no longer has > working automatic kexec reboot. > > To solve this problem in a reliable and consistent way, I am considering > changing the way kexec reboots are handled by kexec-tools package. > Current behavior (when it worked) is: > > - If config option "Should kexec-tools handle reboots?" is set to true, > a reboot command will cause a kexec reboot. > - With config option "Should kexec-tools handle reboots?" set to true, a > cold reboot requires using the command "coldreboot" which is a script > installed by kexec-tools package. > > I want to change the behavior to: > > - No package config option to do automatic kexec reboot. > - "reboot" command causes a cold reboot > - Use "kexec-reboot" command to do a kexec reboot. "kexec-reboot" is a > script installed by kexec-tools package. > - kexec-tools package no longer provides coldreboot script which is no > longer necessary. > > Any comments/feedback? I intend to proceed with implementing new > behavior next week after Wednesday unless there are objections or other > ideas.
Hi, In the next version of systemd, due in trixie in a couple of months, we are going to move the kexec-if-loaded behaviour from systemctl to logind itself. Also, we are going to integrate it with the new soft-reboot feature, so that it also automatically soft-reboots if a new rootfs has been loaded. So I would recommend to do no automation at all in kexec-tools, and let systemd handle it, so that it can be integrated with other reboot types and so on. Thanks.