Systemd 256.1 Fixes "systemd-tmpfiles" Unexpectedly Deleting Your /home Directory
For those running the command "systemd-tmpfiles --purge" and think that this command just deletes your temporary files, think again and watch out. In reality it will delete all files and directories created by a tmpfiles.d entry... Including the /home that is created by systemd-tmpfiles' home.conf. With users being bitten in recent days by this behavior when they were just expecting tmp files to be removed, systemd 256.1 is now available and does have a change to avoid inadvertently deleting your all-important home directory.
Over on Mastodon and a systemd bug report, users were surprised that running "systemd-tmpfiles --purge" will delete all files/folders created by a tmpfiles.d configuration file even with the default behavior of /home being created by one. Thus those trying to do system maintenance without reading the man page could find their /home data deleted.
Initially the bug report was shot down by systemd developer Luca Boccassi of Microsoft with:
Ultimately though after much discussion the past few days, systemd-tmpfiles behavior is now improved upon. Merged yesterday was this patch that now makes systemd-tmpfiles accept a configuration file when running purge. That way the user must knowingly supply the configuration file(s) to which files they would ultimately like removed. The documentation has also been improved upon to make the behavior more clear.
That patch made it into yesterday's systemd 256.1 point release.
Over on Mastodon and a systemd bug report, users were surprised that running "systemd-tmpfiles --purge" will delete all files/folders created by a tmpfiles.d configuration file even with the default behavior of /home being created by one. Thus those trying to do system maintenance without reading the man page could find their /home data deleted.
Initially the bug report was shot down by systemd developer Luca Boccassi of Microsoft with:
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
Ultimately though after much discussion the past few days, systemd-tmpfiles behavior is now improved upon. Merged yesterday was this patch that now makes systemd-tmpfiles accept a configuration file when running purge. That way the user must knowingly supply the configuration file(s) to which files they would ultimately like removed. The documentation has also been improved upon to make the behavior more clear.
That patch made it into yesterday's systemd 256.1 point release.
141 Comments