tmpfiles: clean what an x entry keeps by the age of the entry

An x or X entry can have an age of its own in tmpfiles.d(5).  What it
keeps from the cleaning of the directory above is then cleaned by that
age instead:

    d /tmp       1777 root root 10d
    x /tmp/build -    -    -    30d

tmpfiles does not read the age, so /tmp/build is never cleaned.

Clean the paths of such an entry by its age, with the entry itself
left out of what is kept.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 17:14:03 +01:00
1 parent 9ea64e5c3c
commit 9160ca3ddf
4 files changed
+33 -8

No files matched your search

+3
View File
@@ -40,6 +40,9 @@ All relevant changes are documented in this file.
nothing, an unknown user or group is never an error in Finit
- tmpfiles: the `%T` and `%V` specifiers now follow `$TMPDIR`, `$TEMP`,
or `$TMP`, when set to a directory
- tmpfiles: an `x` or `X` entry with an age now has what it keeps cleaned
by that age, as in `x /tmp/build 30d` below a `/tmp` cleaned after ten
days. Before the age was not read
- tmpfiles: add `--prefix=PATH`, to only run the entries for paths below
it. `--prefix` and `--exclude-prefix` match whole path components,
`--exclude-prefix=/dev` no longer skips `/devices`