gconfd-2 does not exit when a user log out, breaks unmounting home

W. Michael Petullo mike at flyn.org
Fri Oct 31 00:56:27 UTC 2003


> > The problem comes when a system tries to unmount a user's home directory when
> > the user logs out.  For example, pam_mount unmounts an encrypted home
> > directory then I log out of my system.  Other people use NFS or other means
> > to mount home directories.
> 
> I think the simple solution is to exec "gconftool-2 --shutdown" as the
> last thing gnome-session does before exiting, or perhaps even in the X
> scripts in xinitrc. If you wrote and tested a patch along those lines
> it'd be useful.
> 
> Another possible solution is to have an X server monitor process for
> gconfd; basically gconfd would fork/exec a tiny little program that
> simply connects to the X server and sits there, exiting when it loses
> the X connection. gconfd would then exit when this program exits. This
> is conceivably a more robust approach and still pretty easy to
> implement.

Your second solution may be something that could be generalized to be
quite useful -- perhaps freedesktop.org material?  Other projects,
like the venerable esd, have problems similar to gconfd.  Esd can lock
down a system's audio device for a while after a user logs out.  I'll have
to spend a little time looking at xscreensaver, gnome-settings-daemon,
etc.

Your first solution seems simple enough.  I included a very unsophisticated
patch that performs the task (vs. gnome-session 2.4.0).  Comments?

==============================================================================   
diff --recursive -u gnome-session-2.4.0-vanilla/gnome-session/main.c gnome-session-2.4.0/gnome-session/main.c
--- gnome-session-2.4.0-vanilla/gnome-session/main.c	2003-08-13 07:58:52.000000000 -0500
+++ gnome-session-2.4.0/gnome-session/main.c	2003-10-30 17:01:04.000000000 -0600
@@ -481,6 +481,15 @@
 #endif
 }
 
+/* Ensure gconfd-2 is shutdown when a user logs out so the user's $HOME
+ * may be unmounted if appropriate
+ */
+static void gconfd_shutdown (void)
+{
+  char *argv[] = { "gconftool-2", "--shutdown", NULL };
+  gnome_execute_async (NULL, 2, argv);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -634,6 +643,8 @@
 
   clean_ice ();
 
+  gconfd_shutdown (); /* in case home needs to be unmounted on logout */
+
   /* If a logout command was set, the following will not return */
   execute_logout ();
==============================================================================   

-- 
Mike

:wq





More information about the fedora-devel-list mailing list