Fixed bug #46120: Suspend should suspend (at least local) children'.

This commit is contained in:
Ole Tange 2015-10-04 23:46:12 +02:00
parent b8339bc707
commit 6775eb3082
3 changed files with 18 additions and 0 deletions

View file

@ -3125,6 +3125,9 @@ sub save_original_signal_handler {
%Global::original_sig = %SIG; %Global::original_sig = %SIG;
$SIG{TERM} = sub {}; # Dummy until jobs really start $SIG{TERM} = sub {}; # Dummy until jobs really start
$SIG{ALRM} = 'IGNORE'; $SIG{ALRM} = 'IGNORE';
# Allow Ctrl-Z to suspend and `fg` to continue
$SIG{TSTP} = sub { kill "STOP", map { -$_ } keys %Global::running, $$; };
$SIG{CONT} = sub { kill "CONT", map { -$_ } keys %Global::running, $$; };
} }
sub list_running_jobs { sub list_running_jobs {

View file

@ -1,5 +1,13 @@
#!/bin/bash #!/bin/bash
echo 'bug #46120: Suspend should suspend (at least local) children'
stdout bash -i -c 'stdout /usr/bin/time -f CPUTIME=%U parallel --timeout 5 burnP6 ::: 1 | grep -q CPUTIME=1 &
sleep 1.1;
kill -TSTP -$!;
sleep 5;
fg;
echo Zero=OK $?' | grep -v '\[1\]'
cat <<'EOF' | sed -e 's/;$/; /;' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1 cat <<'EOF' | sed -e 's/;$/; /;' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
echo '### -L -n with pipe' echo '### -L -n with pipe'
seq 14 | parallel --pipe -k -L 3 -n 2 'cat;echo 6 Ln line record' seq 14 | parallel --pipe -k -L 3 -n 2 'cat;echo 6 Ln line record'

View file

@ -1,3 +1,10 @@
bug #46120: Suspend should suspend (at least local) children
2048 0a:c0:70:5b:ec:f6:c2:de:67:c3:53:7f:29:81:65:54 tange@hk (RSA1)
8192 e1:95:e3:ff:99:a6:3a:b5:53:5a:54:59:d0:72:94:7f /home/tange/.ssh/id_rsa (RSA)
4096 94:2a:e3:cb:6b:66:63:21:13:51:8d:e8:4e:09:49:b2 /home/tange/.ssh/id_rsa_openindiana (RSA)
stdout /usr/bin/time -f CPUTIME=%U parallel --timeout 5 burnP6 ::: 1 | grep --colour=auto -q CPUTIME=1
Zero=OK 0
echo '### -L -n with pipe' echo '### -L -n with pipe'
### -L -n with pipe ### -L -n with pipe
seq 14 | parallel --pipe -k -L 3 -n 2 'cat;echo 6 Ln line record' seq 14 | parallel --pipe -k -L 3 -n 2 'cat;echo 6 Ln line record'