|
|
281364 |
From b9dd7ee5f4d0f6d51899d7e14ac7ef2fd2840b8f Mon Sep 17 00:00:00 2001
|
|
|
281364 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
281364 |
Date: Tue, 9 Oct 2018 17:37:57 +0200
|
|
|
281364 |
Subject: [PATCH] core: bring manager_startup() and manager_reload() more
|
|
|
281364 |
inline
|
|
|
281364 |
|
|
|
281364 |
Both functions do partly the same, let's make sure they do it in the
|
|
|
281364 |
same order, and that we don't miss some calls.
|
|
|
281364 |
|
|
|
281364 |
This makes a number of changes:
|
|
|
281364 |
|
|
|
281364 |
1. Moves exec_runtime_vacuum() two calls down in manager_startup(). This
|
|
|
281364 |
should not have any effect but makes manager_startup() more like
|
|
|
281364 |
manager_reload().
|
|
|
281364 |
|
|
|
281364 |
2. Calls manager_recheck_journal(), manager_recheck_dbus(),
|
|
|
281364 |
manager_enqueue_sync_bus_names() in manager_startup() too. This is a
|
|
|
281364 |
good idea since during reeexec we pass through manager_startup() and
|
|
|
281364 |
hence can't assume dbus and journald weren't up yet, hence let's
|
|
|
281364 |
check if they are ready to be connected to.
|
|
|
281364 |
|
|
|
281364 |
3. Include manager_enumerate_perpetual() in manager_reload(), too. This
|
|
|
281364 |
is not strictly necessary, since these units are included in the
|
|
|
281364 |
serialization anyway, but it's still a nice thing, in particular as
|
|
|
281364 |
theoretically the deserialization could fail.
|
|
|
281364 |
|
|
|
281364 |
(cherry picked from commit 3ad2afb6a204513c7834c64ab864e40169874390)
|
|
|
281364 |
|
|
|
281364 |
Resolves: #2059633
|
|
|
281364 |
---
|
|
|
281364 |
src/core/manager.c | 14 +++++++++++---
|
|
|
281364 |
1 file changed, 11 insertions(+), 3 deletions(-)
|
|
|
281364 |
|
|
|
281364 |
diff --git a/src/core/manager.c b/src/core/manager.c
|
|
|
281364 |
index e083596e58..4a9f9bfcf9 100644
|
|
|
281364 |
--- a/src/core/manager.c
|
|
|
281364 |
+++ b/src/core/manager.c
|
|
|
281364 |
@@ -1665,12 +1665,12 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
|
|
|
281364 |
/* Release any dynamic users no longer referenced */
|
|
|
281364 |
dynamic_user_vacuum(m, true);
|
|
|
281364 |
|
|
|
281364 |
- exec_runtime_vacuum(m);
|
|
|
281364 |
-
|
|
|
281364 |
/* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */
|
|
|
281364 |
manager_vacuum_uid_refs(m);
|
|
|
281364 |
manager_vacuum_gid_refs(m);
|
|
|
281364 |
|
|
|
281364 |
+ exec_runtime_vacuum(m);
|
|
|
281364 |
+
|
|
|
281364 |
if (serialization) {
|
|
|
281364 |
assert(m->n_reloading > 0);
|
|
|
281364 |
m->n_reloading--;
|
|
|
281364 |
@@ -1681,6 +1681,13 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
|
|
|
281364 |
m->send_reloading_done = true;
|
|
|
281364 |
}
|
|
|
281364 |
|
|
|
281364 |
+ /* It might be safe to log to the journal now and connect to dbus */
|
|
|
281364 |
+ manager_recheck_journal(m);
|
|
|
281364 |
+ manager_recheck_dbus(m);
|
|
|
281364 |
+
|
|
|
281364 |
+ /* Sync current state of bus names with our set of listening units */
|
|
|
281364 |
+ (void) manager_enqueue_sync_bus_names(m);
|
|
|
281364 |
+
|
|
|
281364 |
/* Let's finally catch up with any changes that took place while we were reloading/reexecing */
|
|
|
281364 |
manager_catchup(m);
|
|
|
281364 |
|
|
|
281364 |
@@ -3505,7 +3512,8 @@ int manager_reload(Manager *m) {
|
|
|
281364 |
lookup_paths_reduce(&m->lookup_paths);
|
|
|
281364 |
manager_build_unit_path_cache(m);
|
|
|
281364 |
|
|
|
281364 |
- /* First, enumerate what we can from all config files */
|
|
|
281364 |
+ /* First, enumerate what we can from kernel and suchlike */
|
|
|
281364 |
+ manager_enumerate_perpetual(m);
|
|
|
281364 |
manager_enumerate(m);
|
|
|
281364 |
|
|
|
281364 |
/* Second, deserialize our stored data */
|