]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: rework how we set the objective to MANAGER_OK
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Oct 2018 15:58:08 +0000 (17:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 9 Oct 2018 17:43:43 +0000 (19:43 +0200)
Let's do so already when we are about to complete startup/reload, so
that manager_catchup() is run in a context where MANAGER_IS_RUNNING()
returns true, as the intention is.

Fixes: #9518
src/core/manager.c

index 5a5212f6c2fdfa8b7e0f2e9d58267230e782f531..0282ae32538430ed6f38037a6d7daee2d2712ce7 100644 (file)
@@ -1680,6 +1680,8 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
                 m->send_reloading_done = true;
         }
 
+        m->objective = MANAGER_OK;
+
         /* It might be safe to log to the journal now and connect to dbus */
         manager_recheck_journal(m);
         manager_recheck_dbus(m);
@@ -2811,7 +2813,7 @@ int manager_loop(Manager *m) {
         RATELIMIT_DEFINE(rl, 1*USEC_PER_SEC, 50000);
 
         assert(m);
-        m->objective = MANAGER_OK;
+        assert(m->objective == MANAGER_OK); /* Ensure manager_startup() has been called */
 
         /* Release the path cache */
         m->unit_path_cache = set_free_free(m->unit_path_cache);
@@ -3550,6 +3552,7 @@ int manager_reload(Manager *m) {
         /* Consider the reload process complete now. */
         assert(m->n_reloading > 0);
         m->n_reloading--;
+        m->objective = MANAGER_OK;
 
         /* It might be safe to log to the journal now and connect to dbus */
         manager_recheck_journal(m);