Defindit Docs and Howto Home

This page last modified: Jun 12 2006
keywords:kde,thunderbird,firefox,web,browser,launch,email,url,html,http,link,location,desktop,config,configuration,restart,gnome,gconf,gconfd
description:Diagnosing and solving a small configuration problem with KDE and gconfd.
title:gconfd error fix and mini howto

Date of problem: June 12, 2006


Problem
-------

Clicking a link in an email results in this error (in a
dialog box with no identifying information) 

Error showing url: There was an error launching the 
default action command associated with this location.

KDE, Thunderbird, and Firefox under Fedora Core 5. The KDE Control
Center, KDE Components, Component Chooser, says that the Web Browser
is "firefox %s". Firefox works fine, and Thunderbird works fine
otherwise.

(As an aside, I no longer run Gnome because it has become bloated,
seems to have fewer features than KDE, and generally irritates
me. Some of my favorite features are either missing from Gnome or so
difficult to find that I simply gave up.)


Diagnosis
---------

While the dialog box was on the screen (before I clicked "OK"), I ran a terminal window and
the command:

ps aux

In the listing I found these lines (ps truncates very long commands,
so these lines are truncated):

twl8n    14414  0.0  0.0   2256   940 pts/0    S    10:03   0:00 /bin/bash /usr/lib/thunderbird-1.0.8/open-browser.sh http://
twl8n    14419  0.1  0.6  11860  6488 pts/0    S    10:03   0:00 /usr/bin/zenity --error --text=Error showing url: There was

In the same terminal window, I used less to look at the shell script
/usr/lib/thunderbird-1.0.8/open-browser.sh

less /usr/lib/thunderbird-1.0.8/open-browser.sh

In that script I found the line:

GCONF=$(gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null | sed -e 's/%s//; s/\"\"//; s/^\ *//; s/\ *$//')

With my many years of experience and vast Linux knowledge, it was
clear to me that the important command to run was this:

gconftool-2 -g /desktop/gnome/url-handlers/http/command

Sure enough, this command gave the expect (although undesirable) response:

/usr/local/firefox/firefox %s

This is bad because there is no firefox in /usr/local. Since I long
ago noted that there is a .gconf directory in my home directory, I
started down the directory tree with less and tab complete, until I
found a file that seemed to be related to http. You could use find and
grep:

find .gconf/ | grep http

The result is:

.gconf/desktop/gnome/url-handlers/http
.gconf/desktop/gnome/url-handlers/http/%gconf.xml
.gconf/desktop/gnome/url-handlers/https
.gconf/desktop/gnome/url-handlers/https/%gconf.xml

The file with the problem is:

.gconf/desktop/gnome/url-handlers/http/%gconf.xml

(As another aside, inquiring minds may wonder why a file name begins
with %. Part of me wants to know, and part of me never wants to just
put this whole gconfd mess behind me. A non-alphanumeric,
non-underscore, non-dot character in a file name is one of the more
unconventional things I've seen.)


Solution
--------

Happily, many XML files are editable by humans. I just fired up my
favorite text editor, and fixed the errant config value. There may be
a graphical editor for gconf, but I'm not inclined to spend 30 minutes
trying to read through poorly written, arcane Gnome documentation and
web pages to find the mystical Gnome gconf GUI.

emacs .gconf/desktop/gnome/url-handlers/http/%gconf.xml 

Sure enough, the config value is messed up. This is the problem line:

<stringvalue>/usr/local/firefox/firefox %s</stringvalue>

I changed it to:

<stringvalue>firefox %s</stringvalue>

By leaving out the path, I assume that my $PATH environment variable
will be used, and where ever firefox exists, it will be run. This
turns out to be true, but gconf has one more obstacle.

Gconf values are cached. Gconf reads all the config values, and some
daemon keeps everything in memory (or something). Some hints seemed to
indicate that sending a SIGHUP to the daemon would refresh the
values. This didn't work (see Footnote 1 below). Apparently the
caching mechanism isn't quite standard (or to my way of thinking, the
mechanism is obscure and irritating). It may be that gconf doesn't
quite work as expected with KDE. Finding the solution required another
Google search, where I discovered this command:

gconftool-2 --shutdown

The URL is:

http://www.gnome.org/projects/gconf/

and the information is about 1/3 down the page. Please note two
unusual aspects 

1) --shutdown stops and restarts gconftool-2.
2) the program name has hyphen, and ends in a digit. 

Both of these aspects are odd and geeky, and seem to typify Gnome (and
admittedly much of the Linux world).

After restarting gconftool (or whatever it actually restarted), the
command:

gconftool-2 -g /desktop/gnome/url-handlers/http/command

gave the desired result:

firefox %s

Now clicking a URL in a message in Thunderbird opens that URL in
Firefox. I did restart Thunderbird, but I suspect that wasn't
necessary.



Footnote 1
----------

[twl8n@tull ~]$ ps aux | grep confd
twl8n    14611  0.0  0.2   3640  2096 pts/3    S    10:17   0:00 /usr/libexec/gconfd-2 4
twl8n    14871  0.0  0.0   1688   504 pts/3    S+   10:53   0:00 grep confd
[twl8n@tull ~]$

The command:

kill -HUP 14611

did not cause gconf to update its url-handler value. The command that
worked was:

gconftool-2 --shutdown