IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 15, 2017, 5:29:00 PM (9 years ago)
Author:
watersc1
Message:

Fixed bug that caused zombie child processes to accumumlate. Added time check to stop md5sum calculations during night time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/raw_MD5_check.pl

    r40033 r40037  
    77
    88my $clients = 4;
     9my $start_time = 8;
     10my $end_time = 18; # +1, as it goes until the hour changes.
    911
    1012my $t0 = time();
     
    9799                    } # End scan over subdirectories to check.
    98100                   
     101                    my $all_children_done = 0;
     102
     103                    while ($all_children_done != 1) {
     104                        $all_children_done = 1;
     105
     106                        for (my $j = 0; $j < $clients; $j++) {
     107                            if ($Cpid[$j] == -1) { next; } # hasn't started yet
     108                            my $child = waitpid($Cpid[$j],WNOHANG);
     109                            if ($child != 0) {
     110                                $time = time;
     111                                $dt = $time - $t0;
     112                                print "$dt $i $j $Cpid[$j] $work[$j] FINISH $child\n";
     113                                $work[$j] = '';
     114                            } # End print client report.
     115                            else {
     116                                $all_children_done = 0;
     117                            }
     118                        } # End scan over clients for reaping.
     119                       
     120                        sleep(5);
     121                    }
     122
    99123                } # End scan over top level directories
    100124                exit(0);
     
    138162            return(0);
    139163        }
     164       
     165        my @localtime = localtime();
     166        while (($localtime[2] < $start_time)||($localtime[2] > $end_time)) {
     167            sleep(600);
     168            @localtime = localtime();
     169        }
     170
    140171        open(O,">$out_log");
    141172        my @files = <${directory}/*ota*fits>;
Note: See TracChangeset for help on using the changeset viewer.