gchar *msg;
/* register the application and context with the DLT */
- DLT_REGISTER_APP ("BMGR", "GENIVI Boot Manager");
+ DLT_REGISTER_APP ("NSC", "GENIVI Node Startup Controller");
DLT_REGISTER_CONTEXT (la_handler_context, "LAH", "Legacy Application Handler");
/* make sure to unregister the DLT at exit */
-DLT_IMPORT_CONTEXT (boot_manager_context);
+DLT_IMPORT_CONTEXT (controller_context);
{
log_text = g_strdup_printf ("Failed to connect to the NSM lifecycle control: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
{
message = g_strdup_printf ("Failed to start the LUC application \"%s\": %s",
unit, error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (message));
g_free (message);
}
{
log_text = g_strdup_printf ("Failed checking whether the LUC is required: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_clear_error (&error);
- DLT_LOG (boot_manager_context, DLT_LOG_INFO,
+ DLT_LOG (controller_context, DLT_LOG_INFO,
DLT_STRING ("Assuming that we should start the LUC"));
/* start all the LUC groups now */
/* check whether we need to start the LUC or not */
if (luc_required)
{
- DLT_LOG (boot_manager_context, DLT_LOG_INFO,
+ DLT_LOG (controller_context, DLT_LOG_INFO,
DLT_STRING ("LUC is required, starting it now"));
/* start all the LUC groups now */
else
{
/* LUC is not required, log this information */
- DLT_LOG (boot_manager_context, DLT_LOG_INFO,
+ DLT_LOG (controller_context, DLT_LOG_INFO,
DLT_STRING ("LUC is not required"));
/* notify others that we have started the LUC groups; we haven't
{
if (error->code == G_IO_ERROR_NOT_FOUND)
{
- DLT_LOG (boot_manager_context, DLT_LOG_INFO,
+ DLT_LOG (controller_context, DLT_LOG_INFO,
DLT_STRING ("Boot manager could not find the last user context"));
}
else
{
log_text = g_strdup_printf ("Error reading last user context: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
}
g_error_free (error);
}
else
{
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR,
+ DLT_LOG (controller_context, DLT_LOG_ERROR,
DLT_STRING ("NSM unavailable, starting the LUC unconditionally"));
/* start all the LUC groups now */
-DLT_DECLARE_CONTEXT (boot_manager_context);
+DLT_DECLARE_CONTEXT (controller_context);
DLT_DECLARE_CONTEXT (la_handler_context);
static void
unregister_dlt (void)
{
- DLT_UNREGISTER_CONTEXT (boot_manager_context);
+ DLT_UNREGISTER_CONTEXT (controller_context);
DLT_UNREGISTER_CONTEXT (la_handler_context);
DLT_UNREGISTER_APP ();
}
gchar *msg;
/* register the application and context in DLT */
- DLT_REGISTER_APP ("BMGR", "GENIVI Boot Manager");
- DLT_REGISTER_CONTEXT (boot_manager_context, "MGR",
- "Context of the boot manager itself");
+ DLT_REGISTER_APP ("NSC", "GENIVI Node Startup Controller");
+ DLT_REGISTER_CONTEXT (controller_context, "CTRL",
+ "Context of the Node Startup Controller itself");
DLT_REGISTER_CONTEXT (la_handler_context, "LAH",
- "Context of the legacy application handler that hooks legacy "
+ "Context of the Legacy Application Handler that hooks legacy "
"applications up with the shutdown concept of the Node State "
"Manager");
if (connection == NULL)
{
msg = g_strdup_printf ("Failed to connect to the system bus: %s", error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_FATAL, DLT_STRING (msg));
+ DLT_LOG (controller_context, DLT_LOG_FATAL, DLT_STRING (msg));
g_free (msg);
/* clean up */
{
msg = g_strdup_printf ("Failed to connect to the systemd manager: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_FATAL, DLT_STRING (msg));
+ DLT_LOG (controller_context, DLT_LOG_FATAL, DLT_STRING (msg));
g_free (msg);
/* clean up */
{
msg = g_strdup_printf ("Failed to subscribe to the systemd manager: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_FATAL, DLT_STRING (msg));
+ DLT_LOG (controller_context, DLT_LOG_FATAL, DLT_STRING (msg));
g_free (msg);
/* clean up */
{
msg = g_strdup_printf ("Failed to start the node startup controller service: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (msg));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (msg));
g_free (msg);
/* clean up */
{
msg = g_strdup_printf ("Failed to start the legacy app handler service: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (msg));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (msg));
g_free (msg);
/* clean up */
-DLT_IMPORT_CONTEXT (boot_manager_context);
+DLT_IMPORT_CONTEXT (controller_context);
/* log information about the watchdog timeout using DLT */
message = g_strdup_printf ("Updating systemd's watchdog timestamp every %d seconds",
watchdog_sec);
- DLT_LOG (boot_manager_context, DLT_LOG_INFO, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING (message));
g_free (message);
}
}
{
log_text = g_strdup_printf ("Failed to export shutdown consumer on the bus: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_clear_error (&error);
}
{
log_text = g_strdup_printf ("Failed to register the node startup controller as a shutdown "
"consumer: %s", error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
{
log_text = g_strdup_printf ("The node startup controller has registered as a shutdown "
"consumer");
- DLT_LOG (boot_manager_context, DLT_LOG_INFO, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING (log_text));
g_free (log_text);
}
else
{
log_text = g_strdup_printf ("Failed to register the node startup controller as a shutdown "
"consumer: error status %d", error_code);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
}
}
{
log_text = g_strdup_printf ("Failed to unregister the node startup controller as a shutdown "
"consumer: %s", error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
{
log_text = g_strdup_printf ("The node startup controller has unregistered as a shutdown "
"consumer");
- DLT_LOG (boot_manager_context, DLT_LOG_INFO, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING (log_text));
g_free (log_text);
}
else
{
log_text = g_strdup_printf ("Failed to unregister the node startup controller as a shutdown "
"consumer: error status %d", error_code);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
}
-DLT_IMPORT_CONTEXT (boot_manager_context);
+DLT_IMPORT_CONTEXT (controller_context);
{
log_text = g_strdup_printf ("Failed to finish LUC registration: "
"the registration sequence has not been started yet");
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
/* notify the caller that we have handled the method call */
if (error != NULL)
{
log_text = g_strdup_printf ("Failed to finish LUC registration: %s", error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
{
log_text = g_strdup_printf ("Failed to register apps with the LUC: "
"The registration sequence has not been started yet");
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
/* notify the caller that we have handled the register request */
/* log the new last user context */
debug_text = g_variant_print (service->current_user_context, TRUE);
log_text = g_strdup_printf ("The new context is: %s", debug_text);
- DLT_LOG (boot_manager_context, DLT_LOG_DEBUG, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_DEBUG, DLT_STRING (log_text));
g_free (debug_text);
g_free (log_text);
-DLT_IMPORT_CONTEXT (boot_manager_context);
+DLT_IMPORT_CONTEXT (controller_context);
{
log_text = g_strdup_printf ("Failed to connect to the NSM lifecycle control: %s",
error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
/* there was an error, log it */
message = g_strdup_printf ("Failed to get unit \"%s\" from systemd: %s",
data->unit_name, error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (message));
g_free (message);
g_error_free (error);
else
{
message = g_strdup_printf ("Creating D-Bus proxy for unit \"%s\"", object_path);
- DLT_LOG (boot_manager_context, DLT_LOG_INFO, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING (message));
g_free (message);
/* remember the object path */
/* there was an error, log it */
message = g_strdup_printf ("Failed to create a D-Bus proxy for unit \"%s\": %s",
data->object_path, error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (message));
g_error_free (error);
}
else
/* log the the active state has changed */
message = g_strdup_printf ("Active state of unit \"%s\" changed to %s",
data->unit_name, state);
- DLT_LOG (boot_manager_context, DLT_LOG_INFO, DLT_STRING (message));
+ DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING (message));
g_free (message);
/* check if the new state is active */
&error))
{
log_text = g_strdup_printf ("Failed to set the node state: %s", error->message);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
g_error_free (error);
}
{
log_text = g_strdup_printf ("Failed to set the node state: error code %d",
error_code);
- DLT_LOG (boot_manager_context, DLT_LOG_ERROR, DLT_STRING (log_text));
+ DLT_LOG (controller_context, DLT_LOG_ERROR, DLT_STRING (log_text));
g_free (log_text);
}
}