From: Zbigniew Jędrzejewski-Szmek Date: Sat, 25 Feb 2017 22:14:00 +0000 (-0500) Subject: coredumpctl: add debug information which services count towards the warning X-Git-Tag: v233~11^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7bbf2d84234db8f9dd39604a367dc56a8f5455c7;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 4ac98d8163d..810d4f95a4e 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);