After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 97361 - improve exit-gconfd-on-logout chances
improve exit-gconfd-on-logout chances
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: gconf
1.2.x
Other Linux
: High normal
: GNOME2.6
Assigned To: GConf Maintainers
GConf Maintainers
: 97651 108639 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-10-31 19:57 UTC by Stephane Chauveau
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple patch that causes gnome-session to shutdown gconfd-2 processes when a user logs out. (819 bytes, patch)
2003-10-31 17:21 UTC, W. Michael Petullo
none Details | Review
Simple patch that causes gnome-session to shutdown gconfd-2 /and/ bonobo-activation-server processes when a user logs out. (1.18 KB, patch)
2003-11-02 18:39 UTC, W. Michael Petullo
none Details | Review
Same patch, but uses execvp/waitpid instead of gnome_execute_async. (1.53 KB, patch)
2003-11-03 20:03 UTC, W. Michael Petullo
none Details | Review
patch which I committed (2.24 KB, patch)
2003-12-02 16:50 UTC, Mark McLoughlin
none Details | Review

Description Stephane Chauveau 2002-10-31 19:57:49 UTC
gconfd does not die with gnome-session. It usually 
receives a SIGHUP signal when the X display dies.

For an unknown reason, this signal is not always 
received so it can happen that gconfd-2 survives the 
X server. 

This is not a big deal if you are running gnome on
a single server because gconfd-2 can be reused by 
your next gnome session.

On the other hand, this is problematic on systems
with multiple servers because the lock created by 
gconfd-2 prevents gnome to be started on another 
server.

One method I know to let gconfd-2 survive the X 
server is to kill it with 'gconftool-2 --shutdown'
and then restart it with 'gconftool-2 --spawn'.
Comment 1 Havoc Pennington 2002-10-31 20:13:34 UTC
It should be dying after a short timeout, if no applications are using it.
Comment 2 Stephane Chauveau 2002-11-01 07:08:33 UTC
I also saw that in the code. That probably solve my problem
except that I have to educate the users to wait a few minutes
before re-logging.

Also, the 2 minutes timeout will only work if all clients are 
killed with the X server. You can't assume that peoples will
not be using gconf in non graphical application that may 
survive the X session. It can also happen that an X application
survives the X session (after a crash, in a VNC session, ...).

My first idea was to 'gconftool-2 --shutdown' immediatly after
gnome-session but I noticed that gnome-session does not kill all
gcond clients when it dies. Is gconftool-2 --shutdown safe then? 
I am afraid that such approach could be worse that letting gconfd
die by itself because if a gconf client is still running after
the --shutdown but before the X server dies, then the client may 
just --spawn a new gconfd-2 instance to save its state. In this 
case you get a full 2 minutes timeout.

A possible solution could be to start all gconfd-2 on
a dedicated server. 

Enabling network socket should also work except that those 
daemons running all over the place are a nightmare for the 
sysadmin: can't reboot server A because it runs gconfd-2 for
the gnome session of Bob on server B. That will happen all the
time when you ask people to quit server B before reboot. 
People will logout and immediatly login on server A without
waiting for the 2m timeout.






Comment 3 Havoc Pennington 2002-11-01 15:08:03 UTC
A --shutdown after logout should be fairly safe, it will just get
restarted next time someone tries to use it; if no one is using it on
the logout machine, then it should restart on a different machine.
Truth be known "killall gconfd-2" is reasonably safe as well.

On Red Hat Linux 8 you can also try the experimental GCONF_LOCAL_LOCKS
patch described on http://www.gnome.org/projects/gconf/

Shortening the timeout to say 15 seconds might be pretty sane as well.
In fact I thought I'd already cut it to 30 seconds, maybe that's just 
in CVS.
Comment 4 Havoc Pennington 2003-03-06 04:50:44 UTC
*** Bug 97651 has been marked as a duplicate of this bug. ***
Comment 5 Havoc Pennington 2003-10-22 18:41:56 UTC
*** Bug 108639 has been marked as a duplicate of this bug. ***
Comment 6 Havoc Pennington 2003-10-22 20:47:37 UTC
I changed the timeout to 30 seconds in CVS, but it's probably sort of
a performance hit; it pings every gconf-using app on the desktop every
30 seconds. So a better solution would be good.
Comment 7 W. Michael Petullo 2003-10-31 17:21:58 UTC
Created attachment 21099 [details] [review]
Simple patch that causes gnome-session to shutdown gconfd-2 processes when a user logs out.
Comment 8 W. Michael Petullo 2003-10-31 17:24:35 UTC
This bug still exists in gconfd-2 2.4.0.  As documented in bug #97651,
this bug also causes problems with unmounting remote home directories.
Comment 9 Havoc Pennington 2003-11-01 15:09:08 UTC
Mark - see this gnome-session patch.
Comment 10 W. Michael Petullo 2003-11-02 18:39:46 UTC
Created attachment 21135 [details] [review]
Simple patch that causes gnome-session to shutdown gconfd-2 /and/ bonobo-activation-server processes when a user logs out.
Comment 11 W. Michael Petullo 2003-11-03 20:03:38 UTC
Created attachment 21167 [details] [review]
Same patch, but uses execvp/waitpid instead of gnome_execute_async.
Comment 12 Havoc Pennington 2003-11-05 15:17:52 UTC
What's the problem you're trying to solve using execvp() directly?

The function you _really_ want is probably g_spawn_async() (or even
the synchronous one, to avoid a race condition on the homedir unmount).
Comment 13 Mark McLoughlin 2003-12-02 16:49:47 UTC
I've committed a patch similar to this on gnome-session HEAD.

Note, I've gone with a synchronous shutdown even though I'm worried
about logout hanging because of random problems ... if we see problems
like this we should switch back to async.

Also, I haven't included the bonobo-activation shutdown bit, because
I don't see how that affects the home dir and because it requires
much more though. gconftool-2 --shutdown is safe ... bonobo-slay
certainly isn't.
Comment 14 Mark McLoughlin 2003-12-02 16:50:16 UTC
Created attachment 22019 [details] [review]
patch which I committed
Comment 15 W. Michael Petullo 2004-02-17 18:07:13 UTC
This bug still exists in gnome-session-2.5.3 and GConf2-2.5.1.  Though
gconfd-2 is shut down correctly, the following processes are not:

bonobo-activation-server remains with $HOME as its CWD (libbonobo)
gnome-vfs-daemon remains with $HOME as its CWD (gnome-vfs2)
mapping-daemon (sometimes) remains with $HOME as its CWD
(nautilus-cd-burner)

These problems continue to cause unmounting $HOME difficult.

Perhaps this bug should be filed under another package? 
Gnome-session?  Or maybe split it into individual bug reports for
libbonobo, gnome-vfs2 and nautilus-cd-burner?
Comment 16 Mark McLoughlin 2004-02-17 18:53:17 UTC
Yes, please open new bugs for each process which is causing problems.
Easier to track progress that way. Thanks ...