I believe this bug was closed prematurely.  It is important to realize
the unusual details of gnome-keyring-daemon, the services it provides,
and its two-stage startup.  Take a look at the documentation:

http://live.gnome.org/GnomeKeyring/RunningDaemon

If you still think it should not be run twice, go back and read the
documentation again.

Contrary to comment #2, it is spawned by PAM only when the user logs in
by typing in a password.  When GDM is configured for automatic or timed
login, gnome-keyring-daemon does not get spawned.  That means auto-login
users will be left with no keyring service unless it gets started
elsewhere.

When gnome-keyring-daemon is spawned by PAM, it is strictly to capture
the user's password for automatic unlocking of the login keyring.  From
the docs: "When run with the --login option, gnome-keyring-daemon does
not fully initialize. It expects to be initialized later by calling
another gnome-keyring-daemon with the --start option."  Yes, it does
need to be run a second time, partly to finish initializing, and partly
so it can print the environment variables that some programs use to find
it.

Keep in mind that gnome-keyring-daemon acts not only as a place to store
secrets, but also as an SSH agent.  Many people prefer it because it
provides better keyring integration and better UI than the classic ssh-
agent program.  In order for ssh and other programs to use it, the X
session startup procedure must capture and export the environment
variables it prints.

For example, running gnome-keyring-daemon --start will finish
initializing and print something like this:

  GNOME_KEYRING_CONTROL=/tmp/keyring-0vbOKZ
  GNOME_KEYRING_PID=1234
  SH_AUTH_SOCK=/tmp/keyring-0vbOKZ/ssh

In order to get full functionality, one of the X session startup scripts
should therefore do something like this:  export `gnome-keyring-daemon
--start`

Quoting from the documentation again:
"""
gnome-keyring-daemon has certain environment variables that must be set in the 
user's session:
    * Each of the above ways of starting gnome-keyring prints out appropriate 
environment variables to stdout.
    * In the case of --login only a few environment variables will be printed. 
A later call to --start will print the remaining environment variables.
    * When used with a modern DBus capable session manager (like gnome-session 
2.24.x and later) gnome-keyring-daemon will register environment variables 
directly with the session manager.
"""

Under GNOME, I believe gnome-keyring-daemon gets its second run via the
*.desktop scripts in /etc/xdg/autostart.  This completes initialization
without capturing the printed environment variables, but since GNOME's
session manager allows those environment variables to be set via D-Bus,
they get exported anyway.  Under Xfce, the session manager lacks the
D-Bus environment variable feature, so running gnome-keyring-daemon a
second time via .desktop files fails to export the environment
variables.  For now, on Xubuntu, it looks like it really does have to be
done in one of the session startup scripts.

When I was using Xubuntu 9.10 (Karmic), I worked around the problem by
putting this in a ~/.xprofile file:

  export `gnome-keyring-daemon --start`

That wasn't a good solution for most end users, but since I'm vaguely
familiar with X startup details, I was able to figure it out.  However,
it broke in Lucid.  It seems the developers recently changed libgnome-
keyring to rely exclusively on D-Bus for communication with the daemon,
ignoring environment variables like GNOME_KEYRING_CONTROL.  Since
~/.xprofile gets run before D-Bus is started, my workaround left me with
a daemon that worked fine for older programs (like ssh), but could not
announce itself on D-Bus and therefore could not be found by newer
programs (like seahorse and nm-applet).

On Xubuntu Lucid, there are only three places I can see where starting
gnome-keyring-daemon could fully initialize it, announce itself on
D-Bus, and capture/export the printed environment variables for use in
the X session.  Those are:

  /usr/share/xubuntu/session.sh
  /usr/bin/startxfce4
  /etc/xdg/xfce4/xinitrc

All of the above scripts are executed in an xubuntu session when
launched by GDM, *after* dbus has started.

In summary, gnome-keyring-daemon could be really useful to Xubuntu
users, but it won't be fully functional until the session startup runs
it in such a way that it can both announce itself on D-Bus and export
all its variables into the session environment.  I hope this can be done
by default soon.  Until then, most users will miss out.

-- 
xfce4-session fails to spawn gnome-keyring-daemon
https://bugs.launchpad.net/bugs/357346
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to