tmpfiles: add --prefix, to only run entries below a path

A package that ships a tmpfiles.d file wants its own paths created
when it is installed, without running every other entry on the
system:

    tmpfiles --create --prefix=/var/lib/app

Add the option, it can be given more than once.  It and
--exclude-prefix compare whole path components now, before
--exclude-prefix=/dev also left out /devices.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:35:36 +01:00
1 parent fb3b13a245
commit 0a2beb9b6d
4 files changed
+54 -6

No files matched your search

+3
View File
@@ -22,6 +22,9 @@ All relevant changes are documented in this file.
`%w`, `%W`, `%B`, `%M`, and `%A`. Before, an entry with a `%`
in the path was skipped. **Note:** a literal `%` in such an argument,
e.g. in a `w` entry for `core_pattern`, must now be written `%%`
- 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`
- tmpfiles: the age of an entry can now have several units, as in
`1d12h`, also `ms`, `us`, and `min`. New are the `~` prefix, to keep
what is right in the directory, and a choice of the timestamps to go
+2 -4
View File
@@ -22,10 +22,8 @@ files or common packages already rely on, last what few will miss.
2. Command line
---------------
Missing options: `--prefix`, `--root`, `--replace`, `--dry-run`,
`--purge`, `--graceful`, and `--cat-config`. Of these `--prefix`
is the useful one, for packages that run `tmpfiles --create` on only
their own paths.
Missing options: `--root`, `--replace`, `--dry-run`, `--purge`,
`--graceful`, and `--cat-config`.
3. Smaller things