summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-01-19 08:47:39 +0900
committerGitHub <noreply@github.com>2021-01-19 08:47:39 +0900
commit4c6dd238b81b7d5825a45b443cbe625ce365f086 (patch)
treed237c682fd36af5225987872e88fa05f0205159f /man
parentceed42830548a08d426af892d6ce55dc90070d41 (diff)
parente37258406766efe53b161ee1d077872fda82ae1b (diff)
downloadsystemd-4c6dd238b81b7d5825a45b443cbe625ce365f086.tar.gz
Merge pull request #18267 from lucaswerkmeister/truncate
Two StandardOutput=truncate:file improvements
Diffstat (limited to 'man')
-rw-r--r--man/systemd.exec.xml15
1 files changed, 13 insertions, 2 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index 9adb6a298e..663b15fa60 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -2430,8 +2430,19 @@ SystemCallErrorNumber=EPERM</programlisting>
</para>
<para><option>truncate:<replaceable>path</replaceable></option> is similar to
- <option>file:<replaceable>path</replaceable></option> above, but it truncates the file when opening it.
- </para>
+ <option>file:<replaceable>path</replaceable></option> above, but it truncates the file when opening
+ it. For units with multiple command lines, e.g. <varname>Type=oneshot</varname> services with
+ multiple <varname>ExecStart=</varname>, or services with <varname>ExecCondition=</varname>,
+ <varname>ExecStartPre=</varname> or <varname>ExecStartPost=</varname>, the output file is reopened
+ and therefore re-truncated for each command line. If the output file is truncated while another
+ process still has the file open, e.g. by an <varname>ExecReload=</varname> running concurrently with
+ an <varname>ExecStart=</varname>, and the other process continues writing to the file without
+ adjusting its offset, then the space between the file pointers of the two processes may be filled
+ with <constant>NUL</constant> bytes, producing a sparse file. Thus,
+ <option>truncate:<replaceable>path</replaceable></option> is typically only useful for units where
+ only one process runs at a time, such as services with a single <varname>ExecStart=</varname> and no
+ <varname>ExecStartPost=</varname>, <varname>ExecReload=</varname>, <varname>ExecStop=</varname> or
+ similar.</para>
<para><option>socket</option> connects standard output to a socket acquired via socket activation. The
semantics are similar to the same option of <varname>StandardInput=</varname>, see above.</para>