]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl-start: suppress the triggering unit warning when --no-warn
authorMike Yuan <me@yhndnzj.com>
Tue, 26 Sep 2023 15:01:52 +0000 (23:01 +0800)
committerMike Yuan <me@yhndnzj.com>
Wed, 27 Sep 2023 21:24:51 +0000 (05:24 +0800)
man/systemctl.xml
src/systemctl/systemctl-start-unit.c

index 1a424c1e2b959940d9051d69b31efa9ff463a4e0..1b7179e10acbe79361ba470ab9d5289736f0ad20 100644 (file)
@@ -443,6 +443,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
             It will <emphasis>not</emphasis> fail if any of the commands configured to stop the unit
             (<varname>ExecStop=</varname>, etc.) fail, because the manager will still forcibly terminate the
             unit.</para>
+
+            <para>If a unit that gets stopped can still be triggered by other units, a warning containing
+            the names of the triggering units is shown. <option>--no-warn</option> can be used to suppress
+            the warning.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
@@ -2233,7 +2237,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
             </listitem>
             <listitem>
               <para>when using <command>disable</command> combined with <option>--user</option> on units
-              that are enabled in global scope.</para>
+              that are enabled in global scope,</para>
+            </listitem>
+            <listitem>
+              <para>when a <command>stop</command>-ped unit still has active triggering units.</para>
             </listitem>
           </itemizedlist>
           </para>
index bec2249c8249ee54eb74388b9f15226c7b3f1fbe..6927e9774792870c63b7ab16321b8780ccdc692e 100644 (file)
@@ -392,7 +392,7 @@ int verb_start(int argc, char *argv[], void *userdata) {
 
                 /* When stopping units, warn if they can still be triggered by
                  * another active unit (socket, path, timer) */
-                if (!arg_quiet)
+                if (!arg_quiet && !arg_no_warn)
                         STRV_FOREACH(unit, stopped_units)
                                 warn_triggering_units(bus, *unit, "Stopping", /* ignore_masked = */ true);
         }