csh environment variables

Polytropon freebsd at edvax.de
Wed May 7 23:54:26 UTC 2014

On Wed, 07 May 2014 19:39:28 -0400, Fbsd8 wrote:
> Where are the system environment variables saved at when the system 
> shuts down?

Usually nowhere. :-)

Those settings are made when a shell is started, with the
restriction that some might only be set when the shell is
an interactive shell. For the C shell, see /etc/csh.cshrc,
for root's (and any other user's) shell see ~/.cshrc and
maybe ~/.login.

Furthermore, environmental settings can be configured with
the login.conf mechanism, so have a look at /etc/login.conf
as well as ~/.login.conf for user settings.

A third option of where an "offending setting" might come
from - if it's _not_ an environmental variable - is a config
file for pkg_add or pkg.

Environmental settings usually only live as long as the shell
they have been initialized in. Shells started from that shell
could clear the environment, reset it, or inherit it. It all
depends on what mechanisms have been used.

> Looking for PACKAGESITE. Not interested in setenv or 
> unsetenv.

The PACKAGESITE is, if I remember correctly, _not_ set by
default, so you should be able to spot a "custom addition"
at one of the places mentioned.

On my home system (FreeBSD 8):

	PACKAGESITE: Undefined variable.

By default, it is not set.

> You have to have a running system for then to work.

And you should always have a working system to run. :-)

> Want to 
> remove system environment variable PACKAGESITE from a stand-a-lone 
> filesystem made from the base.txz file.

Examine the base.txz for any "accidental" setting of this variable.
As I said, it's probably not set by default. Currently I don't have
another system to verify if this is also true for FreeBSD 9 and 10.
If it's not in there, the setting could maybe get "inherited" from
the "upper-level OS parts" hosting the jails...

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list