summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-10 21:10:53 +0200
committerLennart Poettering <lennart@poettering.net>2013-07-10 23:41:03 +0200
commit71445ae75b0e9954d141e5f0ee97803b406ea332 (patch)
treef1f00a625f725d72429c51d61eb24b3842bd2648 /src/core/manager.c
parentd0ede8f1c555500dceebd3cc8a8e877ed1d89de6 (diff)
core: send out "Reloading" signal before and after doing a full reload/reexec of PID 1
Since we'll unload all units/job during a reload, and then readd them it is really useful for clients to be aware of this phase hence sent a signal out before and after. This signal is called "Reloading" (despite the fact that it is also sent out during reexecution, which we consider a special case in this context) and has one boolean parameter which is true for the signal sent before the reload, and false for the signal after the reload. The UnitRemoved/JobRremoved and UnitNew/JobNew due to the reloading are guranteed to be between the pair of Reloading messages.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 51f03de098..2e98181b37 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -864,6 +864,11 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
if (serialization) {
assert(m->n_reloading > 0);
m->n_reloading --;
+
+ /* Let's wait for the UnitNew/JobNew messages being
+ * sent, before we notify that the reload is
+ * finished */
+ m->send_reloading_done = true;
}
return r;
@@ -1163,6 +1168,13 @@ unsigned manager_dispatch_dbus_queue(Manager *m) {
}
m->dispatching_dbus_queue = false;
+
+ if (m->send_reloading_done) {
+ m->send_reloading_done = false;
+
+ bus_broadcast_reloading(m, false);
+ }
+
return n;
}
@@ -2238,6 +2250,7 @@ int manager_reload(Manager *m) {
return r;
m->n_reloading ++;
+ bus_broadcast_reloading(m, true);
fds = fdset_new();
if (!fds) {
@@ -2297,6 +2310,8 @@ int manager_reload(Manager *m) {
assert(m->n_reloading > 0);
m->n_reloading--;
+ m->send_reloading_done = true;
+
finish:
if (f)
fclose(f);