systemd begrudgingly drops a safety net while a challenger appears, GNU Shepherd 1.0
Holidays come early for distro builders with two init systems to choose from
Everyone's favorite Linux component has hit a milestone, while a fresh contender comes of age – with a touch of Lisp.
In news that is sure to delight the Linux world, version 257 of systemd has arrived. Just a day before its release, a major new version of another Linux init system came out, GNU Shepherd version 1.0. They're very different ways of doing the same basic task, and we're happy to see more options in this particularly controversial role.
The last version of systemd, back in June, merited special attention from The Register – it received two separate articles. The first highlighted an impressively tone-deaf attempt at a joke, when the Fediverse announcement proclaimed that Version 256 of systemd boasts "42 percent less Unix philosophy." A week later, a point-release followed: systemd 256.1: Now slightly less likely to delete /home
.
To recap that fun little feature, if you run the systemd command to clear up temporary files, and you don't get it exactly right, it totally wipes the entire tree of user home directories. The headline feature of version 257 indicates to us that the repercussions of that hilarious incident are still being felt:
The –purge switch of systemd-tmpfiles (which was added in v256) has been reworked: it will now only apply to tmpfiles.d/ lines marked with the new "$" flag. This is an incompatible change, and means any tmpfiles.d/ files which shall be used together with –purge need to be updated accordingly. This change has been made to make it harder to accidentally delete too many files when using –purge incorrectly.
In summary, the developers have made a backwards-incompatible change to the format of one of its config files, which they're reluctant to do. The change in the file-format makes it less likely that unwary use of the command systemd-tmpfiles --purge
will remove all data for all users on the computer. So that's good.
The gist is that the systemd-tmpfiles tool was named so because originally it was designed to manage temporary files. Since then, it's grown to do much more. It manages many kinds of files that are created and removed in normal operation of a Linux computer. Its config file, which is called tmpfiles.d (and that link will tell you everything you could ever want to know about what files it can manage) now has a new specifier:
If the dollar sign ("$") is used, the file becomes subject to removal when systemd-tmpfiles is invoked with the –purge switch. Lines without this character are unaffected by that switch.
In other words, you have to specifically mark lines that describe the files that the purge
sub-command will remove. It's a small enough change, but it means that if that config file doesn't tell it to, the command systemd-tmpfiles --purge
now will not delete everything in every folder created since the first user was added. So that's good.
It is an absolutely minimal sort of fix, though. The fact is that the name systemd-tmpfiles is not remotely accurate any more. The tool no longer just manages temporary files. The developers could have made a deeper, more generally helpful change, such as renaming the command – but that would cause more breakage. (We suspect this probably is not function that is used often or by many people, but that's a separate consideration.) Whether this minimal config-file-format change, which does make things safer, is a better course of action than a more drastic, breaking one such as renaming a command is a judgement call.
It's fair to say that making the minimum possible form of change is a typical Unix sort of attitude. On the other hand, Apple's macOS is still a certified UNIX™ and it's made many far more sweeping changes than this – and yet it's by far the most successful commercial Unix in history.
The other changes are mostly far underneath the covers, so to speak, and will likely be invisible to anyone who isn't maintaining a Linux distribution. The tooling around the new Unified Kernel Image format is improved, cgroups
version 1 and System V service scripts inch close to being deprecated, it now understands volume button presses on mobile phones – showing how mainstream Linux is moving into more pockets – and it's offloaded some old keyboard handling code to X.org. The feature that made us smile is that during shutdown, systemd hands responding to the classic "three finger salute" back to the kernel. So if systemd crashes during shutdown, with any luck Ctrl+Alt+Delete will still reboot your computer. That one sounds handy.
(The Reg FOSS desk's top tip for rebooting balky systemd-controlled boxes is that if you press Ctrl+Alt+Del seven times within two seconds, it tells systemd to reboot immediately whatever is going on. Only try this if the machine's not shutting down normally as it might do bad things if it's not an emergency. It's also worth remembering the REISUB keystroke exists too.)
Shepherding services for Guix
The other new init system in the news this week is from the GNU Project, and it's called Shepherd. Shepherd itself isn't new. In fact, development started in 2003, so it's old enough to drink in the US. What is new is that the development team has released version 1.0. To go with this milestone in maturity, it also has a new logo and website.
- Linux 6.12 is the new long term supported kernel
- FreeBSD 14.2 wants to woo Docker fans, but still struggles with Wi-Fi
- Wubuntu: The lovechild of Windows and Linux nobody asked for
- Elementary OS 8 'Circe' conjures Wayland magic
The main distinctive thing about Shepherd is that it's implemented in GNU Guile. Guile is the GNU implementation of the Scheme programming language, and it was intended to be the GNU Project's standard extension language. Indeed, its original name was GEL, short for GNU Extension Language.
It is not a famous part of the story of the GNU project, but before Richard Stallman turned his hand to building a free Unix-like OS, he was a Lisp hacker, working on Lisp workstations, and he still retains his fondness for the language even now. That's why a Lisp dialect is a core official GNU language.
Scheme is a smaller, simpler version of Lisp, originally designed for educational use. As we quoted when talking about the revival of Medley/Interlisp, there are three main branches of the Lisp family tree: the stripped-down Scheme; Emacs Lisp, which is the extension language of the 800 lb gorilla of text editors, Emacs; and the heavily standardized Common Lisp. As Steve Yegge memorably put it:
Scheme is an exotic sports car. Fast. Manual transmission. No radio.
Emacs Lisp is a 1984 Subaru GL 4WD: "the car that's always in front of you."
Common Lisp is Howl's Moving Castle.
The slightly odd thing is that although it's been around for 31 years, Guile still isn't the basis of the GNU Project's flagship app, the GNU Emacs text editor. Emacs's long and tortuously complicated development history saw it move through five or six minicomputer OSes before the first rewrite for Unix by Java creator James Gosling. (The story has a twist you won't see coming, and we recommend reading the section from about page 30, or watching Gosling's 2019 interview from about the 2:52 mark.)
The lowest-level parts of GNU Emacs are implemented in C, but that C is used to implement Emacs Lisp, and nearly 70 percent of GNU Emacs is implemented in Emacs Lisp. You could almost say that the bulk of Emacs is implemented in Emacs. Moving it to Scheme would mean a total rewrite that would break an awful lot more user code than, say, renaming one systemd sub-command. There is an effort to do that total rewrite, the Guile-Emacs project, and it was relaunched this year.
Its use of GNU Guile makes Shepherd something of a flag-bearer for the Guile language and project. Additionally, Shepherd is the default init system of the GNU Guix distribution.
Guix is both a packaging tool and a distro built with that tool. Guix has closely comparable goals to Nix, and to the NixOS distro built with it. It aims to automate away manual package management. The key difference is that while Nix has its own, unique language for writing config files, Guix uses standard Guile Scheme, and so in theory it's more accessible to more people. We say "in theory" because Nix itself is really pretty niche even in the Linux world, and we hear far more about Nix than Guix.
Shepherd defines services in a restricted subset of Scheme. That is probably enough to immediately either win over, or forever put off, many people. Scheme uses Lisp-style prefix notation (yes, with lots of parentheses), which tends to polarize techies. If you like Lisp and Lisp-based systems, you might enjoy Enzuru's Lisp-centric Linux distro, which is still under construction.
We doubt that Shepherd is going to transform the Linux init system landscape, but it's good to see one of the alternative init systems taking a step towards greater maturity. ®
Bootnote
If the rather obscure pun in our subheading isn't clear, "Guix" is pronounced like geeks. So, no, Nix and Guix do not rhyme. They just look like they should.