tmpfiles: create a path after those above it, glob entries last

An entry was run as its line was read, so the outcome followed the
order of the lines and of the files.  With

    f /var/run/app/file
    L /var/run - - - - ../run

the f entry made /var/run a directory, and the link was never made.
An entry like z or w, placed before the one that makes its path, found
nothing to change.

tmpfiles.d(5) has a path created after the paths above it and removed
after those below it, and runs the entries that take a glob after the
others.  Do the same.  Every entry is now read before the first one is
run, which also means a line is parsed once, not once per pass, and
the pass that only gathered the x and X entries is gone.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 19:23:48 +01:00
1 parent 4bec72fcf2
commit 86bb79d7a1
3 files changed
+206 -118

No files matched your search

+4
View File
@@ -48,6 +48,10 @@ All relevant changes are documented in this file.
- 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: every entry is now read before the first one is run. As in
tmpfiles.d(5), a path is created after the paths above it, and removed
after those below it, wherever in the files the entries are. Entries
that take a glob, like `w` and `z`, are run after the others
- 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`