) {
chomp($line);
my ($timestamp,$host,$log)=split(/\:/,$line);
$log=&unescape($log);
my $include=1;
if (($filters{'start'}) && ($timestamp<$filters{'start'}))
{ $include=0; }
if (($filters{'end'}) && ($timestamp>$filters{'end'}))
{ $include=0; }
if (($filters{'action'} eq 'Role') && ($log !~/^Role/))
{ $include=0; }
if (($filters{'action'} eq 'log') && ($log!~/^Log/)) { $include=0; }
if (($filters{'action'} eq 'check') && ($log!~/^Check/))
{ $include=0; }
if ($include) {
push(@results,$timestamp.':'.$host.':'.&escape($log));
}
}
close IN;
return join('&',sort(@results));
}
########################################################
########################################################
=pod
=item Functions required for forking
=over 4
=item REAPER
REAPER takes care of dead children.
=item HUNTSMAN
Signal handler for SIGINT.
=item HUPSMAN
Signal handler for SIGHUP
=item DISCONNECT
Disconnects from database.
=back
=cut
########################################################
########################################################
sub REAPER { # takes care of dead children
$SIG{CHLD} = \&REAPER;
my $pid = wait;
$children --;
&logthis("Child $pid died");
delete $children{$pid};
}
sub HUNTSMAN { # signal handler for SIGINT
local($SIG{CHLD}) = 'IGNORE'; # we're going to kill our children
kill 'INT' => keys %children;
my $execdir=$perlvar{'lonDaemons'};
unlink("$execdir/logs/lonsql.pid");
&logthis("CRITICAL: Shutting down");
$unixsock = "mysqlsock";
my $port="$perlvar{'lonSockDir'}/$unixsock";
unlink($port);
exit; # clean up with dignity
}
sub HUPSMAN { # signal handler for SIGHUP
local($SIG{CHLD}) = 'IGNORE'; # we're going to kill our children
kill 'INT' => keys %children;
close($server); # free up socket
&logthis("CRITICAL: Restarting");
my $execdir=$perlvar{'lonDaemons'};
$unixsock = "mysqlsock";
my $port="$perlvar{'lonSockDir'}/$unixsock";
unlink($port);
exec("$execdir/lonsql"); # here we go again
}
sub DISCONNECT {
$dbh->disconnect or
&logthis("WARNING: Couldn't disconnect from database ".
" $DBI::errstr : $@");
exit;
}
=pod
=back
=cut
500 Internal Server Error
Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.
More information about this error may be available
in the server error log.