Bug 1794660 - problem with default shell in xfce when using x2goclient
Summary: problem with default shell in xfce when using x2goclient
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: x2goclient
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-24 09:24 UTC by Jos de Kloe
Modified: 2024-03-25 07:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 20:21:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jos de Kloe 2020-01-24 09:24:42 UTC
Description of problem:

It seems the default shell is not activated when starting a terminal session within xfce when working remotely using x2go. Something seems wrong in the startup procedure, at least for my specific usecase.

Details:

* I am using a remote xfce4 desktop using x2go
* my default shell is tcsh
* I have no $HOME/.xfcerc file
* the problem persists even if I go to text mode and  remove the $HOME/.config/xfce folder

The problem is that my terminals do not use the default tcsh when I open them. It is not just the xfce4-terminal, but it happens in other terminal types
as well (tested with konsole and mate-terminal as well).

The reason is displayed in $HOME/.xsession-x2go-$MACHINENAME-errors

This command: head -2 $HOME/.xsession-x2go-$MACHINENAME-errors
gives me:

XSession-x2go: X session started for $USER at do 23 jan 2020 10:28:20 MET
/usr/share/Modules/init/tcsh: eval: line 3: syntax error near unexpected token `alias'
/usr/share/Modules/init/tcsh: eval: line 3: `if ( $?histchars && $?prompt ) alias module 'set _histchars = $histchars; unset histchars; set _prompt=$prompt:q; s
et prompt=""; eval "`/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh \!*:q`"; set _exit="$status"; set histchars = $_histchars; unset _histchars; s
et prompt=$_prompt:q; unset _prompt; test 0 = $_exit' ;'
/usr/share/Modules/init/tcsh: line 15: syntax error near unexpected token `alias'
...

so to me it seams this
"/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl tcsh"
call generates a piece of tcsh script, but then the system tries
to use bash to execute it.

Version-Release number of selected component (if applicable):

This combination gives me the problem:

remote versions:
xfce4-session-4.14.0-1.fc30.x86_64
x2goserver-4.1.0.3-3.fc30.x86_64
environment-modules-4.2.4-1.fc30.x86_64

local versions:
x2goclient-4.1.2.1-5.fc31.x86_64

How reproducible:

always

Steps to Reproduce:
1. connect to the remove system using x2go
2. start a fresh xfce desktop session
3. open any terminal window

Actual results:

the terminal uses /bin/bash as shell

Expected results:

the default shell for the users, in my case /bin/tcsh, should be used.

Additional info:

the problem does not occur if I start a local xfce session. Tested this both on my local and on the remote system. Details:

a local test with fedora 31 on my laptop did not reproduce the problem.
Versions:
xfce4-session-4.14.0-1.fc31.x86_64
environment-modules-4.3.0-1.fc31.x86_64

a local test with fedora 30 at my remote system did not reproduce the problem.
xfce4-session-4.14.0-1.fc30.x86_64
environment-modules-4.2.4-1.fc30.x86_64

so clearly the problem is in xfce or the interaction between x2go, xfce and the startup scripts in environment-modules.

Comment 1 Orion Poplawski 2020-01-25 04:28:01 UTC
There are a number of things interacting here, namely:

- x2go launches everything with bash to have a consistent scripting language
- Fedora sets SHELL=/bin/bash via (sometimes ~/.bash_profile ->) ~/.bashrc -> /etc/bashrc
- /etc/x2go/Xsession launches the session with a login shell using $SHELL
- With SHELL set, xfce4-teminal uses that for new terminals

One workaround is to remove (or move) your ~/.bash_profile and ~/.bashrc files - but this will hobble bash if you ever do use it for a terminal shell.  But the session is still launched with bash which still leads to the module errors you reported (though these I think are more symptom than cause).

This is the patch I've proposed to upstream (this gets installed as /etc/x2go/Xsession):

diff --git a/x2goserver-xsession/etc/Xsession b/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
 fi
 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

--
1.8.3.1

and reported here: https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=1434

Comment 2 Ben Cotton 2020-11-03 16:14:13 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Ben Cotton 2020-11-24 20:21:50 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Jos de Kloe 2024-03-25 07:11:38 UTC
Just for the record, I am happy to report that this issue is now solved after upgrading the system running x2goserver to Fedora 39.


Note You need to log in before you can comment on or make changes to this bug.