tmpfiles: add the L? entry

tmpfiles.d(5) has L? for a link that is only made when what it points
to exists:

    L? /etc/localtime - - - - ../usr/share/zoneinfo/UTC

The ? was not read, so this made the link whatever was there.

Finit has had this as its own l entry.  Read L? as l.

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

No files matched your search

+10
View File
@@ -31,6 +31,16 @@ assert "File content" "$(texec cat $DIR/text)" = "two words"
say 'A lone - is no argument'
assert "Empty file" "$(texec stat -c %s $DIR/dash)" = "0"
sep
say 'L? only makes the link when what it points to is there'
run "cat > $CONF" <<CONF
L? $DIR/there - - - - /etc/passwd
L? $DIR/missing - - - - /no/such/file
CONF
run "/libexec/finit/tmpfiles --create $CONF"
assert "Link to a path that is there" "$(texec readlink $DIR/there)" = "/etc/passwd"
assert "No link to a missing path" "$(texec sh -c "ls $DIR | grep -c missing")" = "0"
sep
say 'With --prefix only the entries below it are run'
run "cat > $CONF" <<CONF