mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: let %T and %V follow $TMPDIR
The %T and %V specifiers are always /tmp and /var/tmp. In systemd both are the first of $TMPDIR, $TEMP, and $TMP that is set to an absolute path of a directory, and only otherwise /tmp and /var/tmp. Do the same. At boot none of them are set, so nothing changes there. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+29
-4
No files matched your search
@@ -50,3 +50,13 @@ assert "Skipped: a lone % and an unknown specifier" "$(texec sh -c "ls $DIR | gr
|
||||
assert "OS ID and version" "$(texec ls $DIR/os-finit-test-1.2)" = "$DIR/os-finit-test-1.2"
|
||||
assert "Architecture" "$(texec sh -c "ls $DIR | grep -c '^arch-.'")" = "1"
|
||||
assert "Empty when not in os-release" "$(texec ls $DIR/variant-)" = "$DIR/variant-"
|
||||
|
||||
sep
|
||||
say "%T and %V follow \$TMPDIR when it is a directory"
|
||||
run "cat > $CONF" <<CONF
|
||||
f $DIR/tmpdir - - - - %T %V
|
||||
CONF
|
||||
run "TMPDIR=$DIR /libexec/finit/tmpfiles --create $CONF"
|
||||
assert "From the environment" "$(texec cat $DIR/tmpdir)" = "$DIR $DIR"
|
||||
run "rm $DIR/tmpdir; TMPDIR=/no/such/dir /libexec/finit/tmpfiles --create $CONF"
|
||||
assert "Not a directory" "$(texec cat $DIR/tmpdir)" = "/tmp /var/tmp"
|
||||
Reference in new issue
Block a user