You are not logged in.

#1 2024-05-14 20:57:28

corrobor
Member
Registered: 2021-02-19
Posts: 7

Kernel or mkinitcpio update: do i have to reboot?

I friends.

I have a mini PC (Intel n95) with Arch Linux which i use as "home server".

After almost 20 years of using arch Linux on my desktop, now i have a stupid doubt.

When i upgrade my "server" (by a classic Pacman -Syu), if i get a kernel upgrade or a module/mkinitcpio upgrade (so a preset regeneration) do i have to reboot my machine?

I think yes but i'm not 100% sure that Is necessary: given that i would prefer to restart this machine as little as possible, I prefer to remove by doubt by asking you this :-)

Thanks for the reply.

Have a nice day friends

Offline

#2 2024-05-14 22:34:28

loqs
Member
Registered: 2014-03-06
Posts: 18,140

Re: Kernel or mkinitcpio update: do i have to reboot?

There is no reason to reboot a system because the initrd has been regenerated.  If the kernel tries to load a module after it has been updated that will fail due to the mismatch between running kernel's version and the new kernel package's module version.  If all the kernel modules are already loaded meaning that will not be an issue then there is no need to reboot for a kernel update.

Offline

#3 2024-05-14 22:58:08

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 514

Re: Kernel or mkinitcpio update: do i have to reboot?

Offline

#4 2024-05-15 05:32:59

corrobor
Member
Registered: 2021-02-19
Posts: 7

Re: Kernel or mkinitcpio update: do i have to reboot?

Thanks for the reply.

So, if I understood:

1)if the kernel gets and update, It Is correct to reboot as soon as possoble. But by installing "linux-preserve-modules" aur package, i can restart the machine calmly, for example at night.

2)if an upgrade (NO kernel) regenerates the initrd (for example a mkinitcpio upgrade) there Is no reason to reboot.

Is it all correct?

Tnx so much

Last edited by corrobor (2024-05-15 05:33:21)

Offline

#5 2024-05-15 08:34:37

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 514

Re: Kernel or mkinitcpio update: do i have to reboot?

Yes. What might happen, though, is that you could find some edge case where a running process gets a file updated with a new version, and when it tries to read it, since it's a new version, is not compatible with the current process and it crashes.

Offline

#6 2024-05-15 10:17:39

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,069

Re: Kernel or mkinitcpio update: do i have to reboot?

There's one thing that hasn't been mentioned yet :

Sometimes changes to kernel or initramfs cause boot failures. You won't know if you're bitten by that until you reboot .

IF you delay  rebooting after such changes, don't run pacman -Syu until AFTER next boot .
Not doing that will make troubleshooting harder.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2024-05-15 13:25:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Kernel or mkinitcpio update: do i have to reboot?

corrobor wrote:

1)if the kernel gets and update, It Is correct to reboot as soon as possoble. But by installing "linux-preserve-modules" aur package, i can restart the machine calmly, for example at night.

No, not at all correct.  There is no need to reboot at all unless you need to load a new module that isn't already in use.  Such need is extremely rare on a running server: the modules you need are already loaded.

You will not get any performance benefits of the new kernel (if there are any) nor any security benefits (if there are any) until you reboot.  But other than these there is no reason at all to reboot.  There is certainly no reason to do so immediately if waiting until the night would be more convenient.

My server (public business website, and until very recently also my mail server) was last rebooted 238 days ago.  I don't think it needed a reboot at that time either.  In fact, if I recall correctly, that was a result of the VPS provider needing to migrate my VPS to other hardware due to a failing drive (and thanks to Linode, this whole migration to new hardware resulted in a grand total of only a couple minutes of downtime).  Other than that I might ensure the server gets rebooted every year or so so it doesn't lag too far behind on any security / performance improvements available in newer kernels.

Security minded people might say more frequent reboots would be valuable - and while I value security, I balance it with pragmatism. The lock on my front door will not keep *everyone* out, but no lock would - my current lock is "good enough" for my needs.  But in absolutely no case could any sane person say that security concerns require you to reboot immediately upon updating rather than waiting for overnight, or over the weekend, or another convenient time - that's just total bullshit, reboot when it's convenient for you and / or any users of your server.

Now another option to avoid even the extremely unlikely possibility of needing to load a new module that is no longer available: you can add the kernel to IgnorePkg so it is not updated with regular updates.  Then only update the kernel explicitly when you are planning to reboot anyways.  I've not done this on my server, though, as over nearly a decade of running it, I've not once had a single occurrence of needing to load a new module that wasn't available.  The opportunities for this to even happen are nearly non-existent on server hardware (it can be more common on desktop systems if / when new peripherals may be added periodically).

Last edited by Trilby (2024-05-15 13:34:34)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2024-05-15 20:40:23

corrobor
Member
Registered: 2021-02-19
Posts: 7

Re: Kernel or mkinitcpio update: do i have to reboot?

Trilby wrote:

... The opportunities for this to even happen are nearly non-existent on server hardware (it can be more common on desktop systems if / when new peripherals may be added periodically).

Thanx, very very usefull.

In fact mine is a headless server and I don't add peripherals...

At this point the question Is: could it be a good solution to migrate to the lts kernel? or does it also receive frequent updates?

Offline

#9 2024-05-15 20:56:22

loqs
Member
Registered: 2014-03-06
Posts: 18,140

Re: Kernel or mkinitcpio update: do i have to reboot?

corrobor wrote:

At this point the question Is: could it be a good solution to migrate to the lts kernel? or does it also receive frequent updates?

All upstream stable kernels including LTS are on the same schedule.

Last edited by loqs (2024-05-15 20:56:52)

Offline

#10 2024-05-15 21:06:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Kernel or mkinitcpio update: do i have to reboot?

LTS means the major (and I believe minor) versions are incremented less frequently and this in turn represents the fact that new features or new kernel behaviors are not added as often.  But security updates come at the same rate.  As a result an LTS kernel could reduce the frequency of having installed modules mismatching the running kernel - but that's not the rate limiting factor here anyways.  So in short, I don't think the LTS kernel would provide any benefit for your use - but neither would it have any downside.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2024-05-15 21:15:33

loqs
Member
Registered: 2014-03-06
Posts: 18,140

Re: Kernel or mkinitcpio update: do i have to reboot?

From the latest set of stable release candidates:

[PATCH 6.9 0/5] 6.9.1-rc1 review
[PATCH 6.8 000/340] 6.8.10-rc2 review
[PATCH 6.6 000/309] 6.6.31-rc2 review

All to be released on or after Fri, 17 May 2024 08:23:27 +0000.

Offline

#12 2024-05-16 07:44:05

corrobor
Member
Registered: 2021-02-19
Posts: 7

Re: Kernel or mkinitcpio update: do i have to reboot?

Ok i understod

Offline

Board footer

Powered by FluxBB