RE: xdm login behaviour

Bruce Richardson (
Sun, 28 Feb 1999 23:57:38 -0000

OK, I found the reason and a fix.

The Xsession script is the one run when xdm logs you in.  The first line is

#!/bin/bash -login

which they obviously expected to cause bash to read /etc/profile (and so 
on).  It doesn't - I don't know if they are just wrong here or if it's a 
bug in /bash.  I tried changing the first line to

#!/bin/bash --login -i

but bash choked on it, so I think this is a bug in bash 2.  Anyway, my 
solution is to rename Xsession to Xsession.script and create a file called 
Xsession which contains the following:
---------------------- cut ------------------------------
#Wrapper for Xsession to make it read /etc/profile, /etc/bashrc etc.
bash --login -i /etc/X11/xdm/Xsession.script
---------------------- cut ------------------------------

and that fixes it.