guint prop_id,
const GValue *value,
GParamSpec *pspec);
+static void boot_manager_application_luc_groups_started (LUCStarter *starter,
+ BootManagerApplication *application);
application->luc_starter = luc_starter_new (application->job_manager,
application->boot_manager_service);
+ /* be notified when LUC groups have started so that we can hand
+ * control over to systemd again */
+ g_signal_connect (application->luc_starter, "luc-groups-started",
+ G_CALLBACK (boot_manager_application_luc_groups_started),
+ application);
+
/* restore the LUC if desired */
luc_starter_start_groups (application->luc_starter);
boot_manager_application_handle_register_finish,
NULL);
- /* inform systemd that this process has started */
- sd_notify (0, "READY=1");
-
/* release the shutdown consumer */
g_object_unref (consumer);
}
+static void
+boot_manager_application_luc_groups_started (LUCStarter *starter,
+ BootManagerApplication *application)
+{
+ g_return_if_fail (IS_LUC_STARTER (starter));
+ g_return_if_fail (BOOT_MANAGER_IS_APPLICATION (application));
+
+ /* notify systemd that we have finished starting the LUC and
+ * that it can take over control to start unfocused.target,
+ * lazy.target etc. */
+ sd_notify (0, "READY=1");
+}
+
+
+
BootManagerApplication *
boot_manager_application_new (GMainLoop *main_loop,
GDBusConnection *connection,
+/* signal identifiers */
+enum
+{
+ SIGNAL_LUC_GROUPS_STARTED,
+ LAST_SIGNAL,
+};
+
+
+
/* property identifiers */
enum
{
+static guint luc_starter_signals[LAST_SIGNAL];
+
+
+
G_DEFINE_TYPE (LUCStarter, luc_starter, G_TYPE_OBJECT);
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+
+ luc_starter_signals[SIGNAL_LUC_GROUPS_STARTED] =
+ g_signal_new ("luc-groups-started",
+ TYPE_LUC_STARTER,
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
g_hash_table_remove (starter->start_groups, GINT_TO_POINTER (group));
g_array_remove_index (starter->start_order, 0);
- /* start the next group if there are any left */
+ /* check if we have more groups to start */
if (starter->start_order->len > 0)
- luc_starter_start_next_group (starter);
+ {
+ /* we do, so start the next group now */
+ luc_starter_start_next_group (starter);
+ }
+ else
+ {
+ /* no, we are finished; notify others */
+ g_signal_emit (starter, luc_starter_signals[SIGNAL_LUC_GROUPS_STARTED],
+ 0, NULL);
+ }
}
}
/* LUC is not required, log this information */
DLT_LOG (boot_manager_context, DLT_LOG_INFO,
DLT_STRING ("LUC is not required"));
+
+ /* notify others that we have started the LUC groups; we haven't
+ * in this case but the call of luc_starter_start_groups() may
+ * still want to be notified that the call has been processed */
+ g_signal_emit (starter, luc_starter_signals[SIGNAL_LUC_GROUPS_STARTED],
+ 0, NULL);
}
}
}