According to Roberto Ruiz: While burning my CPU.
> 
> 
> Hi Bryan:
> 
> On Tue, Aug 11, 1998 at 11:25:24AM -0400, Bryan Scaringe wrote:
> > This one's driving me nuts.
> > there are 4 files sourced when I log in...
> >     /etc/profile
> >     ~/.profile
> >     ~/.bash_profile
> >     one other, I can't remember.  Mabye /etc/bashrc or /etc/bash_profile
> 
> Those files are sourced when you are already logged in, and bash begins
> execution. Before this, login is executed (the program that ask's for your
> user name and password), according to the login man page:
> 
>      ... The value for $HOME, $SHELL, $PATH, $LOGNAME, and $MAIL are set
>      according to the appropriate fields in the password entry. ...
> 
> But there is nothing like a path in the /etc/passwd file, but looking at the
> /etc/login.defs file you will see it contains:
> 
> .
> .
> # *REQUIRED*  The default PATH settings, for superuser and normal users.
> #
> # (they are minimal, add the rest in the shell startup files)
> ENV_SUPATH      PATH=/sbin:/bin:/usr/sbin:/usr/bin
> ENV_PATH        PATH=/bin:/usr/bin
> .
> .
> 
> So there is the default PATH that you are getting at the echo statement in
> the /etc/profile file. In fact, if this wheren't this way, you must have
> used /bin/echo instead of just echo. :)
> 

The ENV_SUPATH has already been set by an EXPORT command in
/etc/rc.d/rc.sysinit on Readhat systems 4.2 and 5.0 (have not checked 5.1)
The one thats more important to most systems would be the ENV_PATH which is
for non-root users.

bash has an EXPORT for /bin:/sbin:/usr/bin:/usr/sbin in its first file of
the boot process, rc.sysinit as do some other boot scripts for other
directory's.

Upon login Brian see's, /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin or
something to that effect, this being from his first command in his
/etc/profile being it 'echo $PATH' or '/bin/echo $PATH' they are both the
same.

After he has logged in the path would be something like;
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:
Dependning on what he exports as his $PATH enviroment from that file.

If you rename your /etc/login.defs and restart your console or use init to
reread all the scripts, by changeng the runlevel to 1 and than back to 3 you
will see that the results are the same with or without the login.defs.

On redhat 4.2 systems the file /etc/login.defs was not used (ie its an
empty file as default) but the same results are achived as described above.

> NOTE: I'm using Debian GNU/Linux 2.0 and there the default PATH is just
> /bin:/usr/bin, so maybe you are using another distribution and the name of
> the configuration file for the login command may or may not change.

No is the same, but is not needed in such a way on Redhat systems, of
course it can be used to change what has already been set, its what you need
or want in your own system enviroment.

> 
> HTH, See you
> Roberto Ruiz
> 
> --
> LINUX: the FREE 32 bit OS for [3456]86 PC's available NOW!
> 


-- 
Regards Richard.
[EMAIL PROTECTED]

Reply via email to