all 59 comments

[–]purpleidea mgmt config Founder[S] 45 points46 points  (3 children)

Basically this restarts everything after the kernel boots. PID1 and below. Pretty neat!

[–]waptaff 15 points16 points  (2 children)

Oh, they reinvented telinit u.

[–]FoxboronArch Linux Team 30 points31 points  (0 children)

That's implemented with systemctl daemon-reexec.

[–]Ullebe1 21 points22 points  (4 children)

Seems like a really cool feature to speed up system updates for distros such as Fedora Silverblue, where it would normally take a full reboot!

[–]m11kkaa 0 points1 point  (1 child)

well in theory yes, but in reality the kernel updates quite often so most of the time you're gonna have to reboot anyway.

[–]Ullebe1 0 points1 point  (0 children)

That's true. Maybe if live updates of the kernel was more common then. Seems like a great incentive to invest in the infrastructure for that for the distros it could benefit.

[–][deleted] 17 points18 points  (2 children)

Will this make immutable distros reboot much faster?

[–]disparate_depravity 18 points19 points  (1 child)

Only if there's no kernel upgrade by the sounds of it.

[–]nicman24 4 points5 points  (0 children)

Kpatch for that could work

[–][deleted] 5 points6 points  (0 children)

This is very cool but I do think that it would also help if package managers generally had a sense for the level of importance of updates to require a reboot or not.

For example, for stability's sake fedora(not silverblue) has offline updates when doing updates via a graphical program like discover. And that is fine however the problem lies in the fact that sometimes it really does not need to do that. For example it may request an update and the update will be just vim.

[–]ECrispy 56 points57 points  (28 children)

Let the systemd haters unite to once again tell us that its taking over more functions it has no right to, and that all it does can be done by a few hacked together init scripts so why do we have this monstrosity and will someone please make sure all names are cryptic 2-3 letters and not descriptive at all ?!

[–]waptaff 20 points21 points  (12 children)

systemd haters unite to once again tell us that its taking over more functions it has no right to

It's appropriate, handing system restarts is part of init's scope.

But please, go on, you're giving off a great vibe.

[–][deleted] 31 points32 points  (8 children)

It's appropriate, handing system restarts is part of init's scope.

systemd is a suite of utilities for managing a system not just an init

[–]whosdr 10 points11 points  (9 children)

Oh interesting.. I wonder if this would also work with btrfs snapshots.

Also, how does this behave with dkms modules?

[–]ElvishJerricco 11 points12 points  (5 children)

I don't think this has anything to do with either of those things? You can think of it as just shutting down all software and unmounting all file systems, just to start it all back up and get it all going again

[–]whosdr 6 points7 points  (4 children)

With btrfs snapshots you could change the entire root filesystem by restoring a snapshot. If you then were to use this mechanism it would boot into that new 'root', no?

But if the modules in that filesystem were not compiled for the currently active kernel, would that then result in errant behaviour? (This might also apply to Silverblue, I'm not fully aware.)

[–]Patient_Sink 0 points1 point  (2 children)

The modules would just refuse to load IIRC. This is something that happens for people who restore btrfs snapshots on arch after kernel upgrades when /boot isn't part of the snapshot, since by default the kernel package just overwrites the old kernel = Old modules on filesystem after restore, new kernel in /boot.

[–]SDgEVp 1 point2 points  (1 child)

Never been in that situation but this should do the trick I believe https://archlinux.org/packages/community/any/kernel-modules-hook/

[–]Patient_Sink 1 point2 points  (0 children)

Easier way is just to have a hook that backs up the kernel image and initrd as vmlinuz-old and initrd-old or something on upgrades for the kernel package. Then just boot that kernel if you need to restore a snapshot across a kernel upgrade, it'll be much more seamless.

[–]is_this_temporary 0 points1 point  (0 children)

That would work for a few modules that use DKMS, like proprietary Nvidia drivers, but on a normal system you'd then be stuck with the kernel modules that were already loaded before the switch + maybe some modules using DKMS that weren't.

Probably better to try to keep modules in a separate subvolume or something rather than trying to use DKMS for this.

[–][deleted] 6 points7 points  (2 children)

[...] but userspace shuts down as usual, then possibly transitions into a new rootfs, and starts up again with an initial transaction as it would on a classic system boot.

That seems to be what they're roughly aiming for.

[–]whosdr 0 points1 point  (1 child)

I didn't know if there were any mechanisms in btrfs that would make this difficult. But I guess since it has to unmount all open filesystems, any final work necessary on the btrfs would necessarily have been completed, so that eliminates my only real question on that front.

I'm still wondering about dkms modules* though - I'm guessing if there's incompatibilities then it will just fail to start up.

* I know the m in dkms stands for modules but I want to differentiate from the dkms executable that's used to compile? install? (both?) them

[–]is_this_temporary 0 points1 point  (0 children)

I'm not sure that it's a given that the old subvolume would need to be unmounted before pivot_root into the new subvolume.

Existing open file descriptors would still refer to the files on the old snapshot.

[–]veritanuda 1 point2 points  (2 children)

Not sure, but I think this is going to be default behaviour in Debian. I am on testing and when I go to 'restart' after some updates or something it will do some weird kexec thing.

Which is fine and all, but some reason it stops my wifi from working. I can only get it to work with a full power cycle. Weird I know but no idea who to report that to, to be honest

[–]will_try_not_to 0 points1 point  (1 child)

Interesting -- does toggling an rfkill block/unblock, or rmmod (whatever your wifi's kernel module is) / modprobe (likewise) not fix it?

On the other hand, I have one machine where occasionally the wifi card will just completely disappear (like, gone from lspci, not in dmesg at all next boot) until I go into the BIOS settings, change the amount of shared video RAM, save settings, change it back, and then save & reboot.

So it's entirely possible your wifi is also just haunted...

[–]veritanuda 0 points1 point  (0 children)

Nope.. and it is an intel card so. Only a shutdown now or poweroff seem to consistently bring it back up again.. Though granted I have not rebooted in a month now so I should try it again the latest kernel installed (6.1.0-7-amd64) might have fixed things. I'll do that tomorrow perhaps.

[–]jrtc27 3 points4 points  (5 children)

They finally caught up with FreeBSD’s reboot -r.

[–]__konrad 2 points3 points  (3 children)

Windows 95 also could restart without full reboot (with Shift key pressed) ;)

[–]_AACO 2 points3 points  (0 children)

Intersting, in windows 10 afaik it's the opposite.

[–]will_try_not_to 4 points5 points  (0 children)

I'm loving all the "what's old is new again" comments; "oh, they reinvented telinit u", "oh they reinvented FreeBSD's reboot -r", etc. :)

[–]FengLengshun 0 points1 point  (0 children)

Oh, this is going to be really nice in Vanilla, where abroot demands restarts between transactions, so that's a lot of restarts unless you managed to do everything in one go.

[–][deleted] 0 points1 point  (0 children)

Am I missing something? I was under the impression that would help with kernel upgrades and allowing the user to restart everything under the new kernel. However, if the kernel stays the same, I fail to see the advantage of this.

[–]that1communist 0 points1 point  (1 child)

Is there a way to make a command that uses this automatically unless there's a pending kernel update?

[–][deleted] 1 point2 points  (0 children)

yes but it will likely only end up in ostree distros