Subject: x2go runs "bash -c bash -c ..." on session create, causing dot bashrc issues

From: Maarten Boekhold <[email-masked]>
Date: Sun, 22 Nov 2015 19:51:48 +0400

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@xbmc:~$ rm slog
     rm: cannot remove ‘slog’: No such file or directory
     boekhold@xbmc:~$ bash -c date
     Sun Nov 22 19:39:09 GST 2015
     boekhold@xbmc:~$ cat slog
     cat: slog: No such file or directory
     boekhold@xbmc:~$ bash -c bash -c date
     boekhold@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

---

From: Mihai Moldovan <[email-masked]>
Date: Sun, 14 Aug 2016 00:34:04 +0200

Control: reassign -1 x2goclient 4.0.5.0
Control: tag -1 moreinfo

Is this a problem with the current client version?

.bashrc should still be executed, but probably not more than once per command.

Mihai