httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Perl framework 'server exited' on AIX
Date Sat, 26 Jan 2002 04:42:17 GMT
Rodent of Unusual Size wrote:

> When trying to run vanilla 't/TEST' on AIX, with httpd-2.0 HEAD,
> I'm getting a
> 
> waiting for server to start: 00:00
> server has died with status 255 (please examine t/logs/error_log)
> 
> Checking the logfile, and the running system, reveals this to
> be a canard.  The server *is* started.  I can't even get it
> to return a non-zero exit status with a real startup failure
> and -DONE_PROCESS -DNO_DETACH, so I don't know where the 255
> is coming from..
> 
> Any thoughts?  Is there a switch I can pass to t/TEST, or
> 'perl t-TEST', that's the equivalent of bash's -xv?


It dies here:

         require POSIX;
         $old_sig = $SIG{CHLD};
         $SIG{CHLD} = sub {
             while ((my $child = waitpid(-1, POSIX::WNOHANG())) > 0) {
                 my $status  = $? >> 8;
                 #error "got child exit $status";
                 if ($status) {
                     $self->failed_msg("\nserver has died with status 
$status");
                     kill SIGTERM => $$;
                 }
             }
         };

any ideas what's different on AIX/HP from Linux? read it as a C code, 
it's a simple SIGCHLD that checks that the forked process doesn't exit, 
till we know that the server is responding. (then the signal handler is 
reset to the default).

But it seems that on AIX/HP it throws SIGCHLD with status 255. Any ideas 
why?

As a temp workaround, which disables this error checking, just add:

Index: Apache-Test/lib/Apache/TestServer.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.53
diff -u -r1.53 TestServer.pm
--- Apache-Test/lib/Apache/TestServer.pm	17 Jan 2002 04:17:49 -0000	
1.53
+++ Apache-Test/lib/Apache/TestServer.pm	26 Jan 2002 04:40:34 -0000
@@ -429,6 +429,7 @@
                  }
              }
          };
+        $SIG{CHLD} = $old_sig || 'DEFAULT';

          defined(my $pid = fork) or die "Can't fork: $!";
          unless ($pid) { # child

But then if there is some problem at the startup, it'll wait for about 
60 secs before it shuts down. So let's figure out what's different on 
AIX/HP.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Mime
View raw message