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 664921 - installing schemas with makefile rule only installs them for root
installing schemas with makefile rule only installs them for root
Status: RESOLVED DUPLICATE of bug 328697
Product: GConf
Classification: Deprecated
Component: gconf
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-27 17:04 UTC by Philip Chimento
Modified: 2013-01-05 22:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Chimento 2011-11-27 17:04:35 UTC
I'm trying to chase down a problem with installing a GConf schema in my application, which you can look at for reference on Github:
https://github.com/ptomato/gnome-inform7

What happens is that when doing ./configure - make - sudo make install, the application's GConf schema (gnome-inform7.schemas) is not visible to any user other than root, which causes problems with preferences in the application.

I have the following in Makefile.am:

---
schemadir = @GCONF_SCHEMA_FILE_DIR@
dist_schema_DATA = gnome-inform7.schemas

install-data-local:
	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
	$(GCONFTOOL) --makefile-install-rule $(srcdir)/$(dist_schema_DATA)

uninstall-local:
	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
	$(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(dist_schema_DATA)
---

During the sudo make install run, the schema is installed with the following messages:

---
GCONF_CONFIG_SOURCE=xml:merged:/etc/gconf/gconf.xml.defaults \
/usr/bin/gconftool-2 --makefile-install-rule ./gnome-inform7.schemas
Attached schema `/schemas/apps/gnome-inform7/AppSettings/AuthorName' to key `/apps/gnome-inform7/AppSettings/AuthorName'
Installed schema `/schemas/apps/gnome-inform7/AppSettings/AuthorName' for locale `C'
[...more of these messages for every key in the schema...]
---

But afterwards, I try to find the schema using gconftool-2, and it is only visible if I sudo:

---
$ gconftool-2 --all-dirs /schemas/apps | grep gnome-inform7
$ sudo gconftool-2 --all-dirs /schemas/apps | grep gnome-inform7
 /schemas/apps/gnome-inform7
---

This results in the keys having no default value, which causes problems in the application, as I mentioned.

I imagine that bug #558375 has something to do with this. It is mentioned there that sudo strips the environment, so the DBUS_SESSION_BUS_ADDRESS is trashed while running sudo make install. However, invoking make install like so doesn't install the schema properly either:

sudo env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS make install

This seems to have been the subject of an e-mail to gtk-list last year that nobody ever answered: 
http://mail.gnome.org/archives/gtk-list/2010-July/msg00085.html

This behavior seems to have appeared sometime recently and may be a feature, in which case the bug is that application developers need to have a new Makefile.am recipe for installing schemas, as the current one that's plastered all over the internet doesn't apply anymore.

Migrating to GSettings isn't yet an option since the program needs to run on Debian Stable.
Comment 1 Philip Chimento 2011-11-27 17:11:53 UTC
I can also report that the schema is visible to non-root users after rebooting.
Comment 2 Jan de Groot 2012-11-05 15:47:03 UTC
Your bug is caused by the fact that gconftool-2 touches the system database directly and only reloads the gconfd process for the user that runs the gconftool-2 --makefile-install-rule command.
On Archlinux we've been using a patch borrowed from Fedora for a long while that just killall's all running gconfd-2 processes after running --makefile-install-rule or --makefile-uninstall-rule.
Comment 3 Philip Chimento 2012-11-06 00:26:26 UTC
Great! Do you have an example of this patch being used anywhere that you can link to?
Comment 4 Philip Chimento 2013-01-05 22:18:14 UTC
Actually this looks like a duplicate of #328697, so closing.

For future reference, what I did to solve the problem was add two "killall -HUP gconfd-2" lines to the install-data-local and uninstall-data-local targets in my Makefile.am.

install-data-local:
    GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
    $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(dist_schema_DATA)
    killall -HUP gconfd-2  # Refresh gconfd for all users, not just root
 
uninstall-local:
    GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
    $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(dist_schema_DATA)
    killall -HUP gconfd-2

*** This bug has been marked as a duplicate of bug 328697 ***