You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 2001/01/09 04:38:34 UTC

environment variable settings are bad

On 8 Jan 2001, Tony Finch wrote:

>  Apache-2.0 has this feature
>  already, if you run it with the environment variable NO_DETACH set.

Claim: behaviours like this controlled by random environment 
variables are evil and are a symptom of the lack of a better way to
pass this sort of info to the places that need it.

Anyone agree or am I crazy?


Re: environment variable settings are bad

Posted by Tony Finch <do...@dotat.at>.
Marc Slemko <ma...@znep.com> wrote:
>
>Claim: behaviours like this controlled by random environment 
>variables are evil and are a symptom of the lack of a better way to
>pass this sort of info to the places that need it.

Yes.

Tony.
-- 
f.a.n.finch    fanf@covalent.net    dot@dotat.at
"If I didn't see it with my own eyes I would never have believed it!"

Re: environment variable settings are bad

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Greg Stein wrote:
> 
> On Mon, Jan 08, 2001 at 07:45:48PM -0800, rbb@covalent.net wrote:
> >
> > > Anyone agree or am I crazy?
> 
> I completely agree.
	:
> I'd lobby for the hash table of options.

++1
-- 
#ken    P-)}

Ken Coar                    <http://Golux.Com/coar/>
Apache Software Foundation  <http://www.apache.org/>
"Apache Server for Dummies" <http://Apache-Server.Com/>
"Apache Server Unleashed"   <http://ApacheUnleashed.Com/>

Re: environment variable settings are bad

Posted by Ben Laurie <be...@algroup.co.uk>.
Greg Stein wrote:
> I'd lobby for the hash table of options.

+1. Never liked the env var stuff.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: environment variable settings are bad

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Jan 08, 2001 at 07:45:48PM -0800, rbb@covalent.net wrote:
> 
> > >  Apache-2.0 has this feature
> > >  already, if you run it with the environment variable NO_DETACH set.
> > 
> > Claim: behaviours like this controlled by random environment 
> > variables are evil and are a symptom of the lack of a better way to
> > pass this sort of info to the places that need it.
> > 
> > Anyone agree or am I crazy?

I completely agree. It is a pain in the ass to start a program, have it do
something wonky, and then realize that an environment variable exists in
that particular shell, which you started three months before. Totally sucks.

> The original plan had been, I believe, to use the -D command line argument
> to Apache.  However, we don't actually set environment variables with the
> -D stuff, so that doesn't work.

Why use the environment? Put together a hash table with -D name[=value]
information, and shove that into the process_rec. MPMs (or anything for that
matter) can inspect the hash table.

> We could just check our own env table,
> the one we set with -D, but if we are going to do that, then why didn't we
> just stick with -X and use -N for no_detach?

To stop the switch explosion. -X and -N only apply to specific MPMs, too. A
more general MPM-ignorant mechanism is needed.


I'd lobby for the hash table of options.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: environment variable settings are bad

Posted by dean gaudet <dg...@arctic.org>.
On Mon, 8 Jan 2001 rbb@covalent.net wrote:

> why didn't we just stick with -X and use -N for no_detach?

when i made the MPM a module it no longer had access to argv/argc and i
was making a zillion other changes at the time and didn't feel like making
a new API for command line arguments.  environment variables got me going.

only issue with the hash someone proposed is that if multiple modules now
have access to the command line how do you avoid ambiguous command line
switches?  i.e. switches with multiple users?

also on -D -- i always claimed it was a mistake for -D to not use
environment variables.

-dean


Re: environment variable settings are bad

Posted by rb...@covalent.net.
> >  Apache-2.0 has this feature
> >  already, if you run it with the environment variable NO_DETACH set.
> 
> Claim: behaviours like this controlled by random environment 
> variables are evil and are a symptom of the lack of a better way to
> pass this sort of info to the places that need it.
> 
> Anyone agree or am I crazy?

The original plan had been, I believe, to use the -D command line argument
to Apache.  However, we don't actually set environment variables with the
-D stuff, so that doesn't work.  We could just check our own env table,
the one we set with -D, but if we are going to do that, then why didn't we
just stick with -X and use -N for no_detach?

I really haven't made up my mind about how I feel about using the env
vars.  I was just following the move from -X to ONE_PROCESS when I
implemented the NO_DETACH stuff.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------