mirror of
https://github.com/troglobit/finit.git
synced 2026-10-07 08:04:22 +07:00
dbus: notify externals when reconfiguration completes
initctl reload freezes conditions to the old generation and each owner re-asserts. Finit's own providers do this in-process; an external provider whose conditions are generation files, rather than the oneshot symlinks keventd uses, has no way to know the moment. Emit Manager1.ConfigReloaded when reconfiguration completes. keventd needs no subscriber: its conditions are symlinks to the reconf marker itself, so they read the current generation by construction and never flux, which the device bus test now pins down. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+13
@@ -626,6 +626,7 @@ static const link_method_t manager_methods[] = {
|
||||
static const link_signal_t manager_signals[] = {
|
||||
{ .name = "ServiceStateChanged", .sig = "sss" },
|
||||
{ .name = "RunlevelChanged", .sig = "ss" },
|
||||
{ .name = "ConfigReloaded", .sig = "" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -1042,6 +1043,18 @@ void dbus_notify_runlevel_change(int old_level, int new_level)
|
||||
"RunlevelChanged", "ss", body, (size_t)blen);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reconfiguration complete: all conditions have been re-asserted by
|
||||
* their in-Finit owners. External providers whose conditions are
|
||||
* generation files, rather than the oneshot symlinks keventd uses,
|
||||
* subscribe to this to re-assert theirs.
|
||||
*/
|
||||
void dbus_notify_reload(void)
|
||||
{
|
||||
dbus_emit_signal("/org/finit/manager", "org.finit.Manager1",
|
||||
"ConfigReloaded", "", NULL, 0);
|
||||
}
|
||||
|
||||
/* ---------- org.finit.Cond1 ---------- */
|
||||
|
||||
#define COND_PATH_OBJECT "/org/finit/cond"
|
||||
|
||||
@@ -54,6 +54,7 @@ void dbus_unregister_service (svc_t *svc);
|
||||
void dbus_notify_service_state (svc_t *svc, int old_state, int new_state);
|
||||
void dbus_notify_condition_change(const char *name, const char *state);
|
||||
void dbus_notify_runlevel_change(int old_level, int new_level);
|
||||
void dbus_notify_reload (void);
|
||||
#endif
|
||||
void conf_flush_events(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user