Changeset 87 for trunk/oarutils


Ignore:
Timestamp:
Jun 3, 2012, 12:24:54 AM (12 years ago)
Author:
g7moreau
Message:
  • Force subshell
  • Notify sub-subprocess and not subprocess...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r86 r87  
    243243         };
    244244
    245       #$job_cmd =~ s/(\s+##.*)$//; # suppress comment
     245      #$job_cmd =~ s/(#.*)$// if $sig_transmit; # suppress comment
    246246
    247247      # set job environment, run it and clean
     
    258258      $fh->print("cd $current_dir\n");
    259259      if ($sig_transmit) {
    260          $fh->print("trap 'kill -$sig_checkpoint \$(jobs -p)' $sig_checkpoint\n");
     260         $fh->print("trap 'jobs -p|xargs -r ps -o pid --no-headers --ppid|xargs -r kill -$sig_checkpoint' $sig_checkpoint\n");
    261261         $fh->print("echo \$\$ > $job_pidfile\n");
    262          $fh->print("{\n");
     262         $fh->print("(\n");
    263263         $fh->print("$job_cmd\n");
    264          $fh->print("} $job_stdout $job_stderr \&\n");
     264         $fh->print(") $job_stdout $job_stderr \&\n");
    265265         $fh->print("while [ \$(jobs -p | wc -l) -gt 0 ]\n");
    266266         $fh->print("do\n");
Note: See TracChangeset for help on using the changeset viewer.