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

Re: bash login for root



On Thu, 14 Sep 2000 brichardson@lineone.net wrote:
> >From: Julio Merino <jmmv@mail.com>
> It doesn't.  If I create /root/.bash_profile, bash uses
> it.  BUT root then gets a user path, not the special
> root path.
> 
> Now, on my RH machine, I have this in .bash_profile:
> 
> PATH=$HOME/bin:$PATH
> export PATH
> 
> This works fine and I get the root path (all the sbins etc.)
> plus /root/bin.  If I do the same thing on Debian,  I get
> the user path plus /root/bin.  This is what perplexes me.

So, PATH is set to include the sbin dirs prior to bash seeing these
lines on the RH box but not on the Debian box.  Does the RH box's
/root/.bash_profile contain ". ~/.bashrc" (or equivalent)?  and if so,
does .bashrc set or alter PATH?

You have really only told us the symptoms and a few fragments of bash's
startup scripts, we need to see everything bash sees.  i.e., every line
containing "PATH" in /etc/profile, /root/.bash_profile, and anything
they source - in the order bash sees them.  I suspect that if you go
through this process it will become obvious as to why things are not
working out the way you expect. 

A root login on my box goes through the following:  PATH set to
something suitable for a user in /etc/profile; reset to a standard
root's path in .bashrc, which is sourced from .bash_profile; and
finally prepended with ~/bin in .bash_profile.


later,

	Bruce



Reply to: