mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: read a file named - from standard input
A package script that has its entries at hand, and not yet in a file,
gives them to systemd-tmpfiles on standard input:
echo 'd /var/lib/app 0750 app app' | tmpfiles --create -
Finit's tmpfiles took - as the name of a file and failed to open it.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+19
-10
No files matched your search
@@ -45,3 +45,8 @@ say 'Files are read by name, and the first entry for a path counts'
|
||||
assert "First by file name" "$(texec cat $DIR/first)" = "one+three+four"
|
||||
assert "Told about in a dry run" \
|
||||
"$(texec sh -c "/libexec/finit/tmpfiles -n --create --prefix=$DIR 2>&1 | grep -c 'already has an entry'")" = "1"
|
||||
|
||||
sep
|
||||
say 'A file named - is read from standard input'
|
||||
run "echo 'f $DIR/stdin' | /libexec/finit/tmpfiles --create -"
|
||||
assert "Entry on stdin" "$(texec sh -c "ls $DIR | grep -c stdin")" = "1"
|
||||
Reference in new issue
Block a user