Greetings.
I'm trying to troubleshoot a problem where my PATH environment variable isn't getting set correctly when launching a terminal via X2Go. Perhaps this is a problem with the way I have my Bash files set up, but on the other hand it may be an X2Go bug related to Bug 149: <https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=149>.
Anyway, to trace the execution path, I've added logging messages to all the files sourced by Bash. I immediately noticed that whenever I make an X2Go connection, four(!) separate Bash processes are spawned, not including the Bash process launched by the terminal itself. The parents of all four shells are the sshd process.
By contrast, logging in on the console or via SSH results in just a single Bash process.
Why does X2Go cause so many shells to be launched in single-application mode?
Here are some steps to reproduce my logs, in case anyone is interested:
echo $(date) Entering /etc/profile $$ $PPID >>/tmp/login echo $(date) Leaving /etc/profile $$ $PPID >>/tmp/login
touch /tmp/login && chmod 666 /tmp/login
On the X2Go client, configure a connection to the X2Go Server with the "Session type" set to "Single application". For the command, choose /usr/bin/xterm or your favourite terminal emulator. (Note that /usr/bin/gnome-terminal doesn't work due to <https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=900>.) Then launch the connection and examine the logs in /tmp/login. Apart from the shell launched by the terminal emulator, you'll see four different shell processes were already launched -- the process ID and parent process ID are the last two fields of the log file. Examining the output of pstree -p shows that these shell processes are no longer running, and that their parents were all sshd.
Log in to the X2Go server again, this time from the console or via a vanilla SSH connection, and examine the /tmp/login file. This time you'll notice that the only shell process is the one you're in.
Regards, Tristan
Tristan Miller