mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
When starting the ftp server, wait a few seconds to make really sure that
a pidfile for the server appears as otherwise it failed.
This commit is contained in:
parent
d3eea61f1f
commit
6f4ff1f2bf
@ -557,11 +557,22 @@ sub runftpserver {
|
|||||||
|
|
||||||
my $ftppid = startnew($cmd);
|
my $ftppid = startnew($cmd);
|
||||||
|
|
||||||
if(!kill(0, $ftppid)) {
|
if(!$ftppid || !kill(0, $ftppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
print "RUN: failed to start the FTP$id$nameext server!\n";
|
print "RUN: failed to start the FTP$id$nameext server!\n";
|
||||||
stopservers($verbose);
|
return -1;
|
||||||
exit;
|
}
|
||||||
|
|
||||||
|
# Make sure there is a pidfile present before we proceed. Because if we
|
||||||
|
# don't see one within a few secs, the server doesn't work. This mostly
|
||||||
|
# happens when the server finds out it cannot use the ipv6 protocol.
|
||||||
|
my $count=3;
|
||||||
|
while(! -f $pidfile) {
|
||||||
|
if(!$count--) {
|
||||||
|
print "RUN: failed starting FTP$id$nameext server (no pidfile)!\n";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($verbose) {
|
if($verbose) {
|
||||||
|
Loading…
Reference in New Issue
Block a user