diff -Naur gdm-2.31.1.orig/daemon/gdm-simple-slave.c gdm-2.31.1/daemon/gdm-simple-slave.c
--- gdm-2.31.1.orig/daemon/gdm-simple-slave.c	2010-05-25 00:58:38.000000000 +0300
+++ gdm-2.31.1/daemon/gdm-simple-slave.c	2010-07-07 06:31:20.587359854 +0300
@@ -141,10 +141,16 @@
                  int             signal_number,
                  GdmSimpleSlave *slave)
 {
+        char *username;
+
         g_debug ("GdmSimpleSlave: session died with signal %d, (%s)",
                  signal_number,
                  g_strsignal (signal_number));
 
+        /* Run the PostSession script. gdmslave suspends until script has terminated */
+        username = gdm_session_direct_get_username (slave->priv->session);
+        gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostSession", username);
+
         gdm_slave_stopped (GDM_SLAVE (slave));
 }
 
