On 12 Nov 2009, at 15:10, Nick Brown wrote:
> Elanor: I'm using the default apache2 config as distributed by Ubuntu
> 9.10. Is there a particular Apache directive I could use to make it
> behave the way I expect?

On reflection I suspect it wouldn't make a lot of difference as...

> Robert: Closing STDIN and STDOUT seemed to do the trick! Thanks.  
> Just so
> I grok this: Apache, by default, will wait until all subprocesses  
> close
> their IO streams before it sends a CGI program's output to the  
> browser?
> Is that correct? Is there a better way to kick off such processes?  
> Or is
> manually closing STDIN and STDOUT every time I fork the ideal  
> solution?


...it appears that when Apache launches a CGI process it waits for  
that process to close the std[in|out] file descriptors before sending  
the page to the browser, so closing them is clearly the way to go if  
using direct forking. However there are alternative options you could  
explore such as using a message queue (BackgroundDRb, unix message  
queues, etc.) or named pipe to communicate with a process (or  
processes) created outside the context of Apache.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
----
raise ArgumentError unless @reality.responds_to? :reason