--- loncom/loncron 2018/10/25 02:48:56 1.109 +++ loncom/loncron 2018/10/25 03:27:22 1.110 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.109 2018/10/25 02:48:56 raeburn Exp $ +# $Id: loncron,v 1.110 2018/10/25 03:27:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,17 +113,20 @@ sub checkon_daemon { my $result; &log($fh,'
');
printf("%-15s ",$daemon);
- if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){
- open (DFH,"tail -n25 $perlvar{'lonDaemons'}/logs/$daemon.log|");
- while (my $line=
Unable to start $daemon
"); } } - - if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){ - &log($fh,""); - open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/$daemon.log|"); - while (my $line="); + if ($fh) { + if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){ + &log($fh,") { - &log($fh,"$line"); - if ($line=~/WARNING/) { $notices++; } - if ($line=~/CRITICAL/) { $notices++; } - }; - close (DFH); - &log($fh,"
"); + if (open(DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/$daemon.log|")) { + while (my $line="); + } } }) { + &log($fh,"$line"); + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $notices++; } + } + close (DFH); + } + &log($fh,"