Diff for /loncom/lond between versions 1.64 and 1.68.2.1

version 1.64, 2002/01/20 18:28:31 version 1.68.2.1, 2002/02/06 14:18:09
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 163  $children               = 0;        # cu Line 163  $children               = 0;        # cu
 sub REAPER {                        # takes care of dead children  sub REAPER {                        # takes care of dead children
     $SIG{CHLD} = \&REAPER;      $SIG{CHLD} = \&REAPER;
     my $pid = wait;      my $pid = wait;
     $children --;      if (defined($children{$pid})) {
     &logthis("Child $pid died");   &logthis("Child $pid died");
     delete $children{$pid};   $children --;
    delete $children{$pid};
       } else {
    &logthis("Unknown Child $pid died");
       }
 }  }
   
 sub HUNTSMAN {                      # signal handler for SIGINT  sub HUNTSMAN {                      # signal handler for SIGINT
Line 204  sub checkchildren { Line 208  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 => $_;
       $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
       $subj="LON: $perlvar{'lonHostID'} killed lond process $_";
       my $result=`echo 'Killed lond process $_.' | mailto $emailto -s '$subj' > /dev/null`;
       $execdir=$perlvar{'lonDaemons'};
       $result=`/bin/cp $execdir/logs/lond.log $execdir/logs/lond.log.$_`
         }          }
     }      }
 }  }
Line 525  sub make_new_child { Line 534  sub make_new_child {
               while (my $userinput=<$client>) {                while (my $userinput=<$client>) {
                 chomp($userinput);                  chomp($userinput);
                 &status('Processing '.$hostid{$clientip}.': '.$userinput);                  &status('Processing '.$hostid{$clientip}.': '.$userinput);
                   &logthis('Processing '.$hostid{$clientip}.': '.$userinput);
                 my $wasenc=0;                  my $wasenc=0;
                 alarm(120);                  alarm(120);
 # ------------------------------------------------------------ See if encrypted  # ------------------------------------------------------------ See if encrypted
Line 541  sub make_new_child { Line 551  sub make_new_child {
     $userinput=substr($userinput,0,$cmdlength);      $userinput=substr($userinput,0,$cmdlength);
                     $wasenc=1;                      $wasenc=1;
   }    }
  }    &logthis('Decrypted '.$hostid{$clientip}.': '.$userinput);
         }
   
 # ------------------------------------------------------------- Normal commands  # ------------------------------------------------------------- Normal commands
 # ------------------------------------------------------------------------ ping  # ------------------------------------------------------------------------ ping
    if ($userinput =~ /^ping/) {     if ($userinput =~ /^ping/) {
Line 705  sub make_new_child { Line 717  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:$!";
                                    }                                     }
                                }                                 }
                            }                             }
Line 1365  sub make_new_child { Line 1377  sub make_new_child {
 # -------------------------------------------------------------------- complete  # -------------------------------------------------------------------- complete
    alarm(0);     alarm(0);
                    &status('Listening to '.$hostid{$clientip});                     &status('Listening to '.$hostid{$clientip});
                      &logthis('Completed '.$userinput.' Listening to '.$hostid{$clientip});
        }         }
 # --------------------------------------------- client unknown or fishy, refuse  # --------------------------------------------- client unknown or fishy, refuse
             } else {              } else {

Removed from v.1.64  
changed lines
  Added in v.1.68.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>