]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix manager_state
authorroot <root@new-host-3.home>
Sat, 4 Apr 2020 03:35:22 +0000 (22:35 -0500)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Apr 2020 13:27:50 +0000 (15:27 +0200)
src/core/manager.c

index 2ae1e3f4d939a85838dbc28ccfc17a6209d4d5c9..4a11054e05c7571a828f54ee0f2012073b0502fb 100644 (file)
@@ -4247,6 +4247,11 @@ ManagerState manager_state(Manager *m) {
 
         assert(m);
 
+        /* Is the special shutdown target active or queued? If so, we are in shutdown state */
+        u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
+        if (u && unit_active_or_pending(u))
+                return MANAGER_STOPPING;
+
         /* Did we ever finish booting? If not then we are still starting up */
         if (!MANAGER_IS_FINISHED(m)) {
 
@@ -4257,11 +4262,6 @@ ManagerState manager_state(Manager *m) {
                 return MANAGER_STARTING;
         }
 
-        /* Is the special shutdown target active or queued? If so, we are in shutdown state */
-        u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
-        if (u && unit_active_or_pending(u))
-                return MANAGER_STOPPING;
-
         if (MANAGER_IS_SYSTEM(m)) {
                 /* Are the rescue or emergency targets active or queued? If so we are in maintenance state */
                 u = manager_get_unit(m, SPECIAL_RESCUE_TARGET);