I ended up putting 'echo "My PID: $$" >> /tmp/etc_profile.trace' into
/etc/profile and then using kdm and gdm to login. kdm never executes
/etc/profile or ${HOME}/.bash_profile. gdm, on the other hand, executes it
two times. Once when the bash shell is started and then again when it
changes over to gnome-session. I have modified /etc/bashrc and /etc/profile
to fix this problem and included the patch at the end.
I was not sure why /etc/bashrc is unsetting PROFILE_LOADED. If it is known,
then /etc/profile does not need to be run again at all in that process.
I also exported it in /etc/profile but that is because there do not seem to
be any dependencies on non-exported environment variables in the standard
/etc/profile. If there are, then that part of the patch is incorrect and
will break things.
I do not think this is the correct solution for gdm, but it was quick and
easy and I do not know where gnome-session is being exec'ed. If someone
would be nice enough to point me in the right direction, I will fix this
properly and should be able to deduce the correct solution for kdm as well.
Al Niessner
----------- Patch below here ------------
*** bashrc.orig Fri Mar 30 08:48:49 2001
--- bashrc Thu Mar 29 16:44:30 2001
***************
*** 7,13 ****
. /etc/profile
fi
! unset PROFILE_LOADED
# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can't figure out.
--- 7,13 ----
. /etc/profile
fi
! #unset PROFILE_LOADED
# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can't figure out.
*** profile.orig Fri Mar 30 08:49:25 2001
--- profile Thu Mar 29 16:45:09 2001
***************
*** 6,12 ****
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
! PROFILE_LOADED=1
##### Handle by Mandrake Security
#PATH="$PATH:/usr/X11R6/bin"
--- 6,13 ----
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
! [ "$PROFILE_LOADED" = "1" ] && exit
! export PROFILE_LOADED=1
##### Handle by Mandrake Security
#PATH="$PATH:/usr/X11R6/bin"
Al Niessner wrote:
> When I log in (init 5) my X, enlightenment, GNOME, and all subsequent
> terminals are missing environment variables because $HOME/.bash_profile
> is not being read. If I log in on one of the TTY's, it works fine. I
> figure something must have changed in the windowing login around kdm and
> it uses the '--nologin' switch one too many times. Anyone else notice
> this? Anyone have any suggestions on a place to look to fix it? This
> problem does not exist with gdm.
>
> Al Niessner