News: 1718897647

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

systemd 256.1: Now slightly less likely to delete /home

(2024/06/20)


Following closely after the release of version 256, version 256.1 fixes a handful of bugs. One of these is emphatically not systemd-tmpfiles recursively deleting your entire home directory. That's a feature.

The latest release of systemd, [1]version 256.1 , is out, containing some 38 minor changes and bugfixes. Among these are some changes to the help text around the [2]systemd-tmpfiles command, which describes itself as a tool to "Create, delete, and clean up files and directories." Red Hat's RHEL documentation [3]describes it as a tool for managing and cleaning up your temporary files.

That sounds innocuous enough, right?

[4]

It isn't, as Github user [5]jedenastka discovered on Friday. He filed [6]bug #33349 and the description makes for harrowing reading, not just because of the tool's entirely intended behavior, but also because of the systemd maintainers' response, which could be summarized as "you're doing it wrong".

[7]

[8]

The systemd-tmpfiles command manages files according to a specification file called [9]tmpfiles.d , and, among many others, it has an option called --purge , which sounds quite handy according to its own manual page:

–purge

If this option is passed, all files and directories created by a tmpfiles.d/ entry will be deleted.

Among the issues fixed in version 256.1 are that even as long as [10]five years ago , systemd-tmpfiles had moved on past managing only temporary files – as its name might suggest to the unwary. Now it manages all sorts of files created on the fly… such as things like users' home directories. If you invoke the systemd-tmpfiles --purge command without specifying that very important config file which tells it while files to handle, version 256 will merrily purge your entire home directory .

That fun little nugget of info [11]broke over on Mastodon and has attracted considerable attention. Some of this has been directed at the first response to the bug report, from systemd team member [12]Luca Boccassi :

So an option that is literally documented as saying "all files and directories created by a tmpfiles.d/ entry will be deleted", that you knew nothing about, sounded like a "good idea"? Did you even go and look what tmpfiles.d entries you had beforehand?

Maybe don't just run random commands that you know nothing about, while ignoring what the documentation tells you? Just a thought eh.

If Boccassi's name is unfamiliar to you, he is the chap who came up with the [13]pithy line "now with 42% less Unix philosophy" which we reported in our [14]story on the release of systemd 256 .

No, it did not originate with systemd daddy Lennart "Agent P" Poettering. We do note, however, that Boccassi is Poettering's colleague at Microsoft… And we used the line not only for its Hitchhikers Guide reference, but because it genuinely made us chuckle. In the delicate world of open source politics, though, perhaps a smidgen more diplomacy is sometimes needed.

[15]Version 256 of systemd boasts '42% less Unix philosophy'

[16]MX Linux updates Libretto, belts out 23.3, based on Debian 12.5

[17]Malicious xz backdoor reveals fragility of open source

[18]Venturing beyond the default OS on Raspberry Pi 5

Thus, despite an initially rather hostile response along the lines that the command was only doing what it said on the tin, always read the label, may contain nuts, etc, this command has now sprouted a few more warnings. Now, the --purge subcommand [19]insists on a specification file, the [20]command summary is more explicit and admonishes care, there's a [21]warning in the man page, and the [22]description of the systemd-tmpfiles tool no longer contains the word "temporary". It isn't much, but it's something. This is among other modest changes, of course.

It's a useful reminder to all concerned. We're all busy, and nobody has time to read the docs in full every time. Names matter, and the wider world probably won't notice when you change what a tool does if its name still refers to a now-obsolete definition.

A small joke can ricochet around the world in the time that it takes one erroneous command to wipe all your data, which – thanks to SSDs – happens more quickly than ever. These tools are written and maintained by small teams of mere humans, and humans mess up occasionally. And if your command can potentially do something really dangerous, then don't let people just run it without warning them and checking. ®

Get our [23]Tech Resources



[1] https://github.com/systemd/systemd/compare/v256...v256.1

[2] https://www.freedesktop.org/software/systemd/man/latest/systemd-tmpfiles.html

[3] https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7#

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZnRSHvU4iEP3sAWm8JmiSQAAABU&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[5] https://github.com/jedenastka

[6] https://github.com/systemd/systemd/issues/33349

[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZnRSHvU4iEP3sAWm8JmiSQAAABU&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/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZnRSHvU4iEP3sAWm8JmiSQAAABU&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[9] https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html

[10] https://github.com/systemd/systemd/issues/12447

[11] https://mathstodon.xyz/@bremner/112615591101488528

[12] https://github.com/bluca

[13] https://social.vivaldi.net/@bluca@fosstodon.org/112600235620499886

[14] https://www.theregister.com/2024/06/13/version_256_systemd/

[15] https://www.theregister.com/2024/06/13/version_256_systemd/

[16] https://www.theregister.com/2024/05/21/mx_linux_233_released/

[17] https://www.theregister.com/2024/04/01/xz_backdoor_open_source/

[18] https://www.theregister.com/2024/03/07/alt_pi_5_linux_distros/

[19] https://github.com/systemd/systemd/commit/e76015738942246db70f444b3567afd1b132f824

[20] https://github.com/systemd/systemd/commit/08b8237303efdf072a0f61615b7f1633eafc8e0a

[21] https://github.com/systemd/systemd/commit/aedeaf745028a463150fd6d2b1aca778797735ac

[22] https://github.com/systemd/systemd/commit/1a0e6961cfaed42bda542e111738c136f7b4d73f

[23] https://whitepapers.theregister.com/



Isn't systemd great?

Joe W

It saves quite a bit of work for the BOFH, doesn't it?

"My home directory is full, and I need more space"

*klickety-klick*

"you now have 20MB free"

"oh, great, now I have a total of 40MB!"

"No, 20MB, and they are free."

QOTD:
"Every morning I read the obituaries; if my name's not there,
I go to work."