X2Go Bug report logs - #1434
Use login shell for session

version graph

Package: x2goserver; Maintainer for x2goserver is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goserver is src:x2goserver.

Reported by: Orion Poplawski <orion@nwra.com>

Date: Sat, 25 Jan 2020 04:20:02 UTC

Severity: normal

Tags: patch, pending

Found in version

Fixed in version

Done: X2Go Release Manager X2Go Release Manager <git-admin@x2go.org>

Bug is archived. No further changes may be made.

Full log

Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

Received: (at submit) by bugs.x2go.org; 25 Jan 2020 04:19:25 +0000
From orion@nwra.com  Sat Jan 25 05:19:16 2020
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,SPF_HELO_NONE,
	URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2
Received: from mail.nwra.com (mail.nwra.com [])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id E6C045DA92
	for <submit@bugs.x2go.org>; Sat, 25 Jan 2020 05:19:10 +0100 (CET)
Received: from rufous.cora.nwra.com (inferno.cora.nwra.com [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client did not present a certificate)
	by mail.nwra.com (Postfix) with ESMTPSA id 7A6BA3403CF
	for <submit@bugs.x2go.org>; Fri, 24 Jan 2020 20:19:07 -0800 (PST)
To: submit@bugs.x2go.org
From: Orion Poplawski <orion@nwra.com>
Subject: Use login shell for session
Organization: NorthWest Research Associates
Message-ID: <939f0e9e-602a-0a1b-b8ae-ff992e3a795d@nwra.com>
Date: Fri, 24 Jan 2020 21:19:03 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms010902040105010500010605"
[Message part 1 (text/plain, inline)]
Package: x2goserver
Tags: patch

X2Go's Xsession file always starts the user's session with /bin/bash (at 
least on RedHat systems where SHELL is set to /bin/bash via ~/.bashrc 
calling /etc/bashrc).  This patch attempts to determine the user's login 
shell and use that for launching the session.  See also:


Another option might be the judicious use of the --norc option when 
launching x2goruncommand on followers but I'm not sure what other 
effects this will have or where to do that.  Effects might not be to bad 
because I can simulate this by moving away the user's .bash_profile and 
.bashrc files and then the tcsh is used as expected in this case. 
However, while $SHELL does not get set in this case, the xfce4-session 
script still gets launched with bash which triggers some other errors, 
so this patch may be the best option.

 x2goserver-xsession/etc/Xsession | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/x2goserver-xsession/etc/Xsession 
index 270a0b3..522f37e 100755
--- a/x2goserver-xsession/etc/Xsession
+++ b/x2goserver-xsession/etc/Xsession
@@ -117,6 +117,10 @@ if ! echo "*" >>"$WRITE_TEST"; then
 rm -f "$WRITE_TEST"

+# Determine the users login shell and use that to launch the session
+SHELL=$(getent passwd $LOGNAME | cut -d: -f7)
+# Fallback
+[ -z "$SHELL" ] && SHELL=/bin/bash

 if [ -f /etc/debian_version ] || [ -f /etc/devuan_version ]; then


Orion Poplawski
Manager of NWRA Technical Systems          720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion@nwra.com
Boulder, CO 80301                 https://www.nwra.com/

[smime.p7s (application/pkcs7-signature, attachment)]

Send a report that this bug log contains spam.

X2Go Developers <owner@bugs.x2go.org>. Last modified: Sat Apr 20 09:54:28 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.