b677e7
From 102f4ff97a24c2ddaf6e569c678a0a713f972863 Mon Sep 17 00:00:00 2001
b677e7
From: David Tardon <dtardon@redhat.com>
b677e7
Date: Fri, 19 Mar 2021 10:05:47 +0100
b677e7
Subject: [PATCH] man: document differences in clean exit status for
b677e7
 Type=oneshot
b677e7
b677e7
See commit 1f0958f640b87175cd547c1e69084cfe54a22e9d .
b677e7
b677e7
(cherry picked from commit f055cf77862bc580f3afbfaac161d1c060f39411)
b677e7
b677e7
Resolves: #1940078
b677e7
---
b677e7
 man/systemd.service.xml | 24 +++++++++++++++---------
b677e7
 1 file changed, 15 insertions(+), 9 deletions(-)
b677e7
b677e7
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
b677e7
index 54586d1948..1e30a564df 100644
b677e7
--- a/man/systemd.service.xml
b677e7
+++ b/man/systemd.service.xml
b677e7
@@ -669,14 +669,19 @@
b677e7
         If set to <option>no</option> (the default), the service will
b677e7
         not be restarted. If set to <option>on-success</option>, it
b677e7
         will be restarted only when the service process exits cleanly.
b677e7
-        In this context, a clean exit means an exit code of 0, or one
b677e7
-        of the signals
b677e7
-        <constant>SIGHUP</constant>,
b677e7
-        <constant>SIGINT</constant>,
b677e7
-        <constant>SIGTERM</constant> or
b677e7
-        <constant>SIGPIPE</constant>, and
b677e7
-        additionally, exit statuses and signals specified in
b677e7
-        <varname>SuccessExitStatus=</varname>. If set to
b677e7
+        In this context, a clean exit means any of the following:
b677e7
+        <itemizedlist>
b677e7
+            <listitem><simpara>exit code of 0;</simpara></listitem>
b677e7
+            <listitem><simpara>for types other than
b677e7
+            <varname>Type=oneshot</varname>, one of the signals
b677e7
+                <constant>SIGHUP</constant>,
b677e7
+                <constant>SIGINT</constant>,
b677e7
+                <constant>SIGTERM</constant>, or
b677e7
+                <constant>SIGPIPE</constant>;</simpara></listitem>
b677e7
+            <listitem><simpara>exit statuses and signals specified in
b677e7
+                <varname>SuccessExitStatus=</varname>.</simpara></listitem>
b677e7
+        </itemizedlist>
b677e7
+        If set to
b677e7
         <option>on-failure</option>, the service will be restarted
b677e7
         when the process exits with a non-zero exit code, is
b677e7
         terminated by a signal (including on core dump, but excluding
b677e7
@@ -798,7 +803,8 @@
b677e7
         <listitem><para>Takes a list of exit status definitions that,
b677e7
         when returned by the main service process, will be considered
b677e7
         successful termination, in addition to the normal successful
b677e7
-        exit code 0 and the signals <constant>SIGHUP</constant>,
b677e7
+        exit code 0 and, except for <varname>Type=oneshot</varname>,
b677e7
+        the signals <constant>SIGHUP</constant>,
b677e7
         <constant>SIGINT</constant>, <constant>SIGTERM</constant>, and
b677e7
         <constant>SIGPIPE</constant>. Exit status definitions can
b677e7
         either be numeric exit codes or termination signal names,