[X2Go-User] Why does X2Go spawn so many shells in single-application mode?

Tristan Miller psychonaut at nothingisreal.com
Wed Jul 26 12:27:14 CEST 2017


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:

1. On the X2Go server, add lines such as the following to the
beginning and end of /etc/profile and any other files that normally get
sourced by Bash shells on your system (/etc/bash.bashrc,
~/.bash_profile, ~/.profile, ~/.bashrc, etc.):

echo $(date) Entering /etc/profile $$ $PPID >>/tmp/login
echo $(date) Leaving /etc/profile $$ $PPID >>/tmp/login

2. touch /tmp/login && chmod 666 /tmp/login

3. 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.

4. 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
Free Software developer, ferret herder, logologist
             https://logological.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x2go.org/pipermail/x2go-user/attachments/20170726/a3c4e41e/attachment.sig>


More information about the x2go-user mailing list