mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
systemctl: consider service running only when it is in active or reloading state (#3874)
Otherwise for example services that are failing on start and have Restart=on-failure and bigger RestartSec systemctl status will return 0. Fixes: #3864
This commit is contained in:
parent
5e0bb1a628
commit
7f5da8bd4f
|
@ -4767,7 +4767,7 @@ static int show_one(
|
|||
else if (streq(verb, "status")) {
|
||||
print_status_info(bus, &info, ellipsized);
|
||||
|
||||
if (info.active_state && STR_IN_SET(info.active_state, "inactive", "failed"))
|
||||
if (info.active_state && !STR_IN_SET(info.active_state, "active", "reloading"))
|
||||
r = EXIT_PROGRAM_NOT_RUNNING;
|
||||
else
|
||||
r = EXIT_PROGRAM_RUNNING_OR_SERVICE_OK;
|
||||
|
|
Loading…
Reference in a new issue