Red Hat Bugzilla – Bug 7221
".profile" files are not executed for non-bash shells under X window
Last modified: 2008-05-01 11:37:53 EDT
I use the Korn shell (pdksh) by default. I also run my ssytem at init level
5 by default. I use KDE by default.
However, the ".profile" file in my home directory does not get executed
at login. Under RH5.2 (from which I upgraded) it did. I have tried this
with the 'ash' shell as well and got the same result. Bash does not
have this problem. Running the system at init 2 or 3 it all works okay.
It seems that bash and Csh have special handling for the login scripts -
hence no problem with them. However, for any other shell combined with
X window being run by default, ther eis nothing saying to execute a
file in the users home directory.
Under RH5.2 the file /etc/X11/kdm/Xsession existed to do this. At 6.1 it
seems that both KDE and gnome run the file /etc/X11/xdm/Xsession.
From 5.2 I have included into this file:
if [ -r "$HOME/.profile ]; then
The RH5.2 system had an 'else' part to this statement - but I left it ot
it was never executed by me (it ran something I don't use).
The current approach for setting up the environment when one logs
in via a graphical login appears to be to start scripts with
and assume that everyone uses bash or something compatable enough,
and writes their login dotfiles nicely, so that 'bash -login' will
work. As you've noticed, this doesn't always fly (especially for
people using login shells, such as tcsh, that don't use .profile et
al at all).
Remember to specify that each kterm is to be a login shell - then you'll avoid
This isn't a ksh problem - we are aware of it (and have been so for some time),
and are thinking about how to fix this (not just ksh...). I think gdm is a
better candidate component.
Elliot - is gdm the answer to this problem? What do you think?
Since the 'Xsession' script uses 'bash -login', things should be initialized
correctly AFAIK. I don't see any csh- or bash-specific logic other than assuming
that bash can initialize things correctly.