summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-25 17:14:00 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-26 19:45:10 -0500
commit7bbf2d84234db8f9dd39604a367dc56a8f5455c7 (patch)
tree2e93da0be28e379cf4b637bc1c83be88aeebefcf /src
parent0cd4e913daa5c7914a1c24bd4bccc5d5344181f0 (diff)
coredumpctl: add debug information which services count towards the warning
A few times I have seen the hint unexpectedly. Add this so debug info so it's easier to see what's happening. ... Unit systemd-coredump@0-3119-0.service is failed/failed, not counting it. Unit systemd-coredump@1-3854-0.service is activating/start-pre, counting it. ... -- Notice: 1 systemd-coredump@.service unit is running, output may be incomplete.
Diffstat (limited to 'src')
-rw-r--r--src/coredump/coredumpctl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
index 4ac98d8163..810d4f95a4 100644
--- a/src/coredump/coredumpctl.c
+++ b/src/coredump/coredumpctl.c
@@ -936,7 +936,7 @@ static int check_units_active(void) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
int c = 0, r;
- const char *state;
+ const char *id, *state, *substate;
r = sd_bus_default_system(&bus);
if (r < 0)
@@ -971,11 +971,12 @@ static int check_units_active(void) {
while ((r = sd_bus_message_read(
reply, "(ssssssouso)",
- NULL, NULL, NULL, &state, NULL,
- NULL, NULL, NULL, NULL, NULL)) > 0)
- if (!STR_IN_SET(state, "dead", "failed"))
- c++;
-
+ &id, NULL, NULL, &state, &substate,
+ NULL, NULL, NULL, NULL, NULL)) > 0) {
+ bool found = !STR_IN_SET(state, "dead", "failed");
+ log_debug("Unit %s is %s/%s, %scounting it.", id, state, substate, found ? "" : "not ");
+ c += found;
+ }
if (r < 0)
return bus_log_parse_error(r);