Closed dcommander closed 8 years ago
Update: This happens in Ubuntu as well, due to some code in /etc/X11/Xsession.d/90x11-common_ssh-agent:
STARTSSH=
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS=
if has_option use-ssh-agent; then
if [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \
&& [ -z "$SSH2_AUTH_SOCK" ]; then
STARTSSH=yes
if [ -f /usr/bin/ssh-add1 ] && cmp -s $SSHAGENT /usr/bin/ssh-agent2; then
# use ssh-agent2's ssh-agent1 compatibility mode
SSHAGENTARGS=-1
fi
fi
fi
if [ -n "$STARTSSH" ]; then
STARTUP="$SSHAGENT $SSHAGENTARGS ${TMPDIR:+env TMPDIR=$TMPDIR} $STARTUP"
fi
This is basically doing the same thing as under RHEL/CentOS/Fedora. If there is no active ssh-agent session, then SSH_AUTH_SOCK
will be unset, thus causing the xinit machinery to launch the WM using ssh-agent, thus clobbering LD_PRELOAD
.
Under RHEL and Fedora, /etc/X11/xinit/xinitrc-common includes the following code:
RHEL 4-7:
Fedora 22, 24 (possibly earlier releases as well):
If the
SSH_AGENT_PID
environment variable is blank, then effectively this code causes the window manager to be launched with ssh-agent, and ssh-agent clobbers theLD_PRELOAD
environment variable set by VirtualGL. This was only recently discovered, because I run keychain on all of my development and testing machines, and keychain setsSSH_AGENT_PID
, thus working around this issue.The issue can be reproduced in isolation thusly:
DESKTOP="GNOME"
in /etc/sysconfig/desktop (otherwise it will run GNOME 3 Classic.)/opt/TurboVNC/bin/vncserver -3dwm
DISPLAY=:1 vglrun /usr/bin/ssh-agent /opt/VirtualGL/bin/glxspheres64
This produces a very similar failure to the one that is produced by attempting to run GNOME 3 in VirtualGL without the
SSH_AGENT_PID
environment variable set:However, if you swap "vglrun" and "/usr/bin/ssh-agent", it works. Setting
SSH_AGENT_PID
to some fake value is probably not a good idea, since other applications may try to actually use that value. It makes more sense for xstartup.turbovnc to handle this somehow. I'm looking into that.Known workarounds:
Modify xstartup.turbovnc so that it executes the WM using VirtualGL and ssh-agent in the right order:
NOTE: do not pass
-3dwm
to vncserver if you do this.