Fixed bug #46708: controlmaster uses tempdir in $HOME.

Passes testsuite.
This commit is contained in:
Ole Tange 2015-12-19 02:46:32 +01:00
parent 2fcb6f8df6
commit c871cdd0a3
5 changed files with 26 additions and 32 deletions

View file

@ -2889,10 +2889,14 @@ sub filter_hosts {
$Global::minimal_command_line_length = 8_000_000; $Global::minimal_command_line_length = 8_000_000;
while (my ($sshlogin, $obj) = each %Global::host) { while (my ($sshlogin, $obj) = each %Global::host) {
if($sshlogin eq ":") { next } if($sshlogin eq ":") { next }
$ncpus_ref->{$sshlogin} or ::die_bug("ncpus missing: ".$obj->serverlogin()); $ncpus_ref->{$sshlogin} or
$ncores_ref->{$sshlogin} or ::die_bug("ncores missing: ".$obj->serverlogin()); ::die_bug("ncpus missing: ".$obj->serverlogin());
$time_to_login_ref->{$sshlogin} or ::die_bug("time_to_login missing: ".$obj->serverlogin()); $ncores_ref->{$sshlogin} or
$maxlen_ref->{$sshlogin} or ::die_bug("maxlen missing: ".$obj->serverlogin()); ::die_bug("ncores missing: ".$obj->serverlogin());
$time_to_login_ref->{$sshlogin} or
::die_bug("time_to_login missing: ".$obj->serverlogin());
$maxlen_ref->{$sshlogin} or
::die_bug("maxlen missing: ".$obj->serverlogin());
if($opt::use_cpus_instead_of_cores) { if($opt::use_cpus_instead_of_cores) {
$obj->set_ncpus($ncpus_ref->{$sshlogin}); $obj->set_ncpus($ncpus_ref->{$sshlogin});
} else { } else {
@ -2903,7 +2907,8 @@ sub filter_hosts {
$Global::minimal_command_line_length = $Global::minimal_command_line_length =
::min($Global::minimal_command_line_length, ::min($Global::minimal_command_line_length,
int($maxlen_ref->{$sshlogin}/2)); int($maxlen_ref->{$sshlogin}/2));
::debug("init", "Timing from -S:$sshlogin ncpus:",$ncpus_ref->{$sshlogin}, ::debug("init", "Timing from -S:$sshlogin ",
" ncpus:",$ncpus_ref->{$sshlogin},
" ncores:", $ncores_ref->{$sshlogin}, " ncores:", $ncores_ref->{$sshlogin},
" time_to_login:", $time_to_login_ref->{$sshlogin}, " time_to_login:", $time_to_login_ref->{$sshlogin},
" maxlen:", $maxlen_ref->{$sshlogin}, " maxlen:", $maxlen_ref->{$sshlogin},
@ -5717,11 +5722,11 @@ sub control_path_dir {
# path to directory # path to directory
my $self = shift; my $self = shift;
if(not defined $self->{'control_path_dir'}) { if(not defined $self->{'control_path_dir'}) {
-e $ENV{'HOME'}."/.parallel" or mkdir $ENV{'HOME'}."/.parallel";
-e $ENV{'HOME'}."/.parallel/tmp" or mkdir $ENV{'HOME'}."/.parallel/tmp";
$self->{'control_path_dir'} = $self->{'control_path_dir'} =
File::Temp::tempdir($ENV{'HOME'} # Use $ENV{'TMPDIR'} as that is typically not
. "/.parallel/tmp/control_path_dir-XXXX", # NFS mounted
File::Temp::tempdir($ENV{'TMPDIR'}
. "/control_path_dir-XXXX",
CLEANUP => 1); CLEANUP => 1);
} }
return $self->{'control_path_dir'}; return $self->{'control_path_dir'};

View file

@ -1778,7 +1778,7 @@
<h2 id="Record-separators">Record separators</h2> <h2 id="Record-separators">Record separators</h2>
<p>GNU Parallel uses separators to determine where two record split.</p> <p>GNU Parallel uses separators to determine where two records split.</p>
<p>--recstart gives the string that starts a record; --recend gives the string that ends a record. The default is --recend &#39;\n&#39; (newline).</p> <p>--recstart gives the string that starts a record; --recend gives the string that ends a record. The default is --recend &#39;\n&#39; (newline).</p>

View file

@ -1779,7 +1779,7 @@ lines).
=head2 Record separators =head2 Record separators
GNU Parallel uses separators to determine where two record split. GNU Parallel uses separators to determine where two records split.
--recstart gives the string that starts a record; --recend gives the --recstart gives the string that starts a record; --recend gives the
string that ends a record. The default is --recend '\n' (newline). string that ends a record. The default is --recend '\n' (newline).

View file

@ -6,15 +6,21 @@ P_ALL="vax freebsd solaris openbsd netbsd debian alpha aix redhat hpux ultrix mi
P_NOTWORKING="vax alpha openstep" P_NOTWORKING="vax alpha openstep"
P_NOTWORKING_YET="ultrix irix" P_NOTWORKING_YET="ultrix irix"
P_WORKING="minix freebsd solaris openbsd netbsd debian aix redhat hpux qnx tru64 openindiana suse solaris-x86 mandriva ubuntu scosysv unixware dragonfly centos miros hurd raspbian macosx hpux-ia64 syllable pidora" P_WORKING="freebsd solaris openbsd netbsd debian aix redhat hpux qnx openindiana suse solaris-x86 mandriva ubuntu scosysv unixware dragonfly centos miros raspbian macosx hpux-ia64 pidora"
P_TEMPORARILY_BROKEN="minix syllable tru64 hurd"
P="$P_WORKING" P="$P_WORKING"
POLAR=`parallel -k echo {}.polarhome.com ::: $P` POLAR=`parallel -k echo {}.polarhome.com ::: $P`
S_POLAR=`parallel -k echo -S 1/{}.polarhome.com ::: $P` S_POLAR=`parallel -k echo -S 1/{}.polarhome.com ::: $P`
# Avoid the stupid /etc/issue.net banner at Polarhome: -oLogLevel=quiet
# 20150414 --timeout 80 -> 40
# 20151219 --retries 5 -> 2
TIMEOUT=10
RETRIES=2
echo '### Tests on polarhome machines' echo '### Tests on polarhome machines'
echo 'Setup on polarhome machines' echo 'Setup on polarhome machines'
# Avoid the stupid /etc/issue.net banner at Polarhome: -oLogLevel=quiet
stdout parallel -kj0 ssh -oLogLevel=quiet {} mkdir -p bin ::: $POLAR & stdout parallel -kj0 ssh -oLogLevel=quiet {} mkdir -p bin ::: $POLAR &
test_empty_cmd() { test_empty_cmd() {
@ -23,7 +29,7 @@ test_empty_cmd() {
bin/perl bin/parallel echo ::: OK_with_empty_cmd bin/perl bin/parallel echo ::: OK_with_empty_cmd
} }
export -f test_empty_cmd export -f test_empty_cmd
stdout parallel -j0 -k --retries 5 --timeout 80 --delay 0.1 --tag \ stdout parallel -j0 -k --retries $RETRIES --timeout $TIMEOUT --delay 0.1 --tag \
--nonall --env test_empty_cmd -S macosx.polarhome.com test_empty_cmd > /tmp/test_empty_cmd & --nonall --env test_empty_cmd -S macosx.polarhome.com test_empty_cmd > /tmp/test_empty_cmd &
copy_and_test() { copy_and_test() {
@ -36,8 +42,7 @@ copy_and_test() {
perl -pe 's:/[a-z0-9_]+.arg:/XXXXXXXX.arg:gi; s/\d\d\d\d/0000/gi;' perl -pe 's:/[a-z0-9_]+.arg:/XXXXXXXX.arg:gi; s/\d\d\d\d/0000/gi;'
} }
export -f copy_and_test export -f copy_and_test
# 20150414 --timeout 80 -> 40 stdout parallel -j0 -k --retries $RETRIES --timeout $TIMEOUT --delay 0.1 --tag -v copy_and_test {} ::: $POLAR
stdout parallel -j0 -k --retries 5 --timeout 40 --delay 0.1 --tag -v copy_and_test {} ::: $POLAR
# Test remote wrapper working on all platforms # Test remote wrapper working on all platforms
parallel -j0 --nonall -k $S_POLAR hostname parallel -j0 --nonall -k $S_POLAR hostname

View file

@ -1,7 +1,5 @@
### Tests on polarhome machines ### Tests on polarhome machines
Setup on polarhome machines Setup on polarhome machines
copy_and_test minix.polarhome.com
minix.polarhome.com ### Run the test on minix.polarhome.com
copy_and_test freebsd.polarhome.com copy_and_test freebsd.polarhome.com
freebsd.polarhome.com ### Run the test on freebsd.polarhome.com freebsd.polarhome.com ### Run the test on freebsd.polarhome.com
freebsd.polarhome.com Works on freebsd.polarhome.com freebsd.polarhome.com Works on freebsd.polarhome.com
@ -40,11 +38,6 @@ qnx.polarhome.com ### Run the test on qnx.polarhome.com
qnx.polarhome.com parallel: Warning: Cannot figure out number of CPU cores. Using 1. qnx.polarhome.com parallel: Warning: Cannot figure out number of CPU cores. Using 1.
qnx.polarhome.com Works on qnx.polarhome.com qnx.polarhome.com Works on qnx.polarhome.com
qnx.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Could not create temp file /XXXXXXXX.arg: Permission denied at bin/parallel line 0000 qnx.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Could not create temp file /XXXXXXXX.arg: Permission denied at bin/parallel line 0000
copy_and_test tru64.polarhome.com
tru64.polarhome.com ### Run the test on tru64.polarhome.com
tru64.polarhome.com Works on tru64.polarhome.com
tru64.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Parent directory (/) is not writable
tru64.polarhome.com at bin/parallel line 0000
copy_and_test openindiana.polarhome.com copy_and_test openindiana.polarhome.com
openindiana.polarhome.com ### Run the test on openindiana.polarhome.com openindiana.polarhome.com ### Run the test on openindiana.polarhome.com
openindiana.polarhome.com parallel: Warning: Cannot figure out number of CPU cores. Using 1. openindiana.polarhome.com parallel: Warning: Cannot figure out number of CPU cores. Using 1.
@ -89,10 +82,6 @@ miros.polarhome.com ### Run the test on miros.polarhome.com
miros.polarhome.com Works on miros.polarhome.com miros.polarhome.com Works on miros.polarhome.com
miros.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Parent directory (/) is not writable miros.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Parent directory (/) is not writable
miros.polarhome.com at bin/parallel line 0000 miros.polarhome.com at bin/parallel line 0000
copy_and_test hurd.polarhome.com
hurd.polarhome.com ### Run the test on hurd.polarhome.com
hurd.polarhome.com Works on hurd.polarhome.com
hurd.polarhome.com Error in tempfile() using template /XXXXXXXX.arg: Could not create temp file /XXXXXXXX.arg: Permission denied at bin/parallel line 0000.
copy_and_test raspbian.polarhome.com copy_and_test raspbian.polarhome.com
raspbian.polarhome.com ### Run the test on raspbian.polarhome.com raspbian.polarhome.com ### Run the test on raspbian.polarhome.com
raspbian.polarhome.com Works on raspbian.polarhome.com raspbian.polarhome.com Works on raspbian.polarhome.com
@ -106,9 +95,6 @@ hpux-ia64.polarhome.com ### Run the test on hpux-ia64.polarhome.com
hpux-ia64.polarhome.com Works on hpux-ia64.polarhome.com hpux-ia64.polarhome.com Works on hpux-ia64.polarhome.com
hpux-ia64.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Parent directory (/) is not writable hpux-ia64.polarhome.com Error in tempfile() using /XXXXXXXX.arg: Parent directory (/) is not writable
hpux-ia64.polarhome.com at bin/parallel line 0000 hpux-ia64.polarhome.com at bin/parallel line 0000
copy_and_test syllable.polarhome.com
syllable.polarhome.com ### Run the test on syllable.polarhome.com
syllable.polarhome.com chmod: changing permissions of `bin/p.tmp': Function not implemented
copy_and_test pidora.polarhome.com copy_and_test pidora.polarhome.com
pidora.polarhome.com ### Run the test on pidora.polarhome.com pidora.polarhome.com ### Run the test on pidora.polarhome.com
pidora.polarhome.com Works on pidora.polarhome.com pidora.polarhome.com Works on pidora.polarhome.com
@ -120,7 +106,6 @@ dragonfly.polarhome.com
freebsd.polarhome.com freebsd.polarhome.com
hpux-ia64 hpux-ia64
hpux64 hpux64
hurd
macosx macosx
mandriva.polarhome.com mandriva.polarhome.com
miros.polarhome.com miros.polarhome.com
@ -135,7 +120,6 @@ scosysv.polarhome.com
solaris-x86 solaris-x86
solaris solaris
suse suse
tru64.polarhome.com
ubuntu ubuntu
unixware.polarhome.com unixware.polarhome.com
macosx.polarhome.com ### Test if empty command in process list causes problems macosx.polarhome.com ### Test if empty command in process list causes problems