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

Found in version

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1434; Package x2goserver. (Sat, 25 Jan 2020 04:20:03 GMT) (full text, mbox, link).

Acknowledgement sent to Orion Poplawski <orion@nwra.com>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Sat, 25 Jan 2020 04:20:03 GMT) (full text, mbox, link).

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

From: Orion Poplawski <orion@nwra.com>
To: submit@bugs.x2go.org
Subject: Use login shell for session
Date: Fri, 24 Jan 2020 21:19:03 -0700
[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: Thu Jan 20 20:58:02 2022; 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.