added scripts to place config files, added a note in source about that
[systembsd.git] / src / interfaces / hostnamed / hostnamed.c
index 3f461e9e4f3a05ccadfafa72e708be27d57fa034..4b326a1400bc29d2d883e8797b0317861f903ff7 100644 (file)
@@ -84,7 +84,6 @@ static void on_bus_acquired(GDBusConnection *conn,
                                                                                           NULL,
                                                                                           NULL,
                                                                                           NULL);
-       g_assert(reg_id > 0);
 }
 
 static void on_name_acquired(GDBusConnection *conn,
@@ -99,18 +98,19 @@ static void on_name_lost(GDBusConnection *conn,
                                                 gpointer user_data) {
 
        g_print("lost name %s, exiting...\n", name);
+       g_print("you might need to run hacks/punch_config.sh\n");
        g_main_loop_quit(loop);
 }
 
 /* safe call to try and start hostnamed */
-GError hostnamed_init() {
+GError hostnamed_init() {
 
        guint bus_descriptor;
        GError *err = NULL;     
 
        spect_data = g_dbus_node_info_new_for_xml(SYSTEMD_HOSTNAMED_XML, &err);
 
-       bus_descriptor = g_bus_own_name(G_BUS_TYPE_SESSION,
+       bus_descriptor = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                        (gchar *)"org.freedesktop.hostname1",
                                                    G_BUS_NAME_OWNER_FLAGS_NONE,
                                                    on_bus_acquired,
@@ -121,4 +121,7 @@ GError hostnamed_init() {
 
        loop = g_main_loop_new(NULL, FALSE);
        g_main_loop_run(loop);
+
+       //TODO: malloc and return reference as if a main() closed
+       return err;
 }