diff --git a/doc/TODO.md b/doc/TODO.md index c97281d1..d68b3649 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -34,6 +34,13 @@ Some of these are also registered in the issue tracker on GitHub. that functionality is not yet released. +tmpfiles +-------- + +What is missing compared to tmpfiles.d(5) is listed, ranked, in +[tmpfiles-todo.md](tmpfiles-todo.md). + + Initctl ------- diff --git a/doc/tmpfiles-todo.md b/doc/tmpfiles-todo.md new file mode 100644 index 00000000..d9b2c323 --- /dev/null +++ b/doc/tmpfiles-todo.md @@ -0,0 +1,121 @@ +tmpfiles TODO +============= + +What `tmpfiles` lacks compared to [tmpfiles.d(5)][], from a read of +`src/tmpfiles.c` in November 2026. Ranked: first what Finit's own +files or common packages already rely on, last what few will miss. + +[tmpfiles.d(5)]: https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html + + +1. Boot-only entries +-------------------- + +The `!` modifier marks an entry that is only safe at boot. Finit's own +files use it, `D!` and `r!` in `x11.conf`, `r!` in `legacy.conf`, and +`C!` in `etc.conf`, but the modifier is ignored and there is no `--boot` +option. The entries run on every call, so `tmpfiles --remove` on a +running system empties `/tmp/.X11-unix` and removes the X lock files. + +* Parse the modifiers after the type letter, in any order +* Add `--boot`, skip `!` entries without it +* Call `tmpfiles --create --remove --boot` from `plugins/bootmisc.c` + + +2. Nothing runs the clean pass +------------------------------ + +Finit calls `tmpfiles --create` at boot and nothing else. The age +field has no effect until the user adds a task for `tmpfiles --clean`. + +* Ship a task for it, systemd runs its timer 15 min after boot and + then daily +* `x` and `X` are accepted but exclude nothing from cleaning +* Age `0` should clean everything, it is read as no age +* Cleaning crosses mount points, it should stay on one file system +* Only one number with `s`, `m`, `h`, `d`, or `w` is read. Missing + are `1d12h`, `ms`, `us`, the `~` prefix, and the `a`, `b`, `c`, `m` + selectors for which timestamps to compare +* The age is only used for `d`, `D`, and `e` + + +3. Prefixes that are silently dropped +------------------------------------- + +* Mode `~0755`, mask with the mode the path has, and `:0755`, only + when creating: neither is parsed, the entry is read as having no + mode +* User and group `:name`, only when creating: looked up as the name + `:name`, which fails. For `d` the directory is then not created +* An unknown group becomes root, an unknown user makes `d` skip the + entry while `e` and `f` go on. Warn and leave the owner alone in + all of them + + +4. Mode and owner not applied +----------------------------- + +* `f` on a file that exists: the entry is skipped, tmpfiles.d(5) + still adjusts mode and owner +* `p`, `b`, `c`: owner +* `C`: mode and owner +* `z`, `Z`: mode and owner, and they do nothing without `restorecon` + + +5. Device nodes with major or minor 0 +------------------------------------- + +`parse_mm()` rejects a 0 in either number, so an entry like this one +is skipped: + + c /dev/tty 0666 root tty - 5:0 + + +6. Subvolumes +------------- + +`v`, `q`, and `Q` are skipped as unsupported. systemd makes a plain +directory when the file system is not btrfs, doing the same gets +distribution files with these entries to work. + + +7. Specifiers +------------- + +A path with `%` in it is skipped, also the escaped `%%`. The ones that +show up in files from distributions are `%b` (boot ID), `%m` (machine +ID), `%H` (hostname), `%v` (kernel release), and for the argument `%T` +and `%V`. This is the largest gap for using such files unchanged, and +the most work. + + +8. Remaining types and modifiers +-------------------------------- + +* `L?`, and `C+`, which is read as `C` +* `t`, `T` for extended attributes and `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 + + +9. 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. + + +10. Smaller things +------------------ + +* Files are processed one directory at a time. tmpfiles.d(5) sorts + all of them by name, whatever directory they are in, so `00-x.conf` + in `/etc` should run before `50-y.conf` in `/usr/lib` +* `doc/README.md`, `doc/index.md`, and `doc/plugins.md` say there is + no aging. There is, see 2 above +* `a` and `A` handle an ACL of at most 32 entries, a path with more is + left as it is, with a warning +* `mksubsys()` in `src/util.c` is unused diff --git a/mkdocs.yml b/mkdocs.yml index 4a96f5f9..139ce7a3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,6 +11,7 @@ extra_css: exclude_docs: | TODO.md + tmpfiles-todo.md ChangeLog.md README.md