[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xdm and user's profiles




Not true. I cannot get /etc/environment values to be set when I use xdm to
log into X. I have not tried via startx, but I presume that will work.

startx will obviously work since it will inherit the entire environment that is set for the login shell you are running startx from.

I may have futzed, and gotten the format wrong, if someone would enlighten
me, I'd be appreciative.

AFAICT xdm (and wdm) simply ignore all forms of setting environment variables, I tried getting /etc/environment to load with it, no go, I even tried using pam_env.so to get the environment loaded that does not work with xdm since xdm still has no support whatsoever for pam. but it did not work for wdm either (which does support pam)

from digging though my redhat box's xdm configuration i think they got around this by making the first line of the global Xsession script:

#! /bin/bash -login

which forces the bash shell executing the Xsession to be login shell and thus load the environment like xdm should be doing.

however, redhat uses bash 1 if you install bash 2 its called /bin/bash2. debian uses bash 2 and does not have bash 1 installed, i tried the above adapting it for bash 2:

#! /bin/bash --login

but this did not work, but i noticed a few days ago in discussions about bash bugs a little gem about bash not loading the *profile files when its called with --login and not attached to a tty, sounds exactly why the above don't work. so whenever that is fixed I will try the above again and if that works it seems to be to be a simple solution to this problem.

for now i just add the following to my .xsession :

#! /bin/bash

## workaround for broken xdm
source /etc/profile
source /etc/environment
source ~/.bash_profile
export MAIL=/var/spool/mail/$USER
xscreensaver &
wmaker

note above that the $MAIL variable is never defined since that is defined by the login program, and since in this case xdm is the login program it just does not get set. (redhat does not depend on the login program to set this they just add the above line to /etc/profile iirc)



Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/


Reply to: