|
|
Subscribe / Log in / New account

tmpfiles footgun, apply directly to the forehead

tmpfiles footgun, apply directly to the forehead

Posted Jun 16, 2024 21:26 UTC (Sun) by bluca (subscriber, #118303)
In reply to: tmpfiles footgun, apply directly to the forehead by mb
Parent article: systemd 256 released

> Why does tmpfiles have *anything* to do with /home at all on a normal system?

None of this has anything to do with "tmpfiles" - it is just an unfortunate legacy name (that cannot be changed without breaking scripts), but sd-tmpfiles has not been about temporary files for years and years. Just check the entries in the tmpfiles.d directory, you'll see plenty of stuff under /etc/ and /var/.

Its purpose today, and since quite some time, is providing declarative configuration for creating/removing/purging files and directories that are not shipped directly inside packages, which translates to pretty much anything outside of the vendor tree (/usr/).
The reason there's a config entry for the /home and /srv top level directories is to allow seamlessly making those into subvolumes for the BTRFS use case.


to post comments

tmpfiles footgun, apply directly to the forehead

Posted Jun 16, 2024 21:38 UTC (Sun) by mb (subscriber, #50428) [Link] (4 responses)

>The reason there's a config entry for the /home and /srv top level directories is to allow seamlessly making those into subvolumes for the BTRFS use case.

That doesn't make a lot of sense to me.
If I wanted these directories to be subvolumes, I would have created them as such. No magic "help" from systemd required.

In fact, I use btrfs and I do _not_ want these to be subvolumes.

tmpfiles footgun, apply directly to the forehead

Posted Jun 16, 2024 21:40 UTC (Sun) by bluca (subscriber, #118303) [Link] (2 responses)

> In fact, I use btrfs and I do _not_ want these to be subvolumes.

Then mask it/override it. It's a default configuration drop-in, shipped in /usr/ exactly to allow modifying to one's liking, this is 100% supported

tmpfiles footgun, apply directly to the forehead

Posted Jun 16, 2024 21:48 UTC (Sun) by mb (subscriber, #50428) [Link] (1 responses)

>Then mask it/override it

Yeah, thanks for letting me know on LWN.
Much appreaciated, that I have to be on LWN to get that important information about what defaults you changed on my system.

What about: Do not change defaults. Ok?

tmpfiles footgun, apply directly to the forehead

Posted Jun 16, 2024 22:44 UTC (Sun) by bluca (subscriber, #118303) [Link]

> Much appreaciated, that I have to be on LWN to get that important information about what defaults you changed on my system.

It's not important information at all, and no defaults are changed. If you manually run some tools you don't know anything about, then you should read its documentation and the configuration files that come with it beforehand, that's just common sense. Nothing happens if you don't run it, so you don't have anything to worry about. As clearly explained in the documentation, these subvolumes are only created if the directories are missing, which happens only on firstboot with a read-only rootfs subvolume.

Ubuntu's defaults for btrfs root have been subvolumes for @home and @ for over a decade

Posted Jun 17, 2024 1:54 UTC (Mon) by Kamilion (subscriber, #42576) [Link]

Hm, This has always been the way ubuntu's done things whenever I've asked for btrfs root. I get two subvolumes, `@` and `@home`.
The apt-btrfs-snapshot package will add a hook that takes a snapshot of @ while excluding @home during most package management activities. I've found it to be quite helpful in the past *decade* since it's introduction somewhere around 2011-2013.

tmpfiles footgun, apply directly to the forehead

Posted Jun 17, 2024 4:34 UTC (Mon) by jccleaver (guest, #127418) [Link] (1 responses)

>None of this has anything to do with "tmpfiles" - it is just an unfortunate legacy name (that cannot be changed without breaking scripts), but sd-tmpfiles has not been about temporary files for years and years. Just check the entries in the tmpfiles.d directory, you'll see plenty of stuff under /etc/ and /var/.

What? Scope creep in systemd leading to bombs left for sysadmins years after the fact to discover the hard way? Surely not! That's impossible.

This ranks up there with the "Bricking laptops via an errant 'rm' command is a Good Thing" rationalization.

tmpfiles footgun, apply directly to the forehead

Posted Jun 17, 2024 5:45 UTC (Mon) by mjg59 (subscriber, #23239) [Link]

I'm the one who decided to expose efi variables via a filesystem in a way that let you rm things, and the intent was that it be mounted read-write by default. Any blame associated with rm -rf / bricking systems is on me, not systemd.

tmpfiles footgun, apply directly to the forehead

Posted Jun 17, 2024 14:34 UTC (Mon) by Wol (subscriber, #4433) [Link] (1 responses)

> None of this has anything to do with "tmpfiles" - it is just an unfortunate legacy name (that cannot be changed without breaking scripts), but sd-tmpfiles has not been about temporary files for years and years. Just check the entries in the tmpfiles.d directory, you'll see plenty of stuff under /etc/ and /var/.

Can't you rename it with a link to the previous name, and a note in the docu saying "these two are the same, but the old name is misleading and deprecated"?

I'm sure they do that elsewhere ...

Cheers,
Wol

tmpfiles footgun, apply directly to the forehead

Posted Jun 17, 2024 15:20 UTC (Mon) by bluca (subscriber, #118303) [Link]

That would result in a ton of bikeshedding, so can't be bothered honestly


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds