[X2Go-Dev] Bug#968: x2go runs "bash -c bash -c ..." on session create, causing dot bashrc issues

Maarten Boekhold boekhold at gmx.com
Sun Nov 22 16:51:48 CET 2015


Package: x2goserver
Version: 4.0.1.19

When establishing a new x2go session, I noticed that my .bashrc file is 
read/sourced/executed many times, in the end screwing up my PATH and 
LD_LIBRARY_PATH settings (amongst others). I was surprised, because 
.bashrc is only supposed to be read when opening an interactive shell, 
and I am not expecting x2go to run interactive shells here.

I did some debugging by placing the following at the start of my .bashrc:

     echo "bashrc" >> ~/slog
     ps -fea | grep boekhold >> ~/slog

and based on this I can see x2go constantly running commands like:

     bash -c bash -c 'echo 
"X2GODATABEGIN:60b25f89-31db-46ec-8a7c-c93002fbfa50"; export 
PATH="/usr/local/bin:/usr/bin:/bin"; export HOSTNAME && x2golist

still at first glance no reason for bash to process .bashrc. However, 
further testing:

     boekhold at xbmc:~$ rm slog
     rm: cannot remove ‘slog’: No such file or directory
     boekhold at xbmc:~$ bash -c date
     Sun Nov 22 19:39:09 GST 2015
     boekhold at xbmc:~$ cat slog
     cat: slog: No such file or directory
     boekhold at xbmc:~$ bash -c bash -c date
     boekhold at xbmc:~$ cat slog
     bashrc
     boekhold  1147     1  1 Nov21 ?        00:20:20 .....
     .....

See there? Running "bash -c bash -c" suddenly tricks bash into reading 
the .bashrc file. No idea how, but it happens.

This is on Linux Mint 17.2, but I'm experiencing the same issue on a 
Centos 7 system with the x2go EPEL packages. Client is x2goclient on 
Windows 7 Professional SP1.

I can't figure out where that "bash -c bash -c" command is being 
generated, hope that somebody from the X2Go team can provide some 
guidance here?

Maarten


More information about the x2go-dev mailing list