tmpfiles: remove before creating when asked to do both

With both --create and --remove each entry was removed and then
created before the next one was read.  An r entry took what an entry
above it had just created:

    f /tmp/file - - - - new
    r /tmp/file

    tmpfiles --create --remove t.conf

This left no /tmp/file.  The same goes for --clean.

Run all the files twice in that case, first to remove and clean, then
to create.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:02:34 +01:00
1 parent 3a283d40b5
commit 9195d145d1
4 files changed
+95 -51

No files matched your search

+3
View File
@@ -249,6 +249,9 @@ All relevant changes are documented in this file.
- Fix the argument of a tmpfiles entry written in aligned columns, the space
after the age field ended up in the argument, e.g. in the target of an `L`
link. A lone `-` is now read as no argument
- Fix `tmpfiles --create --remove`, each entry was removed and created in
turn, so an `r` entry removed what an entry above it had just created.
All of the removing is now done first
- Fix a lost reload for a service paused mid-reload by a condition in
flux. A second reload arriving meanwhile re-parsed the unchanged .conf
and cleared the pending mark, so the service resumed without ever being