Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334441 - XSession management audit of DM's (for x11@g.o)
Summary: XSession management audit of DM's (for x11@g.o)
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
: 338214 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-25 13:51 UTC by Ian Stakenvicius (RETIRED)
Modified: 2011-07-08 19:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Stakenvicius (RETIRED) gentoo-dev 2010-08-25 13:51:09 UTC
Xsession management is not unified across all DM's, nor is there any sort of standard or convention that DM's are currently brought up to meet.  This is a bit of a problem for some less-featured DM's such as slim, because it is unclear what exactly should be implemented to bring it up to snuff, especially since it's becoming desirable for xinit's scripts to be deprecated.

The following is the result of some investigation I did as a result of conversations with 'remi' in #gentoo-desktop, which is an evaluation or audit of all of the various Xsession handling performed by as many of the DM's in portage that I could identify.

XDM:
 - Xsession script is written by gentoo; located in ${FILESDIR}.  
 - Sources ~/.xsession (does not exec it), and uses /etc/X11/chooser.sh

SLIM:
 - No xsession support at present, runs /etc/X11/xinit/xinitrc by default.
 - Probably should not support Xsession setup in general, but just have a script that provides proper session-script selection (see bug 334111)


WDM:
 - Original Xsession execs $HOME/.xsession if executable, 
   otherwise executes $HOME/.Xclients if executable, 
   otherwise executes /etc/X11/xinit/Xclients if executable
   otherwise calls "xrdb -load $HOME/.Xresources" (if exists) and exec's xsm
 - Gentoo-patched Xsession does the resources thing first,
   then does $HOME/.xsession (if -x), then $HOME/.Xclients (if -x_,
   then /etc/X11/wdm/Xclients (which is part of the package)
   then does xsm (note, 'xsm' NOT INSTALLED anymore by default)
 - WDM Xclients script:
   - xrdb -merge's $HOME/.Xresources (if -f)
   - xrdb -merge's $HOME/.Xdefaults (if -f)
   - checks for a name in $HOME/.wm_style of a window manager:
     "UserDefined", which seems to do nothing as relevant variables are null
     WindowMaker
     afterstep
     blackbox
     icewm
     xsession (which is the actual 'xsession' app from way back)
     kde (via startkde)
   - does checks for various versions of fvwm, launches if found
   - launches twm as a last resort
 - Note, does NOT use chooser.sh nor any /etc/X11/Sessions/* scripts..
   Seems entirely outdated given wm choices.

GPE (gpe-dm):
 - specifically for palm, looks like.
 - gentoo custom Xinit script, which just does
     "exec run-parts /etc/X11/gpe-dm/Xinit.d"
 - given it's specific to the GPE DE i don't think it does session management.

KDM:
 - does not seem to have an Xsession script directly, but does do so internally:
 - gets available sessions from the files in /usr/share/xsessions/ (note, this path is patched-in by gentoo)
 - sources /etc/xprofile (if -f), sources $HOME/.xprofile (if -f)
 - gets an argument:
   -failsafe, exec's xterm
   -custom, exec's $HOME/.xsession)
   -default, exec's startkde
   -*, eval exec's whatever is passed in
 - Note, also does a bunch of stuff relating to the environment according to whatever the default shell is.
 - Note, gentoo also patches it to load /etc/X11/xinit/xinitrc.d/*


GDM:
 - has an Xsession script, provided by upstream looks like (no mods by gentoo)
 - script takes arguments, by default arguments are used to exec the session (assigned to $command)
 - /etc/profile and $HOME/.profile are sourced
 - /etc/xprofile and $HOME/.xprofile are sourced
 - freetemp exec'd if exists
 - {sys,user,rh6}{resources,modmap,xkbmap} are xrdb -merge'd or setxkbmap'd or xmodmap'd as appropriate
 - if command='custom', then command=$HOME/.xsession (if -x), otherwise command=default
 - if command=default, then various checks for Xclients are used, else exec xterm 
 - /etc/X11/xinit/xinitrc.d/* are sourced
 - eval exec $command 
 - some zenity thing (if found)
 - exec xterm (if all else fails)
 - Note -- this is by far the most complete of all Xsession scripts seen so far.
   - seems that /usr/share/xsessions/*.desktop are sources for session info, assume internals handle discovery and selection.

Xinit:
 - provides startx and xinitrc
 - startx is a big script that calls xinit
 - startx uses command-line, else runs ~/.xinitrc (if -f), else runs /etc/X11/xinit/xinitrc
 - xinit reads ~/.xinitrc (if -f), otherwise just launches xterm (assuming no command line options)
 - /etc/X11/xinit/xinitrc uses /etc/X11/chooser.sh to determine the command to run (which reads from the XSESSION environment variable), if nothing found then failsafes to twm with a few xterm's.


Reproducible: Always

Steps to Reproduce:
Comment 1 Rémi Cardona (RETIRED) gentoo-dev 2010-09-21 21:44:35 UTC
*** Bug 338214 has been marked as a duplicate of this bug. ***
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2011-07-08 19:31:32 UTC
Something that should be considered here as well is how extras such as dbus-launch and consolekit works.

For instance, there seems to be a partial implementation of /etc/X11/xinit/xinitrc.d/ in some display managers but not others.  GDM uses these scripts, for instance, but GDM also installs scripts for ssh-agent and keyring (which means that these scripts are not available unless GDM is installed).

For xinit-based DM's such as slim and xdm, it would be ideal to be able to use xinitrc.d for these items, whether that be for the DM's xsession script or for the DE scripts in /etc/X11/Sessions/ .. however I believe gentoo would need to take the stance to adopt and support the xinitrc.d convention before this would occur.

I believe that a number of DE startup scripts also take care of launching many of the items in xinitrc.d/ as well -- for instance, startxfce4 (via xdg) handles dbus-launch and ssh-agent.  Although there is documentation on the 'net that suggests running xfce4-session when xinitrc.d scripts are being used, GDM does not do this since the xfce4.desktop file states to launch startxfce4 .  I expect that there are these types of redundancies and conflicts throughout many combinations of DM's and DE's.

A policy doc laying out specific responsibilities of the DM and of the DE, and the preferred method(s) of implementation, may aid in clearing up this..well, this mess..