summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-09-18 22:03:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-09-19 08:27:34 +0200
commit49111a708eb3bc8488c56c4695fa36c826bf3657 (patch)
treeeb8b901d26fab274ffb5117e3740ec5abed14ab5 /src/systemctl/systemctl.c
parentd39b034af6f9795c4f17a8ddd186f026bb74193c (diff)
systemctl: warn about triggering units only at the end
Instead of checking each unit separately, check once at the end. This should avoid spurious warnings about a service being triggerable by other stuff.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 729d4dd324..cc9c775251 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1584,11 +1584,6 @@ static int start_unit_one(
p = NULL;
}
- /* When stopping a unit warn if it can still be triggered by
- * another active unit (socket, path, timer) */
- if (!arg_quiet && streq(method, "StopUnit"))
- check_triggering_units(bus, name);
-
return 0;
}
@@ -1723,6 +1718,16 @@ static int start_unit(DBusConnection *bus, char **args) {
ret = r;
goto finish;
}
+
+ /* When stopping units, warn if they can still be triggered by
+ * another active unit (socket, path, timer) */
+ if (!arg_quiet && streq(method, "StopUnit")) {
+ if (one_name)
+ check_triggering_units(bus, one_name);
+ else
+ STRV_FOREACH(name, args+1)
+ check_triggering_units(bus, *name);
+ }
}
finish: