Bug 132898

Summary: tcsh-users get always kde session no matter what they choose in kdms session menu
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Rainer Krienke <krienke>
Component: BasesystemAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: the_murple
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Rainer Krienke 2005-11-09 10:31:19 UTC
A user who has a tcsh or csh as his login session can only start a KDE session from kdm. 

I found the reason for this in /usr/X11R6/lib/X11/xdm/sys.xsession in this script in line 54 this happens:

case "$SHELL" in
*/csh|*/tcsh)
    while read env ; do
        var="${env%%=*}" ; val="${env#*=}"
        test "$var" = "umask"  && umask $val
        test "$var" = "$val"   && continue
        eval export $var="\$val"
    done < <($SHELL -c 'test -r /etc/csh.login && source /etc/csh.login;
                        test -r $HOME/.login   && source $HOME/.login  ;
                        printenv; echo -n umask=; umask')
    ;;
esac

Actually $SHELL -c start a new tcsh or csh depending on the users shell. This finally will source /etc/profile.d/profile.csh and in this script the variable WINDOWMANAGER is set a new to the default windowmanager which usually is kde. Becvause of the code from above in sys.xsession the new setting for WINDOWMANGER from profile.csh is afterwards also exported to sys.xsession and so the script always starts a kde session.

The code in /etc/profile.d/profile.csh the resets the WINDOWMANGER variable (which should not happen if called from sys.xsession) is the following:

foreach val ($path /usr/X11R6/bin /opt/gnome/bin /usr/openwin/bin)
    if ( ${val:q} =~ *.* ) continue
    set val=${val:q}/${default_wm:q}
    if ( ! -x ${val:q} ) continue
    setenv WINDOWMANAGER ${val:q}   # <-------- it happens here
    break
end
Comment 1 Dr. Werner Fink 2005-11-09 10:52:29 UTC
Yep is known and fixed for next release.  Also I've changed the
scheme how the users login SHELL is executed.  With 10.1 I use
the users login SHELL directly to execute sys.xsession.
Comment 2 Stephan Kulow 2006-01-09 17:32:12 UTC
*** Bug 131223 has been marked as a duplicate of this bug. ***