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 571781 - gnome-keyring-daemon's output cannot be sourced anymore
gnome-keyring-daemon's output cannot be sourced anymore
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
2.25.x
Other All
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-02-14 20:54 UTC by Daniel Hahler
Modified: 2009-02-14 22:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Close stdin and stdout when running in background (not just daemon) (1.71 KB, patch)
2009-02-14 22:48 UTC, Stef Walter
committed Details | Review

Description Daniel Hahler 2009-02-14 20:54:52 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
Comment 1 Stef Walter 2009-02-14 22:23:52 UTC
Whoops, like a regression. I'll look into it.
Comment 2 Stef Walter 2009-02-14 22:47:33 UTC
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.
Comment 3 Stef Walter 2009-02-14 22:48:21 UTC
Created attachment 128738 [details] [review]
Close stdin and stdout when running in background (not just daemon)