Temporary change adding additional debugging messages to better pinpoint
startup failures of test suite ssh and socks servers.
This commit is contained in:
parent
9b86eecb94
commit
61e2e86aef
@ -1039,31 +1039,40 @@ sub runsshserver {
|
|||||||
|
|
||||||
# don't retry if the server doesn't work
|
# don't retry if the server doesn't work
|
||||||
if ($doesntrun{$pidfile}) {
|
if ($doesntrun{$pidfile}) {
|
||||||
|
logmsg "TRACESSH:runsshserver: ssh server previously failed to start with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $pid = checkserver($pidfile);
|
my $pid = checkserver($pidfile);
|
||||||
|
logmsg "TRACESSH:runsshserver: checkserver on pidfile: $pidfile returns pid: $pid\n";
|
||||||
if($pid > 0) {
|
if($pid > 0) {
|
||||||
stopserver($pid);
|
stopserver($pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $flag=$debugprotocol?"-v ":"";
|
my $flag=$debugprotocol?"-v ":"";
|
||||||
my $cmd="$perl $srcdir/sshserver.pl $flag-u $USER -l $HOSTIP -d $srcdir $port";
|
my $cmd="$perl $srcdir/sshserver.pl $flag-u $USER -l $HOSTIP -d $srcdir $port";
|
||||||
|
logmsg "TRACESSH:runsshserver: calling startnew with cmd: $cmd\n";
|
||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,0); # start the server in a new process
|
startnew($cmd, $pidfile,0); # start the server in a new process
|
||||||
|
|
||||||
|
logmsg "TRACESSH:runsshserver: startnew returns sshpid: $sshpid pid2: $pid2\n";
|
||||||
|
|
||||||
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the SSH server\n";
|
logmsg "RUN: failed to start the SSH server\n";
|
||||||
# failed to talk to it properly. Kill the server and return failure
|
# failed to talk to it properly. Kill the server and return failure
|
||||||
|
logmsg "TRACESSH:runsshserver: calling stopserver with sshpid: $sshpid pid2: $pid2\n";
|
||||||
stopserver("$sshpid $pid2");
|
stopserver("$sshpid $pid2");
|
||||||
$doesntrun{$pidfile} = 1;
|
$doesntrun{$pidfile} = 1;
|
||||||
|
logmsg "TRACESSH:runsshserver: later dont try to start a server with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifyserver('ssh',$ip,$port)) {
|
if (!verifyserver('ssh',$ip,$port)) {
|
||||||
logmsg "RUN: SSH server failed verification\n";
|
logmsg "RUN: SSH server failed verification\n";
|
||||||
|
logmsg "TRACESSH:runsshserver: BUT It seems that we are letting sshpid: $sshpid pid2: $pid2 alive\n";
|
||||||
$doesntrun{$pidfile} = 1;
|
$doesntrun{$pidfile} = 1;
|
||||||
|
logmsg "TRACESSH:runsshserver: later dont try to start a server with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
if($verbose) {
|
if($verbose) {
|
||||||
@ -1084,20 +1093,26 @@ sub runsocksserver {
|
|||||||
|
|
||||||
# don't retry if the server doesn't work
|
# don't retry if the server doesn't work
|
||||||
if ($doesntrun{$pidfile}) {
|
if ($doesntrun{$pidfile}) {
|
||||||
|
logmsg "TRACESSH:runsocksserver: socks server previously failed to start with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $flag=$debugprotocol?"-v ":"";
|
my $flag=$debugprotocol?"-v ":"";
|
||||||
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} -vv >log/ssh.log 2>&1";
|
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} -vv >log/ssh.log 2>&1";
|
||||||
|
logmsg "TRACESSH:runsocksserver: calling startnew with cmd: $cmd\n";
|
||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,1); # start the server in a new process
|
startnew($cmd, $pidfile,1); # start the server in a new process
|
||||||
|
|
||||||
|
logmsg "TRACESSH:runsocksserver: startnew returns sshpid: $sshpid pid2: $pid2\n";
|
||||||
|
|
||||||
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the SOCKS server\n";
|
logmsg "RUN: failed to start the SOCKS server\n";
|
||||||
# failed to talk to it properly. Kill the server and return failure
|
# failed to talk to it properly. Kill the server and return failure
|
||||||
|
logmsg "TRACESSH:runsocksserver: calling stopserver with sshpid: $sshpid pid2: $pid2\n";
|
||||||
stopserver("$sshpid $pid2");
|
stopserver("$sshpid $pid2");
|
||||||
$doesntrun{$pidfile} = 1;
|
$doesntrun{$pidfile} = 1;
|
||||||
|
logmsg "TRACESSH:runsocksserver: later dont try to start a server with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,6 +1120,7 @@ sub runsocksserver {
|
|||||||
if (!verifyserver('socks',$ip,$port)) {
|
if (!verifyserver('socks',$ip,$port)) {
|
||||||
logmsg "RUN: SOCKS server failed verification\n";
|
logmsg "RUN: SOCKS server failed verification\n";
|
||||||
$doesntrun{$pidfile} = 1;
|
$doesntrun{$pidfile} = 1;
|
||||||
|
logmsg "TRACESSH:runsocksserver: later dont try to start a server with pidfile: $pidfile\n";
|
||||||
return (0,0);
|
return (0,0);
|
||||||
}
|
}
|
||||||
if($verbose) {
|
if($verbose) {
|
||||||
@ -2368,6 +2384,7 @@ sub startservers {
|
|||||||
elsif($what eq "sftp" || $what eq "scp" || $what eq "socks4" || $what eq "socks5" ) {
|
elsif($what eq "sftp" || $what eq "scp" || $what eq "socks4" || $what eq "socks5" ) {
|
||||||
if(!$run{'ssh'}) {
|
if(!$run{'ssh'}) {
|
||||||
($pid, $pid2) = runsshserver("", $verbose);
|
($pid, $pid2) = runsshserver("", $verbose);
|
||||||
|
printf ("TRACESSH:startservers: runsshserver returns pid: %d pid2: %d\n", $pid, $pid2);
|
||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return "failed starting SSH server";
|
return "failed starting SSH server";
|
||||||
}
|
}
|
||||||
@ -2396,6 +2413,7 @@ sub startservers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
($pid, $pid2) = runsocksserver("", $verbose);
|
($pid, $pid2) = runsocksserver("", $verbose);
|
||||||
|
printf ("TRACESSH:startservers: runsocksserver returns pid: %d pid2: %d\n", $pid, $pid2);
|
||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return "failed starting socks server";
|
return "failed starting socks server";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user