Soft-reboot in systemd 254 sounds a lot like Windows' Fast Startup
- Reference: 1690982050
- News link: https://www.theregister.co.uk/2023/08/02/systemd_254/
- Source link:
This brings at least one fairly significant user-facing change that may even be noticed by people who never interact with their init system in any way: faster system reboots.
Some of the other changes will force extra work onto distro maintainers, though. Not all systemd-based distros have merged their /usr hierarchy yet, but this is the last release of systemd which will work with split /usr trees. The [3]usr merge is at heart just a fix for some artefacts of the gradual evolution of Unix and Unix-like systems, but over time it grew into dogma.
[4]
Under Unix-like OSes, there are a whole bunch of places where programs may be kept: /bin (which once was short for "binaries"), /sbin (nominally "system binaries", those needed to boot the computer), /usr for binaries needed by ordinary users, which also contains /usr/bin/ and /usr/sbin/ , and dozens more. The [5]hier(7) manual page has the gory details. There's a whole rationale for this, involving starting computers from extremely small boot media and keeping only the most essential parts on it, and so on, but it's just folklore and post facto justification. The truth is, this started out as cruft that just accreted over the early development of Unix, as recounted in this superb and very readable [6]brief history .
[7]
[8]
The systemd developers [9]plan to drop support for unmerged /usr hierarchies with the next version. Fedora 17 led the way, and openSUSE Tumblweed [10]made the switch as long ago [11]as 2012 . We're not so sure about Leap and SLE, though: there were still special [12]precautions as late as SLE 15 SP4, and we've seen a [13]report that Leap 15.5 hasn't completed it yet.
The Debian team [14]has been working on the merge for years, but as [15]LWN reports , it's not there just yet. This won't happen in a point release, though, and since [16]Debian 12 is only about a month old , we won't see this until [17]Debian 13 "Trixie" in about 2025 .
[18]
Also, systemd's remaining limited support for System V init scripts – such as the [19]systemd-sysv-generator tool – are going away. The Reg FOSS desk is very happy that he hasn't had to edit an init script in many years, and does not miss such things even one tiny bit, but all the same it's going to irk some people.
If you're not a system administrator, the new [20]soft-reboot may well be what you notice most. This feature should deliver much faster system reboots so long as you don't need to restart your kernel. It shuts down all userland processes – that is, everything "above" the level of the kernel – mounts a new root filesystem on /run/nextroot/ , starts a new systemd instance in there, and then hands over control.
This distinctly reminds us of two features. One is Windows' [21]Fast Startup , which debuted way back in Windows 8. With it enabled, when you shut down a Windows machine, it doesn't fully shut down. Instead it logs you out, shuts down all the user's processors, and then hibernates. When you turn the computer back on, instead of reloading the entire operating system, the Windows kernel wakes from hibernation, then either shows the login screen – or just logs you in and starts up as normal.
[22]
The snag with this is that if you dual-boot with Linux, the Windows partition is still technically mounted by the sleeping Windows kernel… so you can't mount it in Linux. Worse still, if you list your NTFS partitions in your /etc/fstab file, systemd will pause and wait for them to become available. Which, of course, they never will, because Windows is hibernated and your machine is currently booted into Linux instead… so your computer fails to boot.
[23]Three signs that Wayland is becoming the favored way to get a GUI on Linux
[24]Canonical takes its LXD 'containervisor' back into the house
[25]Alpine Linux 3.18 fixes DNS over TCP issue, now ready for all the internet's problems
[26]Had enough of Android? First 'Focal' based Ubuntu Touch is out
(There's an easy workaround: just disable Windows hibernation. Open an Admin command prompt, and type powercfg /h off . Reboot, and it should never happen again.)
This just shows the sort of hard-to-predict problem that an ostensibly clever feature, such as Windows Fast Startup, can cause. We suspect that the mighty all-knowing systemd developers don't do proletarian things like dual booting. In fact, as [27]Agent P works for Microsoft these days , maybe he just runs WSL 2 instead.
Linux used to have a different but comparable fast-boot feature, which was a side effect of a kernel debugging tool called [28]kexec . Although this did have [29]security implications , it was a handy tool, even [30]endorsed by IBM . Sadly, it [31]stopped working on Ubuntu years ago.
We can see systemd-reboot causing some of the same issues that rebooting with kexec used to. If you have more than one operating system installed, bypassing the POST process means that you only see your boot menu on a cold start. That means that when you reboot, you can only do it back into the same OS. Also, today, a very common reason for rebooting a Linux computer is to apply kernel updates, but these fast reboots won't help there: your system reloads on top of the self-same kernel. That might not be a problem if you are an [32]enterprise user with live kernel patching enabled , but for the rest of us, it's a new complication to beware of.
There are of course technical ways around this: the system reboot scripts can be made aware of newly installed kernels, and desktop GUIs could be made aware of two different reboot mechanisms. Distro developers are going to find ways to handle this and make efficient use of it… But the flipside is that it means systemd will gradually encroach on even more of your operating system. We suppose that will give the haters something else to shout about. ®
Get our [33]Tech Resources
[1] https://github.com/systemd/systemd/releases/tag/v254
[2] https://lwn.net/Articles/499480/
[3] https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZMp9o7ePCC--odqg2uvH1QAAA0Y&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[5] https://linux.die.net/man/7/hier
[6] http://lists.busybox.net/pipermail/busybox/2010-December/074114.html
[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZMp9o7ePCC--odqg2uvH1QAAA0Y&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZMp9o7ePCC--odqg2uvH1QAAA0Y&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[9] https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html
[10] https://en.opensuse.org/openSUSE:Usr_merge
[11] https://packageninjas.github.io/packaging/2020/10/13/news-in-packaging.html#usr-merge
[12] https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP4/index.html#system-management
[13] https://www.reddit.com/r/systemd/comments/15bryk6/comment/jtsbfqa
[14] https://www.theregister.com/2016/11/24/debian_testing_merged_codeusrcode/
[15] https://lwn.net/Articles/933043/
[16] https://www.theregister.com/2023/06/05/debian_12/
[17] https://www.theregister.com/2023/07/25/debian_121/
[18] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZMp9o7ePCC--odqg2uvH1QAAA0Y&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[19] https://www.freedesktop.org/software/systemd/man/systemd-sysv-generator.html
[20] https://www.freedesktop.org/software/systemd/man/systemd-soft-reboot.service.html
[21] https://learn.microsoft.com/en-us/windows-hardware/test/weg/delivering-a-great-startup-and-shutdown-experience
[22] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZMp9o7ePCC--odqg2uvH1QAAA0Y&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[23] https://www.theregister.com/2023/07/13/wayland_is_coming/
[24] https://www.theregister.com/2023/07/07/canonical_takes_lxd_inhouse/
[25] https://www.theregister.com/2023/05/16/alpine_linux_318/
[26] https://www.theregister.com/2023/03/29/first_focal_based_ubuntu_touch/
[27] https://www.theregister.com/2022/07/07/lennart_poettering_red_hat_microsoft/
[28] https://linux.die.net/man/8/kexec
[29] https://mjg59.dreamwidth.org/28746.html
[30] https://web.archive.org/web/20130121033946/http://www.ibm.com/developerworks/linux/library/l-kexec/index.html
[31] https://unix.stackexchange.com/questions/621541/kexec-reboot-no-longer-skips-firmware-hard-reboot-after-upgrade-to-ubuntu-20-04/
[32] https://www.theregister.com/2022/10/06/ubuntu_pro_free/
[33] https://whitepapers.theregister.com/
"But the flipside is that it means systemd will gradually encroach on even more of your operating system."
BSD gets closer.
It's very close in my world. I've just started bringing my daily driver laptop more up to date from Ubuntu 16.04 to something still in support (mainly because software is now doing OS checks, and stopping working after the OS leaves mainstream support), and now when I use it (it's currently at 20.04) I'm noticing broken things left, right and centre. Almost everything I've tried to do ends up with having to fix something before I can finish the job.
The current annoyance is that when using X.org, I'm getting background corruption, and every now and then I get my terminal sessions just flashing junk on the screen, before reverting to readable text. This is liveable with, but is incredibly annoying (and it's not just on one terminal program, it seems to affect them all!). Oh, and the fact that Network Manager keeps dropping out, leaving me with no working network connections.
20.04 should already be quite mature, so I can't really understand why these problems still exist. I can't say that they are systemd related, but some of the problems I have had (like DNS name resolution failing after one upgrade) have been. But taken together with other Linux moves away from UNIX, it's making me want to to ditch Linux completely.
I'm just wondering whether to do it now before putting Ubuntu 22.04 on the system.
There's e.g. Devuan (which just... works out of the box on a reasonably current laptop), if you want to stay with a Debian derivative. There's other alternatives as well. Don't really like Ubuntu anyway...
those issues remain...
Don't feel too bad I am current with Debian 'stable' and those issues are still present even with the new shiny in place. NetworkManager continues to drop out constantly garbage in the terminal fonts that appear garbled at boot.
BSD gets closer.
I've only got one systemd-infested VM - I wanted to spin up a Mastodon instance and couldn't find it in my usual OS builds (Devuan and FreeBSD).
So Ubuntu LTS was installed.
The proprietary UNIX systems I use every working day still have separate /, /usr, /var, /home and /opt filesystems.
In the case of AIX, this is largely because of the diskless boot operations that still want / and /usr to be completely read-only (although I've come across IBM supplied software that broke those rules - it cam as a great surprise to the people who wrote some AIX hardware maintenance task scripts that they could not write to /usr because it was read-only!)
Oh. and in case you wonder whether this is actually used any more, the IBM Power 775 Supercomputer systems running AIX ran their compute nodes as diskless systems, but I suppose that even this is more than 5 years ago.
I don't recall AIX installations ever giving you an option to not have those default filesystems, it just creates them regardless. I know we collapsed everything into /, /var and /home years ago on Solaris when I used to work with it. There didn't seem to be much need for the separation of usr & opt and it added overhead to systems management and meant we could run slices 5 & 6 for Live Upgrade targets. ZFS root then removed the option of a separate usr or opt filesystem and it was sometimes a pain to even get /var split off.
When I started working with Solaris in the late 90s, we were told / & /usr were separate to help system recovery as we should be able to recover a system from just the root filesystem. As /usr/bin & /usr/sbin migrated into symlinks from their equivalents in /, that became less of a fact of life, but "we've always done it that way" creates a whole legacy of its own. This was also back in the day I suspect some larger systems had to split them into different disks because of size limitations.
One minor thing: I like having /opt - for the stuff I build myself that is not related to the OS as per the "vendor".
I feel its going the wrong way, we want *more* separate hierarchies.
The BSD /usr/local approach is very nice to separate ports/packages from the base install. Linux distros often lack a coherent concept of a base and now with this merge, it will get even harder.
Weirdly I really like the Solaris (i. 10) approach of /opt/csw, /usr/sfw, /usr/ucb, etc. And the OpenBSD Xenocara in /usr/X11R6 is just much neater.
One of my projects is designed to take this even further, and create small self-contained / encapsulated hierarchies out of any package and dependencies: https://github.com/osen/pkg_bundle
TL;DR; I basically don't like packages and dependencies and all their cruft sprawled all over my systems. It makes it difficult to audit for one.
"The Reg FOSS desk is very happy that he hasn't had to edit an init script in many years, and does not miss such things even one tiny bit, but all the same it's going to irk some people."
It's a long time since I had to edit an init script. It's like restoring from backup. You don't miss doing it if you haven't had to but when you need it you really need it. With init scripts if there's a problem you can either put tracing statements into the script or run it from the command line, stepping through it. Good luck doing that with a black box. Systemd hasn't put me to that trouble, partly because it hasn't had the chance. Years back I had a shedload of trouble sorting out a problem with upstart which is similarly opaque.
I rarely edit init scripts, but the ability to run then line at a time by hand can sometimes be a lifesaver. Some of this really feels like development for the sake of justifying P's employment.
"Some of this really feels like development for the sake of justifying P's employment."
Well, yes. That's systemd in toto.
I'm happily using Gentoo and living without systemd or his god-awful sound system.
Hmmm
While I agree that /usr is somewhat 'overgrown' I do very much like the separation between /usr/{stuff} and /usr/local/{stuff}
Re: Hmmm
That is staying, because it is useful. It's just the /bin Vs /usr/bin part that is being merged.
Re: Hmmm
And for no reason at all.
Who is this change helping? Why do the systemd devs get to decide these things? I'm not paying them or asking them to. I'd pay them to *stop* coding if I could afford to.
This feature should deliver much faster system reboots so long as you don't need to restart your kernel.
OK, I'll bite. When might I want to reboot but not restart the kernel? I have two desktop machines running Linux and I only ever reboot them when I do a kernel upgrade.
Usecase?
"This feature should deliver much faster system reboots so long as you don't need to restart your kernel."
Not sure why I would need that. Windows did need to be rebooted for almost everything (the running gag was "mouse movement"), but Linux? Only if you do stuff for the kernel, and even then there was some way to switch that over (it was a loooong time ago that I tried that out, so memory might not be as fresh as it never was). And the article mentions as much in the second to last paragraph. So I am confused.
I also don't really get the argument " The /usr merge also allows making the entire vendor-supplied OS resources read-only for increased security and robustness." why was this impossible before? Why do we get better "separation between vendor-supplied OS resources and machine-specific"? Surely merging directories makes it more difficult (and I totally get it, stuff ended up apparently randomly in /usr/bin and /bin and likewise sbin because some people could not be arsed to think about that issue...). To be honest I don't care either way...
(and I have not had to edit an init file in a looong while either, but I had some run ins with the oh-so-clever systemd and its kraken of tools that made it pretty difficult to fix network and sound problems I had, so there's that). I use my computers for work and recreation and expect them to "just work" and no longer like to fiddle with stuff (which is why I now prefer Linux), rather than a few decades age, when I wnated to fiddle with stuff (which is why I preferred Linux back then).
I'm not saying systemd is bad. But then I'm not saying it is actually good. (but I have been burned by pulseaudio... but if you look at my older code I freely admit it was shite, so no hard feelings there?)
Once again
Ah yes, once again systemd is "solving" another problem that didn't exist. I can honestly say that I have had far more problems with systemd than any other init system I've used on any OS over the past three decades; frankly it's garbage.
Who on earth edits init files anyway? I just don't get it. I mean, distribution package maintainers presumably do, but ordinary users or even sysadmins? In my experience no other init system is so convoluted, nor so fragile and above all, so infuriatingly pointlessly dog slow; it just seems to hang up fatally at every possible opportunity for the most trivial of things. Just the other week I had a new systemd botchup to add to my lengthy list of reasons to hate it; suddenly a server which has been in production for several years came crawling to a halt; the / partition was apparently suddenly full when it had 70% free for years. To cut a very long story short, clearing around 3 gigs of logs (systemd as logger) suddenly freed up ten times that amount of space. Never had that issue with any other logger, nor seen any particular reason why my init system should also be the system logger.
I don't merely hate systemd because of its primary author, I hate it because it's demonstrably far worse than what we had before (and what I still use on my own most important systems) and most of all because it constantly and inexorably grows like a particularly aggressive cancer whilst becoming harder and harder to avoid.
Re: Once again
In this case, it's solving a problem that it has largely created. The requirement to reboot after most updates is due in no small part to the way that systemd has taken over so much of the OS. It used to be that you could just restart services and carry on, but now even relatively minor updates require a reboot. This is a problem that would only get worse under poettering's plan to cram update management into systemd, using read-only system images.
something else to shout about
We suppose that will give the haters something else to shout about.
You hit that one right on the head.