sub establishSession {
my @sshPort;
if ($sshPort =~ /(\d+)/)
{@sshPort = ("port", $1)}
else {return &error ("invalid port number");}
&xferOpen ('SESSION', $clusterHost,"compression", "yes", @sshPort)
|| return &error("couldn't connect to $clusterHost : $xferError");
return $success;
}
####
sub establishSession {
my @sshPort;
if ($sshPort =~ /(\d+)/)
{@sshPort = ("port", $1)}
else {return &error ("invalid port number");}
for (my $tries = 1; $tries < 4; $tries++) {
print "Attempt $tries to connect\n";
&xferOpen ('SESSION', $clusterHost,"compression", "yes", @sshPort);
}
return &error("couldn't connect to $clusterHost : $xferError");
return $success;
}
####
[ssesar@burl-dhcp152-211 20010808]$ ./pushproc-devel-20010808.pl
Attempt 1 to connect
SAxfer.pl: spawning timeout 3 ssh '-oBatchMode yes' -x -n -p 22 -c 3des '-oCompression yes' localhost /bin/true
Attempt 2 to connect
Attempt 3 to connect
p
pushproc.pl: ERROR: couldn't connect to localhost : process timed out after 3 seconds
pushproc.pl: disconnecting from host (localhost)
pushproc.pl: reactivation of localhost failed
pushproc.pl statistics:
1 hosts attempted
0 host(s) succeeded
1 host(s) failed
[ssesar@burl-dhcp152-211 20010808]$