These patches fix bugster CR  #6706624 (user processes do not exit on 
DTU reset.

gnome-session-2.22 only attempts to stop the dbus-daemon session daemon 
process after
gtk_main() inside the main loop. When the DTU is reset, the code after 
the gtk_main()
function is never reached so cleanup doesn't happen.
The fix is to register an atexit() function that checks and stops the 
dbus-daemon process
if necessary.

Changes for spec-files/patches/SUNWtgnome-xagent-01-trusted-extensions.diff:

static void
AtExit (void)
{
    gsm_keyring_daemon_stop ();
+    if (dbus_daemon_owner)
+        gsm_dbus_daemon_stop ();
}

Changes for patches/gnome-session-14-dbus-cleanup.diff:
--- gnome-session-2.22.2/gnome-session/main.c    2008-05-29 
15:07:46.795547000 +0100
+++ gnome-session-2.22.2/gnome-session/main.c-new    2008-05-29 
15:08:57.033580000 +0100
@@ -79,6 +79,12 @@
 /* Flag indicating that the normal CONFIG_PREFIX should not be used */
 gboolean failsafe = FALSE;
 
+/* Flag indicating that dbus-daemon process was spawned by this
+ * process when TRUE  */
+gboolean dbus_daemon_owner = FALSE;
+
+GsmDBusServer *dbus_server = NULL;
+
 /* Wait period for clients to register. */
 gint purge_delay = 120000;
 
@@ -106,6 +112,16 @@
   {NULL}
 };
 
+static void
+exit_cleanup(void)
+{
+  if (dbus_daemon_owner)
+    {
+      g_object_unref (dbus_server);
+      gsm_dbus_daemon_stop ();
+    }
+}
+
 static gint
 show_gnome_about (gpointer data)
 {
@@ -730,8 +746,6 @@
   char **versions;
   GConfClient *gconf_client;
   GOptionContext *goption_context;
-  gboolean dbus_daemon_owner;
-  GsmDBusServer *dbus_server;
   GnomeProgram *program;
 #ifdef HAVE_XTSOL
   gboolean saved_a11y = FALSE;
@@ -891,6 +905,9 @@
 
   ignore (SIGPIPE);
 
+  /* Register cleanup function for abnormal exit */
+  atexit (exit_cleanup);
+
   /* Need DISPLAY set */
   gsm_keyring_daemon_start ();
   dbus_daemon_owner = gsm_dbus_daemon_start ();
@@ -997,6 +1014,7 @@
   if (dbus_daemon_owner) {
     g_object_unref (dbus_server);
     gsm_dbus_daemon_stop ();
+    dbus_daemon_owner = FALSE;
   }
 
   g_object_unref (gconf_client);
*** (#1 of 1): 2008-05-29 16:19:08 IST niall.power at sun.com



Reply via email to