[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: /etc/environment not read by su?



On Wednesday, May 21, 2003 1:37 PM, Colin Watson
[mailto:cjwatson@debian.org] wrote:
> On Wed, May 21, 2003 at 12:43:17PM +0200, Reckhard, Tobias wrote:
> > So my question is: How can I make su read /etc/environment?
> 
> /etc/environment is weird; it's read by pam_env, and I'm 
> never entirely
> sure about what syntax is valid. (Is quoting allowed? If so, 
> what kind?
> The PAM documentation just says that it's a file full of 
> KEY=VAL pairs.)
> I normally prefer dropping things into the normal shell startup files.

I find most of the PAM documentation rather confusing, to be honest..

> However, putting 'auth required pam_env.so' in /etc/pam.d/su 
> should make
> su read /etc/environment, I think. Experiment with a root 
> shell open in
> another window so that you can recover easily if anything 
> goes wrong. :)

Well, nothing additional has gone wrong that I'd have noticed. However, the
variables still aren't being set.. :-(

A SuSE 7.3 system I've still got around manages to do what I want, but I
haven't been able to figure out how it's done there -- there isn't any
/etc/environment, $http_proxy is defined in the notorious /etc/rc.config
file, from which it must be read by some startup script that I haven't been
able to identify yet.

However, I don't want to replicate SuSE's way of doing this, which is why
I'm asking around here.

Any other ideas (besides using 'su -m')?

Thanks for your time,
Tobias



Reply to: