tmpfiles: add the h and H entries, file attributes

tmpfiles.d(5) has h to set file attributes, as chattr(1) does, and H
for the path and everything below it:

    h /var/log/journal - - - - +C

tmpfiles skipped them as unsupported.

Add both.  The argument is the letters chattr(1) has, after a + to
add them, which is the default, a - to remove them, or a = to have
just these set.  Only files and directories have such attributes,
anything else is left alone.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 19:10:02 +01:00
1 parent 1ef0da9c50
commit 3ff5c33217
8 files changed
+131 -7

No files matched your search

+2
View File
@@ -24,6 +24,8 @@ All relevant changes are documented in this file.
e.g. in a `w` entry for `core_pattern`, must now be written `%%`
- tmpfiles: add the `t` and `T` entries, to set extended attributes on
a path, `T` also on everything below it
- tmpfiles: add the `h` and `H` entries, to set file attributes as with
chattr(1), `H` also on everything below the path
- tmpfiles: add the `L?` entry, a link that is only made when what it
points to exists, the same as Finit's own `l` entry
- tmpfiles: add `--prefix=PATH`, to only run the entries for paths below
+1 -1
View File
@@ -28,7 +28,7 @@ Features
* [Conditions](conditions.md) for network/process/custom dependencies
* [Readiness notification](config/service-sync.md); PID files (native) for synchronizing system
startup, support for systemd [sd_notify()][], or [s6 style][] too
* Limited support for [tmpfiles.d(5)][] (no attributes or subvolumes)
* Limited support for [tmpfiles.d(5)][] (no subvolumes)
* [Pre/Post script actions](config/service-wrappers.md)
* Rudimentary [templating support](config/templating.md)
* [Tooling](initctl.md) to enable/disable services
+1 -1
View File
@@ -23,7 +23,7 @@ For your convenience a set of *optional* plugins are available:
file systems must be writable for this plugin to work.
This plugin is a wrapper for the [tmpfiles.d(5)][] implementation that
Finit has. Capable but limited: no attributes or subvolumes. It
Finit has. Capable but limited: no btrfs subvolumes. It
runs `tmpfiles --create --remove --boot`, so entries marked boot-only
with a `!` are run here and at no other time.
-1
View File
@@ -13,7 +13,6 @@ files or common packages already rely on, last what few will miss.
* `C+`, which is read as `C`
* `z` and `Z` only set the SELinux label when `restorecon` is installed
* `h`, `H` for file attributes
* Modifiers `-` (do not fail), `=` (remove what is of another type),
`~` (base64 argument), and `^` (credential as argument)
* Quoted paths, a path with a space in it cannot be written