tmpfiles: add the = modifier, remove a path of another kind

When there is a file where an entry wants a directory, or the other
way around, the entry fails or leaves the path as it is.  In
tmpfiles.d(5) an = after the type has the path removed first when it
is of another kind than the entry makes:

    d= /var/lib/foo 0755 foo foo

The same goes for the directories above the path, anything else in
place of one is removed.  tmpfiles ignores the =.

Remove what does not match before the b, c, d, D, f, F, L, and p
entries, the ones that make a path of one kind.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 17:14:12 +01:00
1 parent 37cbc12946
commit f2c0888375
5 files changed
+125 -4

No files matched your search

+3
View File
@@ -45,6 +45,9 @@ All relevant changes are documented in this file.
days. Before the age was not read
- tmpfiles: add the `C+` entry, which also copies to a directory that has
something in it. What is missing is added, nothing is overwritten
- tmpfiles: add the `=` modifier, as in `d=`, to first remove what is in
place of the path when it is of another kind than the entry makes, also
what is in place of a directory above it
- 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`