Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Dec 2008 15:12:33 -0500
From:      "Brian A. Seklecki" <bseklecki@collaborativefusion.com>
To:        Mel <fbsd.questions@rachie.is-a-geek.net>
Cc:        freebsd-questions@freebsd.org, Bill Moran <wmoran@collaborativefusion.com>
Subject:   Re: Default list of exported variables in sh(1) - $HOSTNAME
Message-ID:  <1230581553.19488.7.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com>
In-Reply-To: <200812271028.11339.fbsd.questions@rachie.is-a-geek.net>
References:  <1230146554.4673.265.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com> <200812271028.11339.fbsd.questions@rachie.is-a-geek.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]

> > SSH_CONNECTION
> > FTP_PASSIVE_MODE
> > EDITOR
> 
> I suspect linux to set them from .profile files (even /etc/profile) and not 
> hardcoded in a shell or login program. The default skeletons 

Mel:

 You were right to some extent.  However, the problem is more
complicated (or less complicated, depending).

First, FreeBSD's default php.ini doesn't have:

$variables_order = "EGPCS", so $ENV[] array wasn't getting popualted at
all.

Second, Apache FreeBSD RC scripts inherit the user environment from
sudo(8) unless you pass -H or -i flag/args

E.x.:,

 % sudo -H -i -u root /usr/local/etc/rc.d/apache22 restart

Compared to:

 $ su -
 Password:
 $ /usr/local/etc/rc.d/apache22 restart

Result in completely different results in PHP's $_ENV[]

Additionally, the results of "$ su -" differ completely from the shell
environment that executes when rc(8) is first run at boot time.

I may be better off using getenv() in PHP directly.
  
~BAS



> in /usr/share/skel on FreeBSD does not set them. Neither 
> does /etc/login.conf. 


> I would set it in /etc/profile.
> 
-- 
Brian A. Seklecki <bseklecki@collaborativefusion.com>
Collaborative Fusion, Inc.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAklZLywACgkQCne6BNDQ+R9coQCfRy+izM84yZuASMewZzOTUYkl
PkoAnR2nzBV7efqhEpSkSaouPtTkVIf3
=TCrY
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1230581553.19488.7.camel>