I'm attempting to synthesize the instructions found here with this as mentioned previously in order to get kexec to work with Proxmox 7 for fast reboots. Some servers I work with have just insane reboot times and this would help dramatically in some situations.
I ended up taking the following steps and am hoping that someone could shed some light onto what is missing or wrong here in order to make this work correctly:
And for good measure:
Any observations / corrections?
UPDATE FROM @juliokele
At the point mentioned above, one can now do the following to start via fast reboot:
By doing the following you can simply use
"normal" reboot override:
And to change it back, "normal" reboot restore:
I ended up taking the following steps and am hoping that someone could shed some light onto what is missing or wrong here in order to make this work correctly:
$ nano /etc/systemd/system/kexec-load.service
Code:
# File: /etc/systemd/system/kexec-load.service
[Unit]
Description=boot into into the current pve kernel
Documentation=man:kexec(8)
DefaultDependencies=no
Before=shutdown.target umount.target final.target reboot.target
RequiresMountsFor=/boot
[Service]
Type=oneshot
ExecStart=/sbin/kexec -l /boot/pve/vmlinuz --initrd=/boot/pve/initrd.img --reuse-cmdline
[Install]
WantedBy=kexec.target
$ mkdir -p /etc/systemd/system/systemd-reboot.service.d/
$ nano /etc/systemd/system/systemd-reboot.service.d/override.conf
Code:
[Service]
Type=oneshot
ExecStart=
ExecStart=-/bin/systemctl --force kexec
ExecStart=/bin/systemctl --force reboot
And for good measure:
$ nano /usr/local/bin/normal-reboot
Code:
#!/bin/sh
# File: /usr/local/bin/normal-reboot
mkdir -p /run/systemd/transient/systemd-reboot.service.d/
ln -sf /dev/null /run/systemd/transient/systemd-reboot.service.d/override.conf
ln -sf /dev/null /run/systemd/transient/kexec-load.service
systemctl daemon-reload
reboot
$ chmod 0755 /usr/local/bin/normal-reboot
$ systemctl enable kexec-load.service
##### SEE UPDATE DOWN A FEW LINES #####
$ reboot
Any observations / corrections?
UPDATE FROM @juliokele
At the point mentioned above, one can now do the following to start via fast reboot:
Code:
systemctl restart kexec-load.service
systemctl kexec
By doing the following you can simply use
reboot
to reboot quickly / fast reboot and normal-reboot
to reboot fully (normally) such that the hardware reboots:
Code:
systemctl enable kexec-load.service
systemctl start kexec-load.service
"normal" reboot override:
Code:
ln -s /usr/lib/systemd/system/kexec.target /etc/systemd/system/reboot.target
And to change it back, "normal" reboot restore:
Code:
rm /etc/systemd/system/reboot.target
Last edited: