Red Hat Bugzilla – Bug 159624
startx failed to start ssh-agent
Last modified: 2014-06-18 05:07:45 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4
Description of problem:
Regression from Fedora Core 2 (possibly 3 as well):
I boot my machine into runlevel 3, and then start X manually using "startx". Under FC2, ssh-agent would be started. Under FC4, it is not.
grepping through the packages, it appears that xdm/gdm/kdm start ssh-agent, but someone forgot to update the startx path to do the same.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Edit /etc/inittab to start at runlevel 3.
3. Run startx.
4. Attempt to run ssh-add.
Actual Results: ssh-add fails, because ssh-agent is not running.
Expected Results: ssh-add succeeds, because ssh-agent is running.
It's a regression from 3. I'm seeing it with 4 as well
/etc/X11/xinit/xinitrc-common used to start ssh-agent (pre-FC4)
Now (in FC4) it sets the SSH_AGENT environment variable, and other scripts
should to the right thing.
For xdm logins, /etc/X11/xdm/Xsessions does the right thing and runs $SSH_AGENT.
However /etc/X11/xinit/xinitrc needs to be updated - something like:
if [ -f $HOME/.Xclients ]; then
exec $SSH_AGENT $DBUS_LAUNCH $HOME/.Xclients || \
exec $SSH_AGENT $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec $SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
exec $SSH_AGENT /etc/X11/xinit/Xclients
# failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &
if [ -x /usr/X11R6/bin/twm ]; then
exec $SSH_AGENT /usr/X11R6/bin/twm
I'm presuming that the change was made to solve the problem which existed in
earlier versions that an ssh-agent was started by "startx" but that agent wasn't
killed when X exited - so one could end up with many ssh-agent processes running.
>I'm presuming that the change was made to solve the problem which existed
>in earlier versions that an ssh-agent was started by "startx" but that agent
>wasn't killed when X exited - so one could end up with many ssh-agent processes
I believe this is correct. If someone has an idea how to solve both
problems, and also provide both levels of functionality, feel free to
suggest ideas for review.
If this problem still exists in FC5, please reopen.
Still broken in FC5
Add to FC6Destop tracker
so the ssh-agent man page says:
"If a commandline is given, this is executed as a subprocess of the agent.
When the command dies, so does the agent."
If it didn't behave that way, then the GDM case would have the same problem. We
should just fix it with the proposed fix.
*** This bug has been marked as a duplicate of 169259 ***