[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RH -> Debian migration breaks CGI script under Apache



I've recently upgraded our webserver from RH 7.3 to Debian "etch", installed Apache2 and all seems fine, except one CGI script no longer functions correctly even though as far as I can tell I've reproduced the Apache configuration options on the new machine. At the nub of it, the relevant section can be boiled down to the following snippet of code, which involves setting a signal handler for an alarm:

 eval
 {
   local $SIG{ALRM} = sub { die "alarm\n" };
   alarm (TIMEOUT);
   system "<a system call is executed>";
   alarm (0);
 };
 die if $@ && $@ ne "alarm\n";     # propagate errors

 # Did we timeout?
 if ($@)
 {
   system "<perform some cleanup>";
   print "Timed out";
 }
 else
 {
   print "OK";
 }

This worked fine as a CGI script on the old RH box, and will work on the new Debian box from the command line but not when run as a CGI script. In the latter case, the alarm never fires and the process waits on the first system call to complete.

Is there some subtle bit of Apache configuration that I may be missing to make that pesky alarm call work? Or is there something not quite right with Debian's Apache2 package?

Ta for any help/clues,
m




Reply to: