Add truncate: to StandardOutput= etc.
This adds the ability to specify truncate:PATH for StandardOutput= and StandardError=, similar to the existing append:PATH. The code is mostly copied from the related append: code. Fixes #8983.
This commit is contained in:
committed by
Lennart Poettering
parent
e2ebc406ac
commit
8d7dab1fda
@@ -43,6 +43,18 @@ a
|
||||
c
|
||||
EOF
|
||||
|
||||
systemd-run --wait --unit=test27-four \
|
||||
-p StandardOutput=truncate:/tmp/stdout \
|
||||
-p StandardError=truncate:/tmp/stderr \
|
||||
-p Type=exec \
|
||||
sh -c 'echo a ; echo b >&2'
|
||||
cmp /tmp/stdout <<EOF
|
||||
a
|
||||
EOF
|
||||
cmp /tmp/stderr <<EOF
|
||||
b
|
||||
EOF
|
||||
|
||||
systemd-analyze log-level info
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
Reference in New Issue
Block a user