mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-10 18:28:43 -04:00
explictly kill the process if the server fails to start, check for a non zero length pid file
This commit is contained in:
parent
38c0ea1339
commit
83bf223210
1 changed files with 12 additions and 4 deletions
|
|
@ -15,7 +15,7 @@
|
|||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: start.pl,v 1.20 2011/04/27 17:46:47 each Exp $
|
||||
# $Id: start.pl,v 1.21 2011/05/05 04:47:45 marka Exp $
|
||||
|
||||
# Framework for starting test servers.
|
||||
# Based on the type of server specified, check for port availability, remove
|
||||
|
|
@ -196,13 +196,21 @@ sub start_server {
|
|||
unlink glob $cleanup_files;
|
||||
}
|
||||
|
||||
system "$command";
|
||||
# get the shell to report the pid of the server ($!)
|
||||
$command .= "echo \$!";
|
||||
|
||||
# start the server
|
||||
my $child = `$command`;
|
||||
|
||||
# wait up to 14 seconds for the server to start and to write the
|
||||
# pid file otherwise kill this server and any others that have
|
||||
# already been started
|
||||
my $tries = 0;
|
||||
while (!-f $pid_file) {
|
||||
while (!-s $pid_file) {
|
||||
if (++$tries > 14) {
|
||||
print "I:Couldn't start server $server\n";
|
||||
print "I:Couldn't start server $server (pid=$child)\n";
|
||||
print "R:FAIL\n";
|
||||
system "kill -9 $child" if ("$child" ne "");
|
||||
system "$PERL $topdir/stop.pl $testdir";
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue