GNOME Bugzilla – Bug 126071
Gdm does not ensure user's programs exit before calling pam_close_session
Last modified: 2003-11-06 17:52:34 UTC
Programs such as xscreensaver are still hanging around when gdm executes pam_close_session. Gdm 2.4.4.5 does not reset/restart the X server until after it calls pam_close_session. As a result, pam_mount often can not unmount a user's home directory because programs like xscreensaver retain open file descriptors within $HOME.
Created attachment 21166 [details] [review] Patch that causes gdm to run pam_close_session /after/ resetting X server
"Somewhat fixed" in HEAD. I added a call that just whacks all the clients with windows using XKillClient (this is being used to for example clean up the login screen as well). There is still an unavoidable race. The clients themeselves may not die in time. I added a sched_yield in there though I doubt that makes much difference. Though perhaps if your unmount code tries again in a few seconds if it doesn't succeed once, things should just work out then. Alternative fix would be for your module to "fork" a process that would take care of the unmount asynch and thus could wait untill all processes have died.