Commit f998f0de authored by Sylvestre Ho's avatar Sylvestre Ho
Browse files

refs #4504; +timeout on ssh

parent 06386c33
......@@ -403,7 +403,15 @@ sub sendExternalCommand($$){
} else {
writeLogFile("External command : ".$server_info->{'ns_ip_address'}." ($id) : \"".$cmd."\"");
my $cmd = "$ssh -q ". $server_info->{'ns_ip_address'} ." -p $port 'echo \"".$cmd."\" >> ".$command_file."'\n";
$stdout = `$cmd`;
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $timeout;
$stdout = `$cmd`;
alarm 0;
};
if ($@) {
writeLogFile("Could not write into pipe file ".$command_file." on poller ".$server_info->{'ns_ip_address'}."\n");
}
}
if (defined($stdout) && $stdout){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment