Skip to content

Commit

Permalink
systemctl-start: suppress the triggering unit warning when --no-warn
Browse files Browse the repository at this point in the history
(cherry picked from commit 0b675f9)
  • Loading branch information
YHNdnzj authored and bluca committed Nov 8, 2023
1 parent 44a70f8 commit a847fb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion man/systemctl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,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>
Expand Down Expand Up @@ -2107,7 +2111,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>
Expand Down
2 changes: 1 addition & 1 deletion src/systemctl/systemctl-start-unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,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);
}
Expand Down

0 comments on commit a847fb1

Please sign in to comment.