]> mj.ucw.cz Git - bex.git/commitdiff
Command used to run ssh is configurable
authorMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 13:46:11 +0000 (14:46 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 13:46:11 +0000 (14:46 +0100)
TODO
brun
lib/BEX/Config.pm

diff --git a/TODO b/TODO
index b7badfd8226458a91294c1fadcf01c8b212dd500..637c805c96db6aa8cab16f510a09af92fd5ca901 100644 (file)
--- 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 3e46d4700571b07621a48ed9991863b872a21f22..7af77f3301857de38b06646cdc7f034016742698 100755 (executable)
--- 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 {
index 5779e545cd182a9177f66e884a3bc4899b4567a8..a5ee67e6d49fbac7b4737d551608e9f2e2abe2c9 100644 (file)
@@ -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(@);