chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
222d034
)
systemctl: warn about all active triggers, not just sockets
author
Michal Schmidt
<mschmidt@redhat.com>
Wed, 13 Jun 2012 16:27:41 +0000
(18:27 +0200)
committer
Michal Schmidt
<mschmidt@redhat.com>
Wed, 13 Jun 2012 16:42:02 +0000
(18:42 +0200)
src/systemctl/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index 0e6b2ec30c33aefb4b87b4e530ff3f72e8ae66fc..223e862a5390b5e93a4c2f166ee2740720960e40 100644
(file)
--- a/
src/systemctl/systemctl.c
+++ b/
src/systemctl/systemctl.c
@@
-1685,7
+1685,7
@@
finish:
return r;
}
return r;
}
-static void check_
listening_socke
ts(
+static void check_
triggering_uni
ts(
DBusConnection *bus,
const char *unit_name) {
DBusConnection *bus,
const char *unit_name) {
@@
-1748,20
+1748,17
@@
static void check_listening_sockets(
dbus_message_iter_get_basic(&sub, &service_trigger);
dbus_message_iter_get_basic(&sub, &service_trigger);
- if (!endswith(service_trigger, ".socket"))
- goto next;
-
r = check_one_unit(bus, service_trigger, true);
if (r < 0)
goto finish;
if (r == 0) {
if (print_warning_label) {
r = check_one_unit(bus, service_trigger, true);
if (r < 0)
goto finish;
if (r == 0) {
if (print_warning_label) {
- log_warning("
There are listening sockets associated with %s
:", unit_name);
+ log_warning("
Warning: Stopping %s, but it can still be activated by
:", unit_name);
print_warning_label = false;
}
print_warning_label = false;
}
- log_warning("%s", service_trigger);
+ log_warning("
%s", service_trigger);
}
}
-next:
+
dbus_message_iter_next(&sub);
}
finish:
dbus_message_iter_next(&sub);
}
finish:
@@
-1856,9
+1853,10
@@
static int start_unit_one(
}
}
}
}
- /* When stopping unit check if we have some listening sockets active */
- if (streq(method, "StopUnit") && !arg_quiet)
- check_listening_sockets(bus, name);
+ /* 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);
r = 0;
r = 0;