[gdm/wip/multi-seat-2-30] Now GDM will reload its configuration settings if you send a HUP signal to the gdm-binary process.



commit 4c19383e2560f18a828c06e6e77bddddf0b91a87
Author: Brian Cameron <brian cameron oracle com>
Date:   Thu Jun 21 20:29:15 2012 -0500

    Now GDM will reload its configuration settings if you send a HUP signal to
    the gdm-binary process.

 common/gdm-settings-direct.c |    5 ++++-
 common/gdm-settings.c        |    7 +++++++
 common/gdm-settings.h        |    1 +
 daemon/main.c                |   12 ++++++++++--
 4 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/common/gdm-settings-direct.c b/common/gdm-settings-direct.c
index a90eed2..c4e1fe5 100644
--- a/common/gdm-settings-direct.c
+++ b/common/gdm-settings-direct.c
@@ -232,7 +232,10 @@ gdm_settings_direct_init (GdmSettings *settings,
         g_return_val_if_fail (file != NULL, FALSE);
         g_return_val_if_fail (root != NULL, FALSE);
 
-        g_assert (schemas == NULL);
+        g_debug ("Settings Direct Init");
+        if (schemas != NULL)
+                g_hash_table_destroy (schemas);
+        schemas = NULL;
 
         if (! gdm_settings_parse_schemas (file, root, &list)) {
                 g_warning ("Unable to parse schemas");
diff --git a/common/gdm-settings.c b/common/gdm-settings.c
index 00fe73e..e4457cf 100644
--- a/common/gdm-settings.c
+++ b/common/gdm-settings.c
@@ -259,3 +259,10 @@ gdm_settings_new (void)
 
         return GDM_SETTINGS (settings_object);
 }
+
+void
+gdm_settings_clear (void)
+{
+        g_object_unref (settings_object);
+        settings_object = NULL;
+}
diff --git a/common/gdm-settings.h b/common/gdm-settings.h
index 8284e84..94c4b5f 100644
--- a/common/gdm-settings.h
+++ b/common/gdm-settings.h
@@ -74,6 +74,7 @@ gboolean            gdm_settings_set_value                      (GdmSettings *se
                                                                  const char  *key,
                                                                  const char  *value,
                                                                  GError     **error);
+void                gdm_settings_clear                          (void);
 
 G_END_DECLS
 
diff --git a/daemon/main.c b/daemon/main.c
index d702958..b6d1535 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -489,9 +489,17 @@ signal_cb (int      signo,
 
         case SIGHUP:
                 g_debug ("Got HUP signal");
-                /* FIXME:
-                 * Reread config stuff like system config files, VPN service files, etc
+                /* Reread config stuff like system config files, VPN service
+                 * files, etc
                  */
+                gdm_settings_clear ();
+                settings = gdm_settings_new ();
+                if (settings != NULL) {
+                        if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+                                g_warning ("Unable to initialize settings");
+                        }
+                }
+
                 ret = TRUE;
 
                 break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]