summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukáš Nykrýn <lnykryn@redhat.com>2016-08-03 17:08:37 +0200
committerLennart Poettering <lennart@poettering.net>2016-08-03 17:08:37 +0200
commit7f5da8bd4fb1ba49ba40195a74ca76bb5d4d1f81 (patch)
tree64b0113b1d67240ed30bb7947e8a16fda86e34ae /src
parent5e0bb1a6287387f179540895e43647a0baa8c724 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 782824ff38..4fa7adfc41 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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;