]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: consider service running only when it is in active or reloading state...
authorLukáš Nykrýn <lnykryn@redhat.com>
Wed, 3 Aug 2016 15:08:37 +0000 (17:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Aug 2016 15:08:37 +0000 (17:08 +0200)
Otherwise for example services that are failing on start and have Restart=on-failure
and bigger RestartSec systemctl status will return 0.

Fixes: #3864
src/systemctl/systemctl.c

index 782824ff38484bba03960bd6d5cb9a0da0e0bfc6..4fa7adfc41607673c4e69088d2b0a653a9be6831 100644 (file)
@@ -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;