GNOME Bugzilla – Bug 571781
gnome-keyring-daemon's output cannot be sourced anymore
Last modified: 2009-02-14 22:48:21 UTC
Please describe the problem: A change in the behavior of gnome-keyring-daemon caused a stalled startkde on my system. I have the following file: $ cat ~/.kde/env/start-custom.sh #!/bin/sh eval `gnome-keyring-daemon` export GNOME_KEYRING_PID export GNOME_KEYRING_SOCKET This used to work and was meant to provide interoperability with the gnome-keyring-daemon under KDE. However with 2.25.4.1-0ubuntu1, this fails as follow: $ `gnome-keyring-daemon` ** Message: another SSH agent is running at: /tmp/keyring-xF7mcu/ssh ** Message: another gnome-keyring-daemon is running ** Message: couldn't set environment variable in session: Setenv interface is only available during the Initialization phase Then, the process does not exit, but hangs. I don't know how to debug this further, since running "gnome-keyring-daemon" without letting the result get sourced (through the use of backticks around it), it exits. Also, since "gnome-keyring-daemon|xargs -n1 echo" fails/hangs in the same way I suspect that the behavior change is caused/triggered when its output gets redirected somehow. You can see that it's a quite common method to add such a start script, by searching for it on Google: http://www.google.com/search?q=eval+`gnome-keyring-daemon`+export Steps to reproduce: 1. In a shell, type $(gnome-keyring-daemon) Actual results: The program does not return, but hangs. Expected results: The program should return. Does this happen every time? yes. Other information: Bug reported in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/316070
Whoops, like a regression. I'll look into it.
Thanks for catching the problem. I've pushed a fix for this to SVN head. Will attach patch if you're interested in patching your system. Startup and general running of gnome-keyring-daemon is further documented here (although that's more for packagers and distros): http://live.gnome.org/GnomeKeyring/RunningDaemon I'm not super familiar with your use case, but perhaps some additions to that page could be made to cover it.
Created attachment 128738 [details] [review] Close stdin and stdout when running in background (not just daemon)