version 1.63, 2002/01/20 18:01:43
|
version 1.65, 2002/02/05 17:17:49
|
Line 47
|
Line 47
|
# 12/20 Scott Harrison |
# 12/20 Scott Harrison |
# 12/22 Gerd Kortemeyer |
# 12/22 Gerd Kortemeyer |
# YEAR=2002 |
# YEAR=2002 |
# 01/20/02 Gerd Kortemeyer |
# 01/20/02,02/05 Gerd Kortemeyer |
### |
### |
|
|
# based on "Perl Cookbook" ISBN 1-56592-243-3 |
# based on "Perl Cookbook" ISBN 1-56592-243-3 |
Line 194 sub checkchildren {
|
Line 194 sub checkchildren {
|
&logthis('Going to check on the children'); |
&logthis('Going to check on the children'); |
$docdir=$perlvar{'lonDocRoot'}; |
$docdir=$perlvar{'lonDocRoot'}; |
foreach (sort keys %children) { |
foreach (sort keys %children) { |
unlink("$docdir/lon-status/londchld/$_.txt"); |
|
sleep 1; |
sleep 1; |
unless (kill 'USR1' => $_) { |
unless (kill 'USR1' => $_) { |
&logthis ('Child '.$_.' is dead'); |
&logthis ('Child '.$_.' is dead'); |
Line 205 sub checkchildren {
|
Line 204 sub checkchildren {
|
foreach (sort keys %children) { |
foreach (sort keys %children) { |
unless (-e "$docdir/lon-status/londchld/$_.txt") { |
unless (-e "$docdir/lon-status/londchld/$_.txt") { |
&logthis('Child '.$_.' did not respond'); |
&logthis('Child '.$_.' did not respond'); |
kill -9 => $_; |
kill 9 => $_; |
} |
} |
} |
} |
} |
} |
Line 244 sub initnewstatus {
|
Line 243 sub initnewstatus {
|
my $now=time; |
my $now=time; |
my $local=localtime($now); |
my $local=localtime($now); |
print $fh "LOND status $local - parent $$\n\n"; |
print $fh "LOND status $local - parent $$\n\n"; |
|
opendir(DIR,"$docdir/lon-status/londchld"); |
|
while ($filename=readdir(DIR)) { |
|
unlink("$docdir/lon-status/londchld/$filename"); |
|
} |
|
closedir(DIR); |
} |
} |
|
|
# -------------------------------------------------------------- Status setting |
# -------------------------------------------------------------- Status setting |
Line 701 sub make_new_child {
|
Line 705 sub make_new_child {
|
$fpnow.='/'.$fpparts[$i]; |
$fpnow.='/'.$fpparts[$i]; |
unless (-e $fpnow) { |
unless (-e $fpnow) { |
unless (mkdir($fpnow,0777)) { |
unless (mkdir($fpnow,0777)) { |
$fperror="error:$!\n"; |
$fperror="error:$!"; |
} |
} |
} |
} |
} |
} |