From 7bbf2d84234db8f9dd39604a367dc56a8f5455c7 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 25 Feb 2017 17:14:00 -0500 Subject: 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. --- src/coredump/coredumpctl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/coredump/coredumpctl.c') 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); -- cgit v1.2.3-54-g00ecf