Diff for /loncom/loncnew between versions 1.84 and 1.87

version 1.84, 2007/04/11 16:20:26 version 1.87, 2007/06/18 22:49:52
Line 158  sub LogPerm { Line 158  sub LogPerm {
     my $now=time;      my $now=time;
     my $local=localtime($now);      my $local=localtime($now);
     my $fh=IO::File->new(">>$execdir/logs/lonnet.perm.log");      my $fh=IO::File->new(">>$execdir/logs/lonnet.perm.log");
       chomp($message);
     print $fh "$now:$message:$local\n";      print $fh "$now:$message:$local\n";
 }  }
   
Line 608  sub CompleteTransaction { Line 609  sub CompleteTransaction {
  StartClientReply($Transaction, $data);   StartClientReply($Transaction, $data);
     } else { # Delete deferred transaction file.      } else { # Delete deferred transaction file.
  Log("SUCCESS", "A delayed transaction was completed");   Log("SUCCESS", "A delayed transaction was completed");
  LogPerm("S:$Transaction->getClient() :".$Transaction->getRequest());   LogPerm("S:".$Transaction->getClient().":".$Transaction->getRequest());
  unlink $Transaction->getFile();   unlink($Transaction->getFile());
     }      }
 }  }
   
Line 1382  sub ClientRequest { Line 1383  sub ClientRequest {
     $data = $data.$thisread; # Append new data.      $data = $data.$thisread; # Append new data.
     $watcher->data($data);      $watcher->data($data);
     if($data =~ /\n$/) { # Request entirely read.      if($data =~ /\n$/) { # Request entirely read.
  if($data eq "close_connection_exit\n") {   if ($data eq "close_connection_exit\n") {
     Log("CRITICAL",      Log("CRITICAL",
  "Request Close Connection ... exiting");   "Request Close Connection ... exiting");
     CloseAllLondConnections();      CloseAllLondConnections();
     exit;      exit;
    } elsif ($data eq "reset_retries\n") {
       Log("INFO", "Resetting Connection Retries.");
       $ConnectionRetriesLeft = $ConnectionRetries;
       &UpdateStatus();
       my $Transaction = LondTransaction->new($data);
       $Transaction->SetClient($socket);
       StartClientReply($Transaction, "ok\n");
       $watcher->cancel();
       return;
  }   }
  Debug(8, "Complete transaction received: ".$data);   Debug(8, "Complete transaction received: ".$data);
  if($LogTransactions) {   if ($LogTransactions) {
     Log("SUCCESS", "Transaction: '$data'"); # Transaction has \n.      Log("SUCCESS", "Transaction: '$data'"); # Transaction has \n.
  }   }
  my $Transaction = LondTransaction->new($data);   my $Transaction = LondTransaction->new($data);
Line 1897  sub parent_listen { Line 1907  sub parent_listen {
   
 sub parent_clean_up {  sub parent_clean_up {
     my ($loncapa_host) = @_;      my ($loncapa_host) = @_;
     Debug(-1, "parent_clean_up: $loncapa_host");      Debug(1, "parent_clean_up: $loncapa_host");
   
     my $socket_file = &GetLoncSocketPath($loncapa_host);      my $socket_file = &GetLoncSocketPath($loncapa_host);
     unlink($socket_file); # No problem if it doesn't exist yet [startup e.g.]      unlink($socket_file); # No problem if it doesn't exist yet [startup e.g.]
Line 2149  SIGHUP.  Responds to sigint and sigterm. Line 2159  SIGHUP.  Responds to sigint and sigterm.
   
 sub KillThemAll {  sub KillThemAll {
     Debug(2, "Kill them all!!");      Debug(2, "Kill them all!!");
     local($SIG{CHLD}) = 'IGNORE';      # Our children >will< die.      
     foreach my $pid (keys %ChildPid) {      #local($SIG{CHLD}) = 'IGNORE';
       # Our children >will< die.
       # but we need to catch their death and cleanup after them in case this is 
       # a restart set of kills
       my @allpids = keys(%ChildPid);
       foreach my $pid (@allpids) {
  my $serving = $ChildPid{$pid};   my $serving = $ChildPid{$pid};
  ShowStatus("Nicely Killing lonc for $serving pid = $pid");   ShowStatus("Nicely Killing lonc for $serving pid = $pid");
  Log("CRITICAL", "Nicely Killing lonc for $serving pid = $pid");   Log("CRITICAL", "Nicely Killing lonc for $serving pid = $pid");
  kill 'QUIT' => $pid;   kill 'QUIT' => $pid;
     }      }
       ShowStatus("Finished killing child processes off.");
 }  }
   
   

Removed from v.1.84  
changed lines
  Added in v.1.87


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