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 617017 - GConf changes needed for GDM
GConf changes needed for GDM
Status: RESOLVED WONTFIX
Product: GConf
Classification: Deprecated
Component: gconf
2.31.x
Other Solaris
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
gnome[unmaintained]
Depends on:
Blocks: 594818
 
 
Reported: 2010-04-27 23:38 UTC by Brian Cameron
Modified: 2018-08-17 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pkg-config diff file (447 bytes, patch)
2010-04-27 23:38 UTC, Brian Cameron
none Details | Review
patch adding GCONF_DISABLE_DEFAULT (1.03 KB, patch)
2010-04-27 23:39 UTC, Brian Cameron
rejected Details | Review
Patch to make GConf use per-session saved-state files. (2.29 KB, patch)
2010-04-29 02:07 UTC, Brian Cameron
needs-work Details | Review
Nicer pkg-config patch (773 bytes, patch)
2010-04-29 02:09 UTC, Brian Cameron
committed Details | Review

Description Brian Cameron 2010-04-27 23:38:20 UTC
Created attachment 159735 [details] [review]
pkg-config diff file

Let me explain how GDM uses GConf since it is a real corner case.  Although normally GDM only runs a single login GUI for the main console, it can run multiple simultaneous login GUI's (e.g. if one user is on the console, and other users via XDMCP or Xvnc).  GDM starts a separate D-Bus session bus for each login GUI so this caues each greeter to get a separate gconfd daemon.

With GDM 2.30.1 there is a problem that if the user turns on an AT program in one GDM login GUI window, it launches for them all since the boolean keys to trigger this are stored in GConf.  Likewise if one user kills the AT program, it dies on them all.  This is obviously a problem, very confusing behavior, and a serious issue for users with disabilities.

So, I have been working for the past several weeks to fix this problem and I have discovered a few things about how GConf works.  I have been able to figure out how to get this working better via two mechanisms, but both require a change to GConf.  In fact, both of my proposed patches may be sensible for GConf to adopt.

So, to separate each GDM login GUI to a separate GConf directory I create a ~gdm/.gconf.path file with this entry:

xml:readwrite:$(HOME)/$(ENV_GDM_SEAT_ID)/.gconf

Using $HOME/.gconf.path ensures that this readwrite directory gets assigned
before the $HOME/.gconf setting in the /etc/gconf/2/path, so this is used.

Also I make sure that I set the GDM_SEAT_ID environment variable to a unique per-session string for each display and set GCONF_DEFAULT_SOURCE_PATH to "/etc/gconf/path/2".  The GDM slave daemon first launches D-Bus and then launches gnome-session.  I make sure to only set these environment variables before running gnome-session and not when starting D-Bus.  Note that the session D-Bus launches gconfd, so avoiding setting these environment variables when starting D-Bus ensures that these are not set for the gconfd process for each display, but are set for all clients.

If I do this, then things works well, and each login GUI has a separate $HOME/$(ENV_GDM_SEAT_ID)/.gconf directory, and launching or exiting AT programs only affects the display where the user made the request.

However, "/etc/gconf/path/2" is not an exposed interface by GConf.  My first patch adds "gconf_defaultpath" to the pc file, so that GDM can refer to it in its configure script and ensure that it points to the right default path file.  Since this is an exposed interface that users or other modules should be able to reference if desired, I think this is good to expose and a good patch to go upstream.

I notice that things do not work in two cases:

1) If I do not set GCONF_DEFAULT_SOURCE_PATH for the clients.
2) If the D-Bus session bus process is launched with GDM_SEAT_ID set to the
   same value as for the client.

If either case is true, then launching or exiting an AT program on one display causes the AT programs to launch or exit on all displays.  At first this confused me since each login GUI has a separate gconfd process and one would think they would not know about each other's configuration.

Digging into the GConf code (and with Ray Strode's help), I discovered that this is caused because gconfd treats its "default" path special.  Changes get stored in the common $HOME/.gconfd/saved_state file with entries like this:

ADD 117440623 "def" (cryptic stuff)

So, if the change is in the default path, all gconfd daemons pick up the change.
My second patch adds an environment variable trigger GCONF_DISABLE_DEFAULT which turns off gconfd's usage of the saved_state cache.  With this change, it is possible to make GDM work without needing to set GCONF_DEFAULT_SOURCE_PATH at all.  Instead it is just necessary to set this environment variable to a value and things just work.  I think this is a useful feature for corner-cases like this GDM usage and it avoids GDM needing to set GCONF_DEFAULT_SOURCE_PATH to the default path file, which seems a bit weird and seems a cleaner way to fix this issue.

So, I would actually like to propose that both patches go into GConf, though either one will allow GDM to fix this serious accessibility problem.  Can one or both of these patches go upstream so the GDM issue can be fixed?
Comment 1 Brian Cameron 2010-04-27 23:39:14 UTC
Created attachment 159737 [details] [review]
patch adding GCONF_DISABLE_DEFAULT
Comment 2 Brian Cameron 2010-04-29 02:07:30 UTC
Created attachment 159844 [details] [review]
Patch to make GConf use per-session saved-state files.

Here is a nicer patch for modifying the pkg-config file which does not expose sysconfdir or with_sysconfsubdir, and only exposes gconf_defaultpath.

In talking with Ray Strode, he suggested that my 2nd patch may not be the right solution.  Adding an environment variable to disable accessing the "def" entries in the saved_state file is a bit of a hack, he suggests.  Instead, he thinks that gconfd should save a separate saved_state file per-session.  Ray provided me with a test patch that forces gconfd to use separate per-session saved_state files, and this also fixes the issue.

I'll let Ray comment more about how he thinks that the issue should be fixed.  But, for now, if we can get the pkg-config file change upstream then we can use GCONF_DEFAULT_SOURCE_PATH in GDM to make GDM work for now.  Then, later, if we address the problem with the GConf saved-state file, we can modify GDM to reflect this (e.g. it won't need to set GCONF_DEFAULT_SOURCE_PATH anymore).
Comment 3 Brian Cameron 2010-04-29 02:09:12 UTC
Created attachment 159845 [details] [review]
Nicer pkg-config patch

Oops my last patch was the patch Ray provided me which makes gconfd save separate per-session saved_state files.  Here is the diff file for the pkg-config file.
Comment 4 Ray Strode [halfline] 2010-04-29 03:16:23 UTC
Comment on attachment 159844 [details] [review]
Patch to make GConf use per-session saved-state files.

This patch doesn't properly manage clean up of the saved_state files.
Comment 5 Ray Strode [halfline] 2010-04-29 03:17:10 UTC
Comment on attachment 159845 [details] [review]
Nicer pkg-config patch

this patch is fine.
Comment 6 Ray Strode [halfline] 2010-04-29 03:18:24 UTC
Comment on attachment 159737 [details] [review]
patch adding GCONF_DISABLE_DEFAULT

this patch is incomplete and is messes the broader issue of multiple gconfds munching on the same saved_state file at the same time.
Comment 7 Brian Cameron 2010-05-11 22:15:18 UTC
The patch for comment #3 is now upstream.

However, leaving this bug open since really GConf should be fixed to use a separate saved_state file for each session.
Comment 8 André Klapper 2018-08-17 13:54:46 UTC
GConf has been deprecated since 2011.

GConf is not under active development anymore. Its codebase has been archived:
https://gitlab.gnome.org/Archive/gconf/commits/master

dconf and gsettings are its successors. See https://developer.gnome.org/gio/stable/ch34.html and https://developer.gnome.org/GSettings/ for porting info.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of dconf/gsettings. Thanks!