I stand to correct myself on this. Having nothing better to do with the penultimate day of this year but to trace through the Red Hat init and login process in more painful detail, it would now seem thus:
When init invokes getty, getty forks and creates (at level 5), consoles 1 through 6 and, for X, console 7. login, which is invoked by getty, resets the default path for root and for normal users. If one logs in under X, apparently login and X BOTH start login shells. I say this because what I see happening is that the path appendices from my /etc/profile and my ~/.bash_profile are added twice. This does not happen if I log into a console, which would be a login only under login. Also, if I log in under X using gdm, the default path gets reset in gdm.conf, with the same double sourcing discussed above. So, the net of this is that, under X, one is running two login bash shells, apparently one for X and one for the user. The result of this is the double sourcing of /etc/profile and ~/.bash_profile. Logging in to a console results on one login shell, each with appropriate "base" paths, each with double sourcing of the bash files. While not a show stopper, it does seem there could be a better way...beyond my modest means, I assure you. At a minimum, this makes setting environment variables such as $PATH to be...um...a bit opaque, no? Best wishes for a Happy New Year to all! John On 12/25/01, 10:44:58PM -0500, John P Verel wrote: > Is there a bug in the Red Hat bash initialization scripts, /etc/bashrc? > > When one opens a gnome-terminal, after a successful X session start of > gnome, here is what I believes happens: > > 1) Xsession starts a bash login session. > > 2) gnome-terminal starts a non-login session. > > This means that: > > a) /etc/profile is sourced in step 1) above > b) /etc/profile in turn sources /etc/profile.d/*.sh > c) ~/.bash_profile is sourced in step 1) above, as it is a login > session. > d) ~/.bashrc is sourced in 2) above > e) ~/.bashrc in turn sources /etc/bashrc again, which > f) sources /etc/profile.d/*.sh again. > > If one looks at a path statement, one will see multiple invocations. I > think that this is where this is coming from. > > The root of this, I think, is that last several lines in /etc/bashrc > which, as noted in the comment, say, "We're not in a login shell", and > therefore sources /etc/profile.d/*.sh incorrectly for the second time. > > I further note that one gets a different path at a console login than at > a gnome-terminal login, which is consistent with the above. > > -- > John P. Verel > Living Proof That Low Tech Beats High Tech! > > > > _______________________________________________ > Redhat-list mailing list > [EMAIL PROTECTED] > https://listman.redhat.com/mailman/listinfo/redhat-list -- John P. Verel Living Proof That Low Tech Beats High Tech! _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list