mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-28 20:25:25 +03:00
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.
This commit is contained in:
parent
0cd4e913da
commit
7bbf2d8423
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user