mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 22:17:54 +00:00
parallel: added --sshdelay to slow down ssh logins.
This commit is contained in:
parent
05330bf8ea
commit
e3e1345aac
|
@ -501,6 +501,7 @@ sub options_hash {
|
||||||
"seqreplace=s" => \$opt::seqreplace,
|
"seqreplace=s" => \$opt::seqreplace,
|
||||||
"jobs|j=s" => \$opt::P,
|
"jobs|j=s" => \$opt::P,
|
||||||
"delay=f" => \$opt::delay,
|
"delay=f" => \$opt::delay,
|
||||||
|
"sshdelay=f" => \$opt::sshdelay,
|
||||||
"load=s" => \$opt::load,
|
"load=s" => \$opt::load,
|
||||||
"noswap" => \$opt::noswap,
|
"noswap" => \$opt::noswap,
|
||||||
"max-line-length-allowed" => \$opt::max_line_length_allowed,
|
"max-line-length-allowed" => \$opt::max_line_length_allowed,
|
||||||
|
@ -722,6 +723,10 @@ sub parse_options {
|
||||||
wait_and_exit(0);
|
wait_and_exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(not defined $opt::delay) {
|
||||||
|
# Set --delay to --sshdelay if not set
|
||||||
|
$opt::delay = $opt::sshdelay;
|
||||||
|
}
|
||||||
if($opt::tollef and not $opt::gnu and not $opt::plain) {
|
if($opt::tollef and not $opt::gnu and not $opt::plain) {
|
||||||
# Behave like tollef parallel (from moreutils)
|
# Behave like tollef parallel (from moreutils)
|
||||||
$opt::u = 1;
|
$opt::u = 1;
|
||||||
|
@ -2766,7 +2771,8 @@ sub simultaneous_sshlogin {
|
||||||
my $wanted_processes = shift;
|
my $wanted_processes = shift;
|
||||||
my $sshcmd = $self->sshcommand();
|
my $sshcmd = $self->sshcommand();
|
||||||
my $serverlogin = $self->serverlogin();
|
my $serverlogin = $self->serverlogin();
|
||||||
my $cmd = "$sshcmd $serverlogin echo simultaneouslogin </dev/null 2>&1 &"x$wanted_processes;
|
my $sshdelay = $opt::sshdelay ? "sleep $opt::sshdelay;" : "";
|
||||||
|
my $cmd = "$sshdelay$sshcmd $serverlogin echo simultaneouslogin </dev/null 2>&1 &"x$wanted_processes;
|
||||||
::debug("Trying $wanted_processes logins at $serverlogin");
|
::debug("Trying $wanted_processes logins at $serverlogin");
|
||||||
open (my $simul_fh, "-|", "($cmd)|grep simultaneouslogin | wc -l") or
|
open (my $simul_fh, "-|", "($cmd)|grep simultaneouslogin | wc -l") or
|
||||||
::die_bug("simultaneouslogin");
|
::die_bug("simultaneouslogin");
|
||||||
|
|
Loading…
Reference in a new issue