From 0b675f97d6a909a706bdc783caf4945d81f482c2 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Tue, 26 Sep 2023 23:01:52 +0800 Subject: [PATCH] systemctl-start: suppress the triggering unit warning when --no-warn --- man/systemctl.xml | 9 ++++++++- src/systemctl/systemctl-start-unit.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index 1a424c1e2b..1b7179e10a 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -443,6 +443,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err It will not fail if any of the commands configured to stop the unit (ExecStop=, etc.) fail, because the manager will still forcibly terminate the unit. + + If a unit that gets stopped can still be triggered by other units, a warning containing + the names of the triggering units is shown. can be used to suppress + the warning. @@ -2233,7 +2237,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err when using disable combined with on units - that are enabled in global scope. + that are enabled in global scope, + + + when a stop-ped unit still has active triggering units. diff --git a/src/systemctl/systemctl-start-unit.c b/src/systemctl/systemctl-start-unit.c index bec2249c82..6927e97747 100644 --- a/src/systemctl/systemctl-start-unit.c +++ b/src/systemctl/systemctl-start-unit.c @@ -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); } -- 2.25.1