mod_fcgi/perl: Problem with signals

Albert Leidinger <albert.leidinger-kt1KeoM4Q/BvMmomy+XrYrNldLUNz+W/@public.gmane.org>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi!

I want to use shared memory with FastCGI (dynamic processes). So I try 
to handle the TERM Signal to free the memory when the creating process 
is stopped.

The problem: It seems the script is just stopped without signals beeing 
handled when I stop or reload Apache
(I guess this isnt the correct problem but my not-know-how in 
programming might be ;)

Even in this little script (text.fcgi) the signals arent handled:

#!/usr/bin/perl

use CGI::Fast;

$SIG{TERM} = sub { open( LOG, '>>fcgi.log' ); print LOG "stop\n"; close( 
LOG); exit; };

while( my $q = new CGI::Fast )
{

        open( LOG, '>>fcgi.log' );

        print LOG "do request\n";
       
        close( LOG );

        print "Content-Type: text/html\n\nTest";
   
}

Every request writes "do request" in the Log. But when I reload or stop 
Apache "stop" isnt written to the Log.
Its just the same in my app - the routine to free the shared memory isnt 
called and its still listed when I run ipcs from the command line.

Some hints not only to solve the problem but maybe how to get some more 
info what the real problem could be and how to find it would be very, 
very nice.
thanks

Albert

Some more Info:
SuSE Linux 9.1
Perl 5.8.3
Apache 2.0.49
apache2_mod_fastcgi 2.4.0

P.S.: I love FastCGI. Great work, simple but a huge effect! thanks!
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.