The file /etc/X11/xdm/Xsession is not the original XFree86 one. It has been enhanced - probably by Red Hat. This enhancement has introduced a bug in line 54: exec "$startup $@" where: * "$startup" is $HOME/.xsession * "$@" is whatever options are passed to the script by xdm or an equivalent program. The script will try to exec a file in the $PATH with the name "$startup $@" instead of a program with the name "$startup" followed by command-line arguments "$@". To fix this problem, change line 54 from exec "$startup $@" to exec "$startup" "$@" I am trying to install KDE and its kdm display manager. In kdm, the user is able to choose the type of the session - `failsafe' or `kde' or `CDE' or `fvwm' or whatever. I have added an .xsession file to my home directory. If I choose any session type that is not `failsafe', let's say `kde', the script fails because it tries to exec "/home/papadopo/.xsession kde". I want to modify as few system files as possible. I chose to create a .Xclients file instead of a .xsession file in my home directory. The drawback is that no session type argument is passed anymore from /etc/X11/xdm/Xsession to .Xclients: I can only choose between `failsafe' which is handled directly in /etc/X11/xdm/Xsession and another environment defined in .Xclients.
This has been fixed in later releases of Red Hat Linux (5.2 and greater). Please have a look at the /etc/X11/xdm/Xsession file from a recent build of RawHide, and if you have any suggestions on improving that one, report back to me.