[PLUG] How is env initilized?

Derek Loree derek at infotects.com
Wed Nov 27 19:37:45 UTC 2002


Hi All,

I've got a puzzler that probably fits in the category of "Everybody
knows that, why do we need to document it?"

The opening scene:  I've been experimenting with backing up live
servers, essentially running tar (--except /proc) on a live server, with
all services running, and seeing if I can restore the tarball on a
different box.

Don't laugh; I have had it work on two different servers, better than I
was expecting!  Of course the third server I tried this on didn't work
as well as the first two.  The problems that occurred are not the kinds
of things I was expecting either.

The most annoying is the $PATH setting for the root user.  On the
original server, when logged into bash as root:

server:/home# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

The same command on the restored box, logged into bash as root:

server-test:/home# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11

So, I'm confused about where the environment gets the values for its
variables, linux is supposed to be "file based", so there should be (a)
file(s) with this information in it (them).  What files contain the bash
environment?  (If you through the book at me, please include the
relevant sections.)  How can only part of PATH get lost?  It seems like
it aught to be an all or nothing kind of thing.

Another problem, I'm not sure if this is related or not, is that the
command /sbin/ifup isn't there after the restore; /sbin/ifdown and
/sbin/ifconfig are there, just no ifup.

I didn't have any of these problems on the first two servers, just the
third one.  BTW, I tried this several times, thinking that the tarball
got corrupted, with the same results.

TIA,

Derek Loree





More information about the PLUG mailing list