mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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
13
test/test-execute/exec-standardoutput-truncate.service
Normal file
13
test/test-execute/exec-standardoutput-truncate.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Test for StandardOutput=truncate:
|
||||
|
||||
[Service]
|
||||
ExecStartPre=sh -c 'printf "hello\n" > /tmp/test-exec-standardoutput-output'
|
||||
ExecStartPre=sh -c 'printf "hi\n" > /tmp/test-exec-standardoutput-expected'
|
||||
StandardInput=data
|
||||
StandardInputText=hi
|
||||
StandardOutput=truncate:/tmp/test-exec-standardoutput-output
|
||||
StandardError=null
|
||||
ExecStart=cat
|
||||
ExecStartPost=cmp /tmp/test-exec-standardoutput-output /tmp/test-exec-standardoutput-expected
|
||||
Type=oneshot
|
||||
Reference in New Issue
Block a user