[gdm] daemon: reload config on SIGHUP



commit d4fafda602937fdb13d28a710eab997ff7262251
Author: Brian Cameron <brian cameron oracle com>
Date:   Mon Jun 25 12:12:03 2012 -0400

    daemon: reload config on SIGHUP

 common/gdm-settings-direct.c |    6 +++++-
 daemon/main.c                |   12 ++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/common/gdm-settings-direct.c b/common/gdm-settings-direct.c
index b1b66fb..fb1f1f3 100644
--- a/common/gdm-settings-direct.c
+++ b/common/gdm-settings-direct.c
@@ -232,7 +232,11 @@ 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_unref (schemas);
+                schemas = NULL;
+        }
 
         if (! gdm_settings_parse_schemas (file, root, &list)) {
                 g_warning ("Unable to parse schemas");
diff --git a/daemon/main.c b/daemon/main.c
index 2ffb779..cba7cc2 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -471,9 +471,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
                  */
+                g_object_unref (settings);
+                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]