You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by mo...@mail.thefriend.com on 2000/12/01 23:34:17 UTC

setting a variable based on the server.

Our website runs on linux and solaris boxes.  One of the external
applications that we have though can only be run on the solaris boxes.  We
can deal with this mostly through our switch and content filtering.

Unfortuantly, there are some situations that we haven't been able to find
where the linux server attempts to run a program that can only be run on
solaris.

The child that it(out code) is running in dies and is left as a defunct
process that isn't cleaned up until the main server process is restarted.

The solution i'm working on is something like this:
in the httpd.conf add
in the linux box
PerlSetVar NETP 0
in the solaris box
PerlSetVar NETP 1

then change the code to
if ($NETP)
{
return $netp->run();
}else{
reutrn 0;
}

The only problem i'm concerned with here is that i remember something
somewhere saying that there was a performance hit to doing either this
method, or some other method.

Any thoughts?  Is there a better | more correct method?

Scott


Re: setting a variable based on the server.

Posted by Stephen Beitzel <sb...@envolved.com>.
> The solution i'm working on is something like this:
> in the httpd.conf add
> in the linux box
> PerlSetVar NETP 0
> in the solaris box
> PerlSetVar NETP 1
> 
> then change the code to
> if ($NETP)
> {
> return $netp->run();
> }else{
> return 0;
> }

I've seen some problems with the PerlSetVar directive at my site, but
otherwise I do something quite similar. I wound up defining the
variables I need in apachectl (SYBASE=/opt/sybase; export SYBASE; etc.).