]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Make RestartPreventExitStatus= documentation resemble SuccessExitStatus=
authorAndrew Sayers <andrew-github.com@pileofstuff.org>
Tue, 9 Jan 2024 12:41:29 +0000 (12:41 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 24 Jan 2024 17:00:53 +0000 (18:00 +0100)
The documentation for `RestartPreventExitStatus=` differs from that for `SuccessExitStatus=` in ways that are sometimes confusing (e.g. using `numeric exit codes` instead of `numeric termination statuses`), and other times plain incorrect (e.g. not mentioning `termination status names`, which I've just confirmed to work in systemd 255).

This patch modifies the documentation to be as similar as possible, so as to reduce the reader's cognitive load.

man/systemd.service.xml

index 47fbe53fcd10991ded087236c0bb19705254646d..74c22260bc56155503f51d283147ebfb01e33e62 100644 (file)
 
         <listitem><para>Takes a list of exit status definitions that, when returned by the main service
         process, will prevent automatic service restarts, regardless of the restart setting configured with
-        <varname>Restart=</varname>. Exit status definitions can either be numeric exit codes or termination
-        signal names, and are separated by spaces. Defaults to the empty list, so that, by default, no exit
-        status is excluded from the configured restart logic. For example:
+        <varname>Restart=</varname>. Exit status definitions can be numeric termination statuses, termination
+        status names, or termination signal names, separated by spaces. Defaults to the empty list, so that,
+        by default, no exit status is excluded from the configured restart logic.
 
-        <programlisting>RestartPreventExitStatus=1 6 SIGABRT</programlisting>
+        <example>
+          <title>A service with the <varname>RestartPreventExitStatus=</varname> setting</title>
+
+          <programlisting>RestartPreventExitStatus=TEMPFAIL 250 SIGKILL</programlisting>
+
+          <para>Exit status 75 (<constant>TEMPFAIL</constant>), 250, and the termination signal
+          <constant>SIGKILL</constant> will not result in automatic service restarting.</para>
+        </example>
 
-        ensures that exit codes 1 and 6 and the termination signal <constant>SIGABRT</constant> will not
-        result in automatic service restarting. This option may appear more than once, in which case the list
-        of restart-preventing statuses is merged. If the empty string is assigned to this option, the list is
-        reset and all prior assignments of this option will have no effect.</para>
+        This option may appear more than once, in which case the list of restart-preventing statuses is merged.
+        If the empty string is assigned to this option, the list is reset and all prior assignments of this
+        option will have no effect.</para>
 
         <para>Note that this setting has no effect on processes configured via
         <varname>ExecStartPre=</varname>, <varname>ExecStartPost=</varname>, <varname>ExecStop=</varname>,