I think the command “systemctl kexec” would like to have a word. Great command to know if you have a VM on a system you dont manage / share with others.
So you can just run kexec if its installed on the distro. This tells the kernel to boot into another kernel. The reason to use it with systemctl is to properly shut down all the services running in userspace. That command will have systemd gracefully turn off all services and then the new kernel with whatever updates / modules can be loaded in a clean environment.
Its useful if say, you have a VM in a data center. Now most of them provide a web gui where you can turn your VM off and then on. But if you’re lazy like me and already remoted into the terminal lol
but I still don’t get it. couldn’t you just systemctl reboot? it will boot the new kernel that way too. its supposed to be the same as from the web gui
If you run systemctl reboot on a non-vm it will actually power cycle the system and cause it to go back through the BIOS and then the bootloader. Using systemctl kexec allows you to “restart” the computer without having to go all the way back through the full boot process.
In the case of a VM, some are setup to do this behind the scenes. For example, virt-manager allows for direct kernel booting. If you look in the options there will be a path to the kernel. If its not setup that way, then the VM still has a bootloader. In that case, restarting the VM with kexec will allow for a faster reboot since the bootloader is skipped completely.
I think the command “systemctl kexec” would like to have a word. Great command to know if you have a VM on a system you dont manage / share with others.
won’t this kill all their processes just the same?
So you can just run kexec if its installed on the distro. This tells the kernel to boot into another kernel. The reason to use it with systemctl is to properly shut down all the services running in userspace. That command will have systemd gracefully turn off all services and then the new kernel with whatever updates / modules can be loaded in a clean environment.
Its useful if say, you have a VM in a data center. Now most of them provide a web gui where you can turn your VM off and then on. But if you’re lazy like me and already remoted into the terminal lol
but I still don’t get it. couldn’t you just systemctl reboot? it will boot the new kernel that way too. its supposed to be the same as from the web gui
If you run systemctl reboot on a non-vm it will actually power cycle the system and cause it to go back through the BIOS and then the bootloader. Using systemctl kexec allows you to “restart” the computer without having to go all the way back through the full boot process.
In the case of a VM, some are setup to do this behind the scenes. For example, virt-manager allows for direct kernel booting. If you look in the options there will be a path to the kernel. If its not setup that way, then the VM still has a bootloader. In that case, restarting the VM with kexec will allow for a faster reboot since the bootloader is skipped completely.
oh, so its useful for VMs that do direct kernel booting! will a simple reboot just fail on those systems?
I didn’t know about that one.
I hope it helps you someday! :)
Gtk what replaced ‘telinit 3’