/etc/gdm/Xsession does not call /etc/X11/Xsession

Bug #465349 reported by Damien Robert
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: gdm

On /etc/gdm/Xsession i see the following:

if [ -d /etc/X11/Xsession.d ]; then
    for i in `ls /etc/X11/Xsession.d/` ; do
        if [ -r "/etc/X11/Xsession.d/$i" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
            . "/etc/X11/Xsession.d/$i"
        fi
    done
fi

so that the files in /etc/X11/Xsession.d are read.

However
1) The following variables are not set:
SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources

SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors
but they are used by the scripts in /etc/X11/Xsession.d

they are set by /etc/X11/Xsession, so a workaround would be to source this file rather than the script in /etc/X11/Xsession.d

2) the script in /etc/gdm continues with
if [ "x$command" = "xcustom" ] ; then
  if [ -x "$HOME/.xsession" ]; then
    command="$HOME/.xsession"
  else
    echo "$0: Cannot find ~/.xsession will try the default session"
    command="default"
  fi
fi
...

But this will never be called, because the sourced file
Numenor /etc/gdm $ cat /etc/X11/Xsession.d/99x11-common_start
# $Id: 99x11-common_start 305 2005-07-03 18:51:43Z dnusinow $

# This file is sourced by Xsession(5), not executed.
exec $STARTUP

will exec $STARTUP so that the rest of the gdm script after sourcing the scripts in /etc/X11/Xsession.d
are not read. I understand this as a fallback in case nothing is launched by /etc/X11/Xsession.d, but this should be commented, I have the impression the maintenair expect the rest of the script to be read.

(This is a regression compared to jaunty, see bug #229199)

ProblemType: Bug
Architecture: i386
Date: Fri Oct 30 19:38:56 2009
DistroRelease: Ubuntu 9.10
Package: gdm 2.28.1-0ubuntu1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: gdm
Uname: Linux 2.6.31-14-generic i686

Revision history for this message
Damien Robert (robertdamien) wrote :
Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :

I just wondered why my ~/.xsession did not execute any more after upgrade to 9.10, here is the answer.

Are there any workaround for this bug?

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :

It seems like removing the file /etc/X11/Xsession.d/99x11-common_start is a workaround for this.

aporter (aporter)
Changed in gdm (Ubuntu):
status: New → Confirmed
Revision history for this message
aporter (aporter) wrote :

Removing the file /etc/X11/Xsession.d/99x11-common_start did not work for me.

My workaround was to add: STARTUP="$HOME/.xsession" to /etc/X11/Xsession.d/99x11-common_start but that will give you an error if you *don't* have an .xsession file.

Revision history for this message
wmatheos (wmatheos) wrote :

Add to /etc/X11/Xsession.d/99x11-common_start :
---------------------------------------
if [ -f $HOME/.xsession ]
then
STARTUP="$HOME/.xsession"
fi
---------------------------------------
If the is a .xsession file it will be run, If not, start the default session.

Revision history for this message
Damien Robert (robertdamien) wrote :

Well the recommanded way to source your xsession is given in bug: #398300.

There are two things that happen here:
You have to add a file named "Xsessions.desktop" to /etc/X11/sessions with the contents:
[Desktop Entry]
Name=Xsession
Comment=This runs ~/.xsession
Exec=/etc/X11/Xsession

Exec=default should be the right way, but it is not because of the bug i reported here.
The problem is that with Exec=/etc/X11/Xsession, the files in Xsession.d get sourced twice, so it would be nice if we could put Exec=default instead.

Changed in gdm (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.