Re: why not wrap fastcgi servers in a shell script?

Stanley Gambarin (gambarin@OpenMarket.com)
Fri, 07 Feb 1997 17:06:31 -0500

Message-Id: <199702072206.RAA00643@u4-138.openmarket.com>
To: Jim Johnstone <jimj@lexis-nexis.com>
Subject: Re: why not wrap fastcgi servers in a shell script? 
In-Reply-To: Your message of "Wed, 05 Feb 1997 17:11:42 EST."
             <199702052211.RAA11759@seahawks.lexis-nexis.com> 
Date: Fri, 07 Feb 1997 17:06:31 -0500
From: Stanley Gambarin <gambarin@OpenMarket.com>

> 
> I start a fastcgi server like this:
> AppClass /project/tpf95/data1/dw/usr/jimj/www/fcgi/fcgiEcho.fcg -processes 1
> 
> where fcgiEcho.fcg is a trivial ksh script to setup the environment:
> 
> #!/bin/ksh
> . ./dw.env
> exec ./fcgiEcho
> 
> where dw.env is the project standard env file setup script and fcgiEcho is
> the fast-cgi server (pretty much straight from the developers kit). 
> 
> This all seems to work fine, even for our real servers. Is there some
> reason, though, that its a bad idea?
> 
> TIA, Jim

	Jim, 
		I don't know if that could be a possible problem, but what 
happens when the fastCGI application runs under one user but the script
sets a different euid.  It may also turn up some problems with authorization.
For the general case, you should not use such setup since it causes an extra
fork()/exec() combo, which is not very costly, but can easily be replaced by
the PassEnv and SetEnv directives, which are provided by Apache in mod_env.
						Just a piece of my mind.
								Stanley.