mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: read the files by name, the first entry for a path counts
The files were read one directory at a time, Finit's own first and /etc/tmpfiles.d last, and every entry for a path was run. With two entries for a path the last one read won, so an entry in /etc won over one in /usr/lib whatever the files were called. tmpfiles.d(5) reads the files in the order of their names, whatever directory they are in, and goes by the first entry that makes a path. A package relies on that when it names its file to sort before or after another. Do the same. As before, a file in a later directory is read in place of one of the same name in an earlier one. A later entry is skipped when it makes a path an earlier one makes, or when both take a glob and remove, write to, or keep the path. Several w+ entries may add to one file. The skip is only told about with --dry-run or --debug, since Finit's files and those of other packages overlap on most systems. Finit's own files had two entries for some paths, and relied on the last one. Drop the ones that lost: /run/lock, /run/lock/subsys, and /var/lock in legacy.conf, and /var/run and a second /var/spool in var.conf. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
9 files changed
+152
-50
No files matched your search
@@ -71,9 +71,10 @@ run "printf abcdef > $DIR/w1"
|
||||
run "cat > $CONF" <<'CONF'
|
||||
w /tmp/arg/w1 - - - - XY
|
||||
w+ /tmp/arg/w1 - - - - Z
|
||||
w+ /tmp/arg/w1 - - - - Z
|
||||
CONF
|
||||
run "/libexec/finit/tmpfiles --create $CONF"
|
||||
assert "Written in place" "$(texec cat $DIR/w1)" = "XYcdefZ"
|
||||
assert "Written in place, added to by each w+" "$(texec cat $DIR/w1)" = "XYcdefZZ"
|
||||
|
||||
sep
|
||||
say 'Escapes, and a # that is not at the start of the line'
|
||||
|
||||
Reference in new issue
Block a user