--- loncom/loncron 2001/08/27 13:54:50 1.22 +++ loncom/loncron 2001/09/04 17:58:44 1.23 @@ -267,13 +267,13 @@ print $fh "
'; -open (DFH,"tail -n40 /etc/httpd/logs/access_log|"); +open (DFH,"tail -n25 /etc/httpd/logs/access_log|"); while ($line=) { print $fh "$line" }; close (DFH); print $fh "
"; -open (DFH,"tail -n50 /etc/httpd/logs/error_log|"); +open (DFH,"tail -n25 /etc/httpd/logs/error_log|"); while ($line=) { print $fh "$line"; if ($line=~/\[error\]/) { $notices++; } @@ -289,7 +289,7 @@ my $restartflag=1; if ($perlvar{'lonRole'} eq "library") { print $fh ' lonsql
Log
'; - + print "lonsql\n"; if (-e "$perlvar{'lonDaemons'}/logs/lonsql.log"){ open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lonsql.log|"); while ($line="; my $lonsqlfile="$perlvar{'lonDaemons'}/logs/lonsql.pid"; - + + $restartflag=1; + if (-e $lonsqlfile) { my $lfh=IO::File->new("$lonsqlfile"); my $lonsqlpid=<$lfh>; @@ -314,28 +316,19 @@ if ($perlvar{'lonRole'} eq "library") { } else { $errors++; $errors++; print $fh ") { @@ -303,7 +303,9 @@ if ($perlvar{'lonRole'} eq "library") { print $fh " lonsql at pid $lonsqlpid not responding
"; - # Intelligently handle this. - # Possibility #1: there is no process - # Solution: remove .pid file and restart - if (getpgrp($lonsqlpid)==-1) { - unlink($lonsqlfile); $restartflag=1; - } - else { - # Possibility #2: there is a live process that is not - # responding for an unknown reason - # Solution: kill parent and children processes, remove .pid - # and restart - `killall -9 lonsql`; - unlink($lonsqlfile); - $restartflag=1; - } - } print $fh - "Deciding to clean up stale .pid file and restart lonsql
"; + "Decided to clean up stale .pid file and restart lonsql
"; + } } if ($restartflag==1) { $errors++; + print $fh '
Killall lonsql: '. + system('killall lonsql').' - '; + sleep 60; + print $fh unlink($lonsqlfile).' - '. + system('killall -9 lonsql'). + '
'; print $fh "lonsql not running, trying to start
"; system( "$perlvar{'lonDaemons'}/lonsql 2>>$perlvar{'lonDaemons'}/logs/lonsql_errors"); @@ -392,9 +385,10 @@ if ($perlvar{'lonRole'} eq "library") { # ------------------------------------------------------------------------ lond print $fh 'lond
Log
'; +print "lond\n"; if (-e "$perlvar{'lonDaemons'}/logs/lond.log"){ -open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lond.log|"); +open (DFH,"tail -n25 $perlvar{'lonDaemons'}/logs/lond.log|"); while ($line=) { print $fh "$line"; if ($line=~/INFO/) { $notices++; } @@ -418,27 +412,18 @@ if (-e $londfile) { } else { $errors++; print $fh " lond at pid $londpid not responding
"; - # Intelligently handle this. - # Possibility #1: there is no process - # Solution: remove .pid file and restart - if (getpgrp($londpid)==-1) { - unlink($londfile); - $restartflag=1; - } - else { - # Possibility #2: there is a live process that is not responding - # for an unknown reason - # Solution: kill parent and children processes, remove .pid and restart - `killall -9 lond`; - unlink($londfile); - $restartflag=1; - } + $restartflag=1; print $fh - "Deciding to clean up stale .pid file and restart lond
"; + "Decided to clean up stale .pid file and restart lond
"; } } if ($restartflag==1) { $errors++; + print $fh '
Killall lond: '. + system('killall lond').' - '; + sleep 60; + print $fh unlink($londfile).' - '.system('killall -9 lond'). + '
'; print $fh "lond not running, trying to start
"; system( "$perlvar{'lonDaemons'}/lond 2>>$perlvar{'lonDaemons'}/logs/lond_errors"); @@ -494,9 +479,10 @@ if ($size>40000) { # ------------------------------------------------------------------------ lonc print $fh 'lonc
Log
'; +print "lonc\n"; if (-e "$perlvar{'lonDaemons'}/logs/lonc.log"){ -open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lonc.log|"); +open (DFH,"tail -n25 $perlvar{'lonDaemons'}/logs/lonc.log|"); while ($line=) { print $fh "$line"; if ($line=~/INFO/) { $notices++; } @@ -521,27 +507,19 @@ if (-e $loncfile) { } else { $errors++; print $fh " lonc at pid $loncpid not responding
"; - # Intelligently handle this. - # Possibility #1: there is no process - # Solution: remove .pid file and restart - if (getpgrp($loncpid)==-1) { - unlink($loncfile); - $restartflag=1; - } - else { - # Possibility #2: there is a live process that is not responding - # for an unknown reason # Solution: kill parent and children processes, remove .pid and restart - `killall -9 lonc`; - unlink($loncfile); $restartflag=1; - } print $fh - "Deciding to clean up stale .pid file and restart lonc
"; + "Decided to clean up stale .pid file and restart lonc
"; } } if ($restartflag==1) { $errors++; + print $fh '
Killall lonc: '. + system('killall lonc').' - '; + sleep 60; + print $fh unlink($loncfile).' - '.system('killall -9 lonc'). + '
'; print $fh "lonc not running, trying to start
"; system( "$perlvar{'lonDaemons'}/lonc 2>>$perlvar{'lonDaemons'}/logs/lonc_errors"); @@ -598,6 +576,7 @@ if ($size>40000) { # ---------------------------------------------------------------------- lonnet print $fh 'lonnet
Temp Log
'; +print "lonnet\n"; if (-e "$perlvar{'lonDaemons'}/logs/lonnet.log"){ open (DFH,"tail -n50 $perlvar{'lonDaemons'}/logs/lonnet.log|"); while ($line=) { @@ -655,6 +634,7 @@ print $fh ""; # ------------------------------------------------------------ Delayed messages print $fh ' Delayed Messages
'; +print "buffers\n"; print $fh 'Scanning Permanent Log
'; @@ -691,12 +671,13 @@ print $fh "Total Error Count: $total $now=time; $date=localtime($now); print $fh "
$date ($now)