From: Martin Mares Date: Mon, 31 Oct 2011 13:46:11 +0000 (+0100) Subject: Command used to run ssh is configurable X-Git-Tag: v3.0~39 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=31d36e763c52ea589d77d01419bb40266129018f;p=bex.git Command used to run ssh is configurable --- diff --git a/TODO b/TODO index b7badfd..637c805 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ - bprun --job - bprun --curses - Terminology: machine vs. host -- ssh options - Detector of orphans (unused queue dirs, jobs on non-existent machines, non-queued jobs) - job failed => give a more explanatory message - write_job_status should be atomic diff --git a/brun b/brun index 3e46d47..7af77f3 100755 --- a/brun +++ b/brun @@ -121,13 +121,13 @@ sub run_job_body($$$) { update_status($mach, $jid, 'SEND', undef); my $cmd = 't=$(mktemp -t bex-XXXXXXXX) && cat >$t && chmod u+x $t && echo $t'; - my $rtmp = `ssh <$tmp $host '$cmd'`; + my $rtmp = `$BEX::Config::ssh_command <$tmp $host '$cmd'`; !$? && defined($rtmp) && $rtmp ne '' or return ('NOXFER', 'Transfer failed'); chomp $rtmp; update_status($mach, $jid, 'RUN', $queue); my $lf = $queue->log_file($mach, $jid); - system 'bash', '-o', 'pipefail', '-c', "ssh -t $host '$rtmp ; e=\$? ; rm -f $rtmp ; exit \$e' 2>&1 | tee -a $lf"; + system 'bash', '-o', 'pipefail', '-c', "$BEX::Config::ssh_command -t $host '$rtmp ; e=\$? ; rm -f $rtmp ; exit \$e' 2>&1 | tee -a $lf"; if ($?) { return ('FAILED', 'Job failed ' . exit_status($?)); } else { diff --git a/lib/BEX/Config.pm b/lib/BEX/Config.pm index 5779e54..a5ee67e 100644 --- a/lib/BEX/Config.pm +++ b/lib/BEX/Config.pm @@ -45,6 +45,9 @@ our $max_parallel_jobs = 5; # still could run such jobs in parallel) our $skip_on_fail = 0; +# How we run ssh (including options) +our $ssh_command = "ssh"; + # Various utility functions sub parse_machine_list(@);