--- loncom/loncron 2018/08/08 11:49:48 1.108 +++ 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.108 2018/08/08 11:49:48 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="); + } } } @@ -1057,8 +1062,8 @@ sub reset_nosslverify_pids { if ($sslrem{$host}) { if (ref($pids_by_host{$host}) eq 'HASH') { if (ref($pids_by_host{$host}{'insecure'}) eq 'HASH') { - if (keys($pids_by_host{$host}{'insecure'})) { - foreach my $pid (keys($pids_by_host{$host}{'insecure'})) { + if (keys(%{$pids_by_host{$host}{'insecure'}})) { + foreach my $pid (keys(%{$pids_by_host{$host}{'insecure'}})) { if (open(PIPE,"ps -o ppid= -p $pid |")) { my $ppid =) { + &log($fh,"$line"); + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $notices++; } + } + close (DFH); + } + &log($fh,"