On 4/3/21 5:41 PM, Till Dörges wrote:
Am 03.04.21 um 18:02 schrieb Peter McD:
So I move from /usr/lib/tmpfiles.d/fs-var-tmp.conf to /etc/tmpfiles.s/
and modify # d /var/tmp 1777 root root - to d /var/tmp 1777 root root 1d
I expect after a reboot older folders/files. e.g. drwx------ 3 root root 4096 3. Apr 17:40 systemd-private-6704694542b3421f8612991315fd7962-chronyd.service-RNsuvq
But several reboots later there are only the folders/files with the same /date/time of the latest boot time.
e.g. drwx------ 3 root root 4096 3. Apr 17:56 systemd-private-6d19ab9a0f284936a9177444417f38b8-chronyd.service-33ZqOB
What is wrong?
I didn't find anything in the documentation but according to https://unix.stackexchange.com/questions/219814/why-is-systemd-tmpfiles-clea... systemd also seems to take the access (atime) and inode change timestamp (ctime) into account - and not only the modification timestamp (mtime).
That means, if you look at a file (to check whether it's still there) you might also change the atime or ctime of the directory.
To understand what's going on, try this:
SYSTEMD_LOG_LEVEL=debug /usr/bin/systemd-tmpfiles --clean
One thing you could try is (from 'man tmpfiles.d'):
--- snip --- When the age is set to zero, the files are cleaned unconditionally. --- snap ---
HTH -- Till
We were typing at the same time. :) If age is set to zero, then IME it becomes critical that the cleaning only runs at boot. If it runs during a session it will among others things delete the files that X and sddm depend on, killing them both. I would only use 0 with the exclamation point (d! or e!), as in the example on the man page. --dg