diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2019-06-28 17:02:30 -0700 |
---|---|---|
committer | The Plumber <50238977+systemd-rhel-bot@users.noreply.github.com> | 2020-05-26 11:12:28 +0200 |
commit | ab9c835796a27f0fbaee75a90f0311ec456941d8 (patch) | |
tree | 3aa745383e9a944ebd19bd3e34b2f0d558b2d698 /man | |
parent | ad8f0b480799aa7e312dacbcb0c01a3a9e6aa6db (diff) | |
download | systemd-ab9c835796a27f0fbaee75a90f0311ec456941d8.tar.gz |
core: ExecCondition= for services
Closes #10596
(cherry picked from commit 31cd5f63ce86a0784c4ef869c4d323a11ff14adc)
Resolves: #1737283
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd.service.xml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 315b80e704..54586d1948 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -415,6 +415,26 @@ </varlistentry> <varlistentry> + <term><varname>ExecCondition=</varname></term> + <listitem><para>Optional commands that are executed before the command(s) in <varname>ExecStartPre=</varname>. + Syntax is the same as for <varname>ExecStart=</varname>, except that multiple command lines are allowed and the + commands are executed one after the other, serially.</para> + + <para>The behavior is like an <varname>ExecStartPre=</varname> and condition check hybrid: when an + <varname>ExecCondition=</varname> command exits with exit code 1 through 254 (inclusive), the remaining + commands are skipped and the unit is <emphasis>not</emphasis> marked as failed. However, if an + <varname>ExecCondition=</varname> command exits with 255 or abnormally (e.g. timeout, killed by a + signal, etc.), the unit will be considered failed (and remaining commands will be skipped). Exit code of 0 or + those matching <varname>SuccessExitStatus=</varname> will continue execution to the next command(s).</para> + + <para>The same recommendations about not running long-running processes in <varname>ExecStartPre=</varname> + also applies to <varname>ExecCondition=</varname>. <varname>ExecCondition=</varname> will also run the commands + in <varname>ExecStopPost=</varname>, as part of stopping the service, in the case of any non-zero or abnormal + exits, like the ones described above.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><varname>ExecReload=</varname></term> <listitem><para>Commands to execute to trigger a configuration reload in the service. This argument takes multiple command |