FYI, there is a bug in systemd. So, running: "systemd-tmpfiles --purge" will delete your /home/ in systemd version 256. #linux

Source: https://mathstodon.xyz/@bremner/112615591101488528 and https://x.com/DevuanOrg/status/1802997574695080067

David Bremner (@[email protected])

Content warning: systemd-tmpfiles, deleting /home

Mathstodon
@nixCraft Bug or feature? 😃
@aaronk6 @nixCraft on the grand scheme of things, all files are temporary
@aaronk6 systemd has no bugs it only has under-documented features
@nixCraft True corporations‐first approach, I see 
@nixCraft why is Devuan posting about it? They are not using it so why test this? I am a bit sceptical on the source...
@ivolimmen because the only thing that they have in common is their irrational hate of systemd. (without reading – i'm sure there are already elaborate conspiracy theories flourishing in both threads) @nixCraft
@ivolimmen @nixCraft systemd-tmpfiles is present in almost every distribution as the only maintained implementation of "tmpfiles.d" standard
@ivolimmen @nixCraft to make fun of it since they're one of those protest distros that are very much against systemd.

@ivolimmen

> I am a bit sceptical on the source

David Bremner is Debian contributor and does QA for multiple packages, including graphiz, and LaTeX related packages, as well as @darktable

The name of the command is stupid, it's not about cleaning "temporary" files, and it should have been made differently, to make it clear..

On the other hand, running random commands without understanding it, isn't a good idea either.

@nixCraft

@ivolimmen @nixCraft
No, its legit, it was on Phoronix today and on Fedi a couple of days ago. You can even find the corresponding issue on their GH, one of the devs even refused to document this behaviour, and that users should not run commands without checking what's in the configs first, but reconsidered 😂

@nixCraft A bug in systemd? Interesting.

Is something that is clearly stated in the manual page really a bug? Or do we only consider it a bug because it is in systemd?

@nik @nixCraft totally fair. Breaking things in unexpected ways, collateral damage, total indifference to your users, that's definitely a systemd feature.

@allpoints @nixCraft

I won't tolerate this kind of argumentation in my timeline.

--purge is a new option, it was not there before. It is not a breaking change, and if there is a new option, either read the documentation, or learn from your mistakes.

In any case, don't blame your lack of responsibility on others.

@nik @nixCraft
Sorry, I didn't realize this was a systemd fanboy timeline
@nik @allpoints @nixCraft The bug which was filed (https://github.com/systemd/systemd/issues/33349 ) is a *documentation bug*. And yes, it’s a bug, because the documentation doesn’t provide sufficient warning for how profoundly destructive this option is. Except for that bluca jerk, even the maintainers who have commented agree.
refuse systemd-tmpfiles --purge invocation without config file specified on cmdline · Issue #33349 · systemd/systemd

systemd version the issue has been seen with 256 Used distribution Debian Unstable Linux kernel version used 6.8.12-amd64 CPU architectures issue was seen on x86_64 Component systemd-tmpfiles Expec...

GitHub

@bob_zim @nik @allpoints @nixCraft Should probably say something like "deletes files that *would be* created by a tmpfiles.d/ rule" as well as a warning. Since it'll delete things it had no hand in creating.

Saw someone mention that they should have renamed it from -tmpfiles back in 2019 when the scope expanded to non temporary files.

@nik @allpoints @nixCraft I'd count "wiping all user data in a command labeled \"tmpfiles\" when the documentation DOES NOT SAY IT WILL DO THIS" as a failure, considering you can still make this mistake if you read the documentation, as you requested people do first.

The documentation is also more than slightly obtuse in general, as pointed out in the bug thread. It reads like first-pass btrfs documentation. https://github.com/systemd/systemd/issues/33349#issuecomment-2169581823

refuse systemd-tmpfiles --purge invocation without config file specified on cmdline · Issue #33349 · systemd/systemd

systemd version the issue has been seen with 256 Used distribution Debian Unstable Linux kernel version used 6.8.12-amd64 CPU architectures issue was seen on x86_64 Component systemd-tmpfiles Expec...

GitHub
@nik "I won't tolerate" people complaining about software being designed badly? (If it's not a bug, it was a bad decision) What if you just mute the words systemd, Linux, BSD, FOSS, etc, and then you never have to see people complaining about them? It's not the job of @allpoints or @nixCraft to curate the internet for your fragile ego. People are allowed to talk shit about broken software 😂
@nik @nixCraft it is a bug because home is not really tmpfile.
Maybe call it reinit or installstate.

@gunstick @nixCraft

I'd agree that the fact that /home is created by systemd-tmpfiles.d is a "bug" (rather a design issue), but that was the case for years and is not new.

So yes, something to question, but still not a scandal for systemd v256.

@nixCraft Oh for fucks sake 😂 Very good Potter, very good.
@nixCraft irony: devuan posting this on Elon's data gathering box
@nixCraft That is the most unix thing they have done
@nixCraft users are temporary, systemd is forever
shironeko (@[email protected])

@bremner yeah, Q just means create, it should not get cleaned up with this config alone...

@nixCraft This was the command that the Vastaamo hacker missed when dumping the mental health records.

@nixCraft This is why a tried and true classic Unix init system works. Fewer binaries, typically no need to wait for a binary patch, sys.admins can edit rc files to fix (break) at will.

Do one task and do it well.

@nixCraft Perhaps not a bug as such but potential to footgun yourself. Patch is incoming to make it more clear and make footguning less likely https://github.com/systemd/systemd/pull/33383
tmpfiles: make --purge more restrictive, and various other tweaks by poettering · Pull Request #33383 · systemd/systemd

My fix for #33349, alternative for #33353 that tries to properly address things. This attacks the problem on three fronts: We refuse to run --purge without specification of at least one tmpfiles.d...

GitHub
@joakimfors @nixCraft `Footgun` (v), close cousin to `footmouth`, but more dangerous.
@nixCraft The gift that keeps on giving.
@nixCraft
"42% less Unix philosophy" indeed.
👏 👏 👏 🎉
@nixCraft could be worse, remember upstart? 😉
"Summary: initctl start mounted-tmp erased all my data in /"
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/557177
Bug #557177 “init: support mandatory arguments, or prevent start...” : Bugs : upstart package : Ubuntu

Binary package hint: upstart Summary: initctl start mounted-tmp erased all my data in / I am running a lucid installation in a linux-vserver instance. While fiddling with the really annoing issues regarding upstart and linux-vserver, I executed initctl start mounted-tmp to test if the script was working correctly. The script took quite long, and after it finished, I discovered that it did not only clean /tmp, but all existing files on the whole machine. My guess is that the variable $MOU...

Launchpad

@yrrsinn though that upstart problem was fixed the next day and wasn’t a deceptively documented feature but instead internal behavior that could only be triggered by copying a command-line.

I consider the systemd-tmpfiles footgun to be much worse.

Even docker warns you and asks for confirmation before pruning user-data.
@nixCraft

@nixCraft I suppose it's the other side of the pendulum for the excellence of `systemctl soft-reboot`
@nixCraft
It's working as intended, all user data is temporal.
@nixCraft systemd: Now with 42% less UNIX philosophy and 100% less of your data.
@nixCraft /home is really just a cache for the cloud, right?
@nixCraft i really doubt it is a bug. it is designed for server where home is temporary. this "issue" is around for a week in various memes atleast
@nixCraft is there a link to a bugreport?
refuse systemd-tmpfiles --purge invocation without config file specified on cmdline · Issue #33349 · systemd/systemd

systemd version the issue has been seen with 256 Used distribution Debian Unstable Linux kernel version used 6.8.12-amd64 CPU architectures issue was seen on x86_64 Component systemd-tmpfiles Expec...

GitHub
@nixCraft Why on earth is home directory on a desktop system is a temp dir unless the system is intended to be immutable?
good thing I store all my files in /

@nixCraft This link alone shows what a crapshow SystemD is.

UNIX philosophy which Linux had inherited would do one thing with a binary, and do that well.

Here, command has been morphed beyond its name by the developers and definitely beyond recognition, and it's our fault thinking otherwise.

https://github.com/systemd/systemd/issues/33349#issuecomment-2168796597

refuse systemd-tmpfiles --purge invocation without config file specified on cmdline · Issue #33349 · systemd/systemd

systemd version the issue has been seen with 256 Used distribution Debian Unstable Linux kernel version used 6.8.12-amd64 CPU architectures issue was seen on x86_64 Component systemd-tmpfiles Expec...

GitHub
@nixCraft some programs are more subtle than others about wanting you to clean your home folder.
@nixCraft surely that would be pretty obvious in the source code? How'd this get past 'code review'?

@nixCraft FYI the Devuan project is in mastodon too: https://toot.community/@devuan/112637698286112043

no need to link to the space-karen's site

Devuan (@[email protected])

Attached: 1 image systemd-tmpfiles, deleting /home "systemd-tmpfiles --purge" will delete /home in systemd 256 tested with systemd-tmpfiles --dry-run --purge on #debian

toot.community
@nixCraft thank goodness im only on systemd 254 and i dont have to worry about this