On Thu, Aug 13, 1998 at 09:13:04AM +0000, Richard Adams wrote:
> 
> 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.

I do not know RH init scripts (partially that's why I don't use it),
but those scripts are system initialization scripts, no environment
variable that you set there is exported to users/root shell, you can
test it by checking another environment variable that get set and
exported whithin any of those scripts.

> 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.

rc.sysinit is not a bash file, it is a system wide initialization, and
it set's the PATH just for it and for other initialization scripts it
calls, not for users.

> 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.

When the shell (in this case bash), begin it's execution you are
already logged in.

> 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.

Not true, at least in Debian. If you change the ENV_PATH from its
default of just /bin:/usr/bin to add, let's say, /usr/X11R6/bin, then
the results are completly different. The ENV_SUPATH/ENV_PATH values
may be hard coded into the login binary, and are different (for what
you tell me) from distribution to distribution.

> 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.

Not same results.

> > 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.

>From my point of view it is needed, have you tryied this? I mean, have
you edited your /etc/profile and added the echo $PATH statement there?

I think there is nothing like /sbin nor /usr/sbin echoed, as programs
in those directories are only useful to root, and only root can fully
use most of them. I tryied this in my computer and even root does not
get /sbin nor /usr/sbin in it's PATH at that moment, nor with
login.defs in place or without it.

See you
Roberto Ruiz

--
LINUX: the FREE 32 bit OS for [3456]86 PC's available NOW!

Reply via email to