From unknown Fri Mar 29 16:43:12 2024 X-Loop: owner@bugs.x2go.org Subject: Bug#968: x2go runs "bash -c bash -c ..." on session create, causing dot bashrc issues Reply-To: Maarten Boekhold , 968@bugs.x2go.org Resent-From: Maarten Boekhold Resent-To: x2go-dev@lists.x2go.org Resent-CC: X2Go Developers X-Loop: owner@bugs.x2go.org Resent-Date: Sun, 22 Nov 2015 16:00:02 +0000 Resent-Message-ID: Resent-Sender: owner@bugs.x2go.org X-X2Go-PR-Message: report 968 X-X2Go-PR-Package: x2goserver X-X2Go-PR-Keywords: Received: via spool by submit@bugs.x2go.org id=B.144820781220857 (code B); Sun, 22 Nov 2015 16:00:02 +0000 Received: (at submit) by bugs.x2go.org; 22 Nov 2015 15:56:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham version=3.3.2 X-Greylist: delayed 300 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Sun, 22 Nov 2015 16:56:50 CET Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id D610A5DA4F for ; Sun, 22 Nov 2015 16:56:50 +0100 (CET) Received: from [192.168.70.138] ([94.207.152.128]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MIiHs-1a2jr31Qds-002ER2 for ; Sun, 22 Nov 2015 16:51:49 +0100 To: submit@bugs.x2go.org From: Maarten Boekhold Message-ID: <5651E494.1010605@gmx.com> Date: Sun, 22 Nov 2015 19:51:48 +0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:O1xpN5Q8jNhS5s7UhbmpiM7tk+e55KIFGUAJzZ9/kayNl1jYoFh XDWISwfGK4qby4NiH97UIGdG9INy8fceZRJelKglRY98SfoTp5yjgKS7CcqLuVzCMbQ66va TpbheER44EjR+zDWoIU+1HmgMhcfLBh+C8azO395A25zg2qBK+uFnBFSFSXebNXUKKNFYBU gpPT/+qlcfSC/UFxkWWtA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Nl5IcRG++fY=:Qci5XwQGaZlqBuUEtoEQmc WqNTUuaPL3I+ZifolAA6XECZtKL0ycXAhulyfICKHZRxUClPID0nT1jGtS2nMg69iBcOqhmWR SNi2onMuYNsa1Z7PCxw+fjldgX3c7McBfhE0hVl56QzGZvaTLr+FBMPs4ru522LITvTXiscIV lzCQI29ctJ5uKOPXYhSc/F3m6ejroDC6IjG93hNEK210F9yKPTCAdFeUhOUBzO8aaCyEZfUUu zGZxr0IfA9aGq/5S9maO8hLsQtK3VZs4iTimTOGVgVXnJ9bm0i5hj/yDN1C1zCmvVB6+iogTZ QbIBJ2lPm7JveqZwWrPaLakZfQu20fkUOv68AclDQ2U69yDpLwz5nS7lshu1014LGPidQu0fh Pl9IoENqnenpm4fOeD04BpiCubBFDdq1hWGLAZC6cW+pWqfKs1kL1jEqhYD2LKaam+LPpzYtG sBDY68kekMbMh6bC4fgy4p2j6E4BTUUb8BQLJxso+x/o6e/v2ZQtUyO4VhIeQtA1ZEM+a7uPY 3b0bytxqns9Vr/yItorUzFhJNom4YzXg/HgpwcexlFmhCSp2EdrE1tAzU/vKsxSnGQrb0xPX+ QmjMHL2uBBWYKoZkqVPEY9KEjW4ldFeA4dAYcRwuUi9odk7hvzVgu9ylQb/CcckAzjepvZumh 5b4L2EwUPLy7UoniToOOBvJ2vKwPKuF1+nWcVTB5NXThcCkQ5GkeKg5QXJP1oQasuOzQGAfL3 EbvmwoMBH5dKMGcOvK3Afl5Yicv7BBluDzL40KflddJLETnyhVn7MIwCEkie1yyoucVmZ0/eW Ci3PBUi 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