--- loncom/lond	2008/04/21 15:27:34	1.400
+++ loncom/lond	2009/05/08 12:02:39	1.415
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.400 2008/04/21 15:27:34 raeburn Exp $
+# $Id: lond,v 1.415 2009/05/08 12:02:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,7 +59,7 @@ my $DEBUG = 0;		       # Non zero to ena
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.400 $'; #' stupid emacs
+my $VERSION='$Revision: 1.415 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -142,6 +142,16 @@ my @adderrors    = ("ok",
 		    "lcuseradd Password mismatch");
 
 
+# This array are the errors from lcinstallfile:
+
+my @installerrors = ("ok",
+		     "Initial user id of client not that of www",
+		     "Usage error, not enough command line arguments",
+		     "Source file name does not exist",
+		     "Destination file name does not exist",
+		     "Some file operation failed",
+		     "Invalid table filename."
+		     );
 
 #
 #   Statistics that are maintained and dislayed in the status line.
@@ -398,6 +408,7 @@ sub isClient {
 #
 sub ReadManagerTable {
 
+    &Debug("Reading manager table");
     #   Clean out the old table first..
 
    foreach my $key (keys %managers) {
@@ -520,11 +531,9 @@ sub AdjustHostContents {
 }
 #
 #   InstallFile: Called to install an administrative file:
-#       - The file is created with <name>.tmp
-#       - The <name>.tmp file is then mv'd to <name>
-#   This lugubrious procedure is done to ensure that we are never without
-#   a valid, even if dated, version of the file regardless of who crashes
-#   and when the crash occurs.
+#       - The file is created int a temp directory called <name>.tmp
+#       - lcinstall file is called to install the file.
+#         since the web app has no direct write access to the table directory
 #
 #  Parameters:
 #       Name of the file
@@ -532,11 +541,16 @@ sub AdjustHostContents {
 #  Return:
 #      nonzero - success.
 #      0       - failure and $! has an errno.
+# Assumptions:
+#    File installtion is a relatively infrequent
 #
 sub InstallFile {
 
     my ($Filename, $Contents) = @_;
-    my $TempFile = $Filename.".tmp";
+#     my $TempFile = $Filename.".tmp";
+    my $exedir = $perlvar{'lonDaemons'};
+    my $tmpdir = $exedir.'/tmp/';
+    my $TempFile = $tmpdir."TempTableFile.tmp";
 
     #  Open the file for write:
 
@@ -550,11 +564,27 @@ sub InstallFile {
     print $fh ($Contents); 
     $fh->close;			# In case we ever have a filesystem w. locking
 
-    chmod(0660, $TempFile);
+    chmod(0664, $TempFile);	# Everyone can write it.
 
-    # Now we can move install the file in position.
-    
-    move($TempFile, $Filename);
+    # Use lcinstall file to put the file in the table directory...
+
+    &Debug("Opening pipe to $exedir/lcinstallfile $TempFile $Filename");
+    my $pf = IO::File->new("| $exedir/lcinstallfile   $TempFile $Filename > $exedir/logs/lcinstallfile.log");
+    close $pf;
+    my $err = $?;
+    &Debug("Status is $err");
+    if ($err != 0) {
+	my $msg = $err;
+	if ($err < @installerrors) {
+	    $msg = $installerrors[$err];
+	}
+	&logthis("Install failed for table file $Filename : $msg");
+	return 0;
+    }
+
+    # Remove the temp file:
+
+    unlink($TempFile);
 
     return 1;
 }
@@ -562,8 +592,13 @@ sub InstallFile {
 
 #
 #   ConfigFileFromSelector: converts a configuration file selector
-#                 (one of host or domain at this point) into a 
-#                 configuration file pathname.
+#                 into a configuration file pathname.
+#                 It's probably no longer necessary to preserve
+#                 special handling of hosts or domain as those
+#                 files have been superceded by dns_hosts, dns_domain.
+#                 The default action is just to prepend the directory
+#                 and append .tab
+#
 #
 #  Parameters:
 #      selector  - Configuration file selector.
@@ -580,7 +615,7 @@ sub ConfigFileFromSelector {
     } elsif ($selector eq "domain") {
 	$tablefile = $tabledir."domain.tab";
     } else {
-	return undef;
+	$tablefile =  $tabledir.$selector.'.tab';
     }
     return $tablefile;
 
@@ -603,6 +638,7 @@ sub ConfigFileFromSelector {
 sub PushFile {
     my $request = shift;    
     my ($command, $filename, $contents) = split(":", $request, 3);
+    &Debug("PushFile");
     
     #  At this point in time, pushes for only the following tables are
     #  supported:
@@ -619,20 +655,7 @@ sub PushFile {
     if(! (defined $tablefile)) {
 	return "refused";
     }
-    #
-    # >copy< the old table to the backup table
-    #        don't rename in case system crashes/reboots etc. in the time
-    #        window between a rename and write.
-    #
-    my $backupfile = $tablefile;
-    $backupfile    =~ s/\.tab$/.old/;
-    if(!CopyFile($tablefile, $backupfile)) {
-	&logthis('<font color="green"> CopyFile from '.$tablefile." to ".$backupfile." failed </font>");
-	return "error:$!";
-    }
-    &logthis('<font color="green"> Pushfile: backed up '
-	    .$tablefile." to $backupfile</font>");
-    
+
     #  If the file being pushed is the host file, we adjust the entry for ourself so that the
     #  IP will be our current IP as looked up in dns.  Note this is only 99% good as it's possible
     #  to conceive of conditions where we don't have a DNS entry locally.  This is possible in a 
@@ -645,6 +668,7 @@ sub PushFile {
 
     #  Install the new file:
 
+    &logthis("Installing new $tablefile contents:\n$contents");
     if(!InstallFile($tablefile, $contents)) {
 	&logthis('<font color="red"> Pushfile: unable to install '
 	 .$tablefile." $! </font>");
@@ -1198,7 +1222,7 @@ sub user_authorization_type {
 #    a reply is written to the client.
 sub push_file_handler {
     my ($cmd, $tail, $client) = @_;
-
+    &Debug("In push file handler");
     my $userinput = "$cmd:$tail";
 
     # At this time we only know that the IP of our partner is a valid manager
@@ -1206,7 +1230,8 @@ sub push_file_handler {
     # spoofing).
 
     my $cert = &GetCertificate($userinput);
-    if(&ValidManager($cert)) { 
+    if(&ValidManager($cert)) {
+	&Debug("Valid manager: $client");
 
 	# Now presumably we have the bona fides of both the peer host and the
 	# process making the request.
@@ -1215,6 +1240,7 @@ sub push_file_handler {
 	&Reply($client, \$reply, $userinput);
 
     } else {
+	&logthis("push_file_handler $client is not valid");
 	&Failure( $client, "refused\n", $userinput);
     } 
     return 1;
@@ -1538,7 +1564,7 @@ sub ls3_handler {
     } elsif ($alternate_root ne '') {
         $dir_root = $alternate_root;
     }
-    if ($dir_root ne '') {
+    if (($dir_root ne '') && ($dir_root ne '/')) {
         if ($ulsdir =~ /^\//) {
             $ulsdir = $dir_root.$ulsdir;
         } else {
@@ -1587,6 +1613,46 @@ sub ls3_handler {
 }
 &register_handler("ls3", \&ls3_handler, 0, 1, 0);
 
+sub server_timezone_handler {
+    my ($cmd,$tail,$client) = @_;
+    my $userinput = "$cmd:$tail";
+    my $timezone;
+    my $clockfile = '/etc/sysconfig/clock'; # Fedora/CentOS/SuSE
+    my $tzfile = '/etc/timezone'; # Debian/Ubuntu
+    if (-e $clockfile) {
+        if (open(my $fh,"<$clockfile")) {
+            while (<$fh>) {
+                next if (/^[\#\s]/);
+                if (/^(?:TIME)?ZONE\s*=\s*['"]?\s*([\w\/]+)/) {
+                    $timezone = $1;
+                    last;
+                }
+            }
+            close($fh);
+        }
+    } elsif (-e $tzfile) {
+        if (open(my $fh,"<$tzfile")) {
+            $timezone = <$fh>;
+            close($fh);
+            chomp($timezone);
+            if ($timezone =~ m{^Etc/(\w+)$}) {
+                $timezone = $1;
+            }
+        }
+    }
+    &Reply($client,\$timezone,$userinput); # This supports debug logging.
+    return 1;
+}
+&register_handler("servertimezone", \&server_timezone_handler, 0, 1, 0);
+
+sub server_loncaparev_handler {
+    my ($cmd,$tail,$client) = @_;
+    my $userinput = "$cmd:$tail";
+    &Reply($client,\$perlvar{'lonVersion'},$userinput);
+    return 1;
+}
+&register_handler("serverloncaparev", \&server_loncaparev_handler, 0, 1, 0);
+
 #   Process a reinit request.  Reinit requests that either
 #   lonc or lond be reinitialized so that an updated 
 #   host.tab or domain.tab can be processed.
@@ -3615,7 +3681,17 @@ sub put_course_id_hash_handler {
 #                            key, value pairs in the item's hash, or as a 
 #                            colon-separated list of (in order) description,
 #                            institutional code, and course owner.
-#    
+#                 selfenrollonly - filter by courses allowing self-enrollment  
+#                                  now or in the future (selfenrollonly = 1).
+#                 catfilter - filter by course category, assigned to a course 
+#                             using manually defined categories (i.e., not
+#                             self-cataloging based on on institutional code).   
+#                 showhidden - include course in results even if course  
+#                              was set to be excluded from course catalog (DC only).
+#                 caller -  if set to 'coursecatalog', courses set to be hidden
+#                           from course catalog will be excluded from results (unless
+#                           overridden by "showhidden".
+#
 #     $client  - The socket open on the client.
 # Returns:
 #    1     - Continue processing.
@@ -3626,7 +3702,8 @@ sub dump_course_id_handler {
     my $userinput = "$cmd:$tail";
 
     my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter,
-        $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly) =split(/:/,$tail);
+        $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter,$showhidden,
+        $caller) =split(/:/,$tail);
     my $now = time;
     if (defined($description)) {
 	$description=&unescape($description);
@@ -3667,6 +3744,9 @@ sub dump_course_id_handler {
     if (defined($regexp_ok)) {
         $regexp_ok=&unescape($regexp_ok);
     }
+    if (defined($catfilter)) {
+        $catfilter=&unescape($catfilter);
+    }
     my $unpack = 1;
     if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && 
         $typefilter eq '.') {
@@ -3697,20 +3777,43 @@ sub dump_course_id_handler {
                     $unesc_val{'inst_code'} = $items->{'inst_code'};
                     $unesc_val{'owner'} = $items->{'owner'};
                     $unesc_val{'type'} = $items->{'type'};
-                    $selfenroll_types = $items->{'selfenroll_types'};
-                    $selfenroll_end = $items->{'selfenroll_end_date'};
-                    if ($selfenrollonly) {
-                        next if (!$selfenroll_types);
-                        if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) {
-                            next;
+                }
+                $selfenroll_types = $items->{'selfenroll_types'};
+                $selfenroll_end = $items->{'selfenroll_end_date'};
+                if ($selfenrollonly) {
+                    next if (!$selfenroll_types);
+                    if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) {
+                        next;
+                    }
+                }
+                if ($catfilter ne '') {
+                    next if ($items->{'categories'} eq '');
+                    my @categories = split('&',$items->{'categories'}); 
+                    next if (@categories == 0);
+                    my @subcats = split('&',$catfilter);
+                    my $matchcat = 0;
+                    foreach my $cat (@categories) {
+                        if (grep(/^\Q$cat\E$/,@subcats)) {
+                            $matchcat = 1;
+                            last;
                         }
                     }
+                    next if (!$matchcat);
+                }
+                if ($caller eq 'coursecatalog') {
+                    if ($items->{'hidefromcat'} eq 'yes') {
+                        next if !$showhidden;
+                    }
                 }
             } else {
+                next if ($catfilter ne '');
+                next if ($selfenrollonly); 
                 $is_hash =  0;
                 my @courseitems = split(/:/,$value);
                 $lasttime = pop(@courseitems);
-                next if ($lasttime<$since);
+                if ($hashref->{$lasttime_key} eq '') {
+                    next if ($lasttime<$since);
+                }
 	        ($val{'descr'},$val{'inst_code'},$val{'owner'},$val{'type'}) = @courseitems;
             }
             my $match = 1;
@@ -4240,12 +4343,12 @@ sub dump_domainroles_handler {
             my ($start,$end) = split(/:/,&unescape($value));
             my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,&unescape($key));
             unless ($startfilter eq '.' || !defined($startfilter)) {
-                if ($start >= $startfilter) {
+                if ((defined($start)) && ($start >= $startfilter)) {
                     $match = 0;
                 }
             }
             unless ($endfilter eq '.' || !defined($endfilter)) {
-                if ($end <= $endfilter) {
+                if ((defined($end)) && ($end <= $endfilter)) {
                     $match = 0;
                 }
             }
@@ -5907,7 +6010,7 @@ sub make_new_child {
 	if ($clientip eq '127.0.0.1') {
 	    $outsideip=&Apache::lonnet::get_host_ip($perlvar{'lonHostID'});
 	}
-
+	&ReadManagerTable();
 	my $clientrec=defined(&Apache::lonnet::get_hosts_from_ip($outsideip));
 	my $ismanager=($managers{$outsideip}    ne undef);
 	$clientname  = "[unknonwn]";
@@ -7081,3 +7184,406 @@ linux
 Server/Process
 
 =cut
+
+
+=pod
+
+=head1 LOG MESSAGES
+
+The messages below can be emitted in the lond log.  This log is located
+in ~httpd/perl/logs/lond.log  Many log messages have HTML encapsulation
+to provide coloring if examined from inside a web page. Some do not.
+Where color is used, the colors are; Red for sometihhng to get excited
+about and to follow up on. Yellow for something to keep an eye on to
+be sure it does not get worse, Green,and Blue for informational items.
+
+In the discussions below, sometimes reference is made to ~httpd
+when describing file locations.  There isn't really an httpd 
+user, however there is an httpd directory that gets installed in the
+place that user home directories go.  On linux, this is usually
+(always?) /home/httpd.
+
+
+Some messages are colorless.  These are usually (not always)
+Green/Blue color level messages.
+
+=over 2
+
+=item (Red)  LocalConnection rejecting non local: <ip> ne 127.0.0.1
+
+A local connection negotiation was attempted by
+a host whose IP address was not 127.0.0.1.
+The socket is closed and the child will exit.
+lond has three ways to establish an encyrption
+key with a client:
+
+=over 2
+
+=item local 
+
+The key is written and read from a file.
+This is only valid for connections from localhost.
+
+=item insecure 
+
+The key is generated by the server and
+transmitted to the client.
+
+=item  ssl (secure)
+
+An ssl connection is negotiated with the client,
+the key is generated by the server and sent to the 
+client across this ssl connection before the
+ssl connectionis terminated and clear text
+transmission resumes.
+
+=back
+
+=item (Red) LocalConnection: caller is insane! init = <init> and type = <type>
+
+The client is local but has not sent an initialization
+string that is the literal "init:local"  The connection
+is closed and the child exits.
+
+=item Red CRITICAL Can't get key file <error>        
+
+SSL key negotiation is being attempted but the call to
+lonssl::KeyFile  failed.  This usually means that the
+configuration file is not correctly defining or protecting
+the directories/files lonCertificateDirectory or
+lonnetPrivateKey
+<error> is a string that describes the reason that
+the key file could not be located.
+
+=item (Red) CRITICAL  Can't get certificates <error>  
+
+SSL key negotiation failed because we were not able to retrives our certificate
+or the CA's certificate in the call to lonssl::CertificateFile
+<error> is the textual reason this failed.  Usual reasons:
+
+=over 2
+       
+=item Apache config file for loncapa  incorrect:
+ 
+one of the variables 
+lonCertificateDirectory, lonnetCertificateAuthority, or lonnetCertificate
+undefined or incorrect
+
+=item Permission error:
+
+The directory pointed to by lonCertificateDirectory is not readable by lond
+
+=item Permission error:
+
+Files in the directory pointed to by lonCertificateDirectory are not readable by lond.
+
+=item Installation error:                         
+
+Either the certificate authority file or the certificate have not
+been installed in lonCertificateDirectory.
+
+=item (Red) CRITICAL SSL Socket promotion failed:  <err> 
+
+The promotion of the connection from plaintext to SSL failed
+<err> is the reason for the failure.  There are two
+system calls involved in the promotion (one of which failed), 
+a dup to produce
+a second fd on the raw socket over which the encrypted data
+will flow and IO::SOcket::SSL->new_from_fd which creates
+the SSL connection on the duped fd.
+
+=item (Blue)   WARNING client did not respond to challenge 
+
+This occurs on an insecure (non SSL) connection negotiation request.
+lond generates some number from the time, the PID and sends it to
+the client.  The client must respond by echoing this information back.
+If the client does not do so, that's a violation of the challenge
+protocols and the connection will be failed.
+
+=item (Red) No manager table. Nobody can manage!!    
+
+lond has the concept of privileged hosts that
+can perform remote management function such
+as update the hosts.tab.   The manager hosts
+are described in the 
+~httpd/lonTabs/managers.tab file.
+this message is logged if this file is missing.
+
+
+=item (Green) Registering manager <dnsname> as <cluster_name> with <ipaddress>
+
+Reports the successful parse and registration
+of a specific manager. 
+
+=item Green existing host <clustername:dnsname>  
+
+The manager host is already defined in the hosts.tab
+the information in that table, rather than the info in the
+manager table will be used to determine the manager's ip.
+
+=item (Red) Unable to craete <filename>                 
+
+lond has been asked to create new versions of an administrative
+file (by a manager).  When this is done, the new file is created
+in a temp file and then renamed into place so that there are always
+usable administrative files, even if the update fails.  This failure
+message means that the temp file could not be created.
+The update is abandoned, and the old file is available for use.
+
+=item (Green) CopyFile from <oldname> to <newname> failed
+
+In an update of administrative files, the copy of the existing file to a
+backup file failed.  The installation of the new file may still succeed,
+but there will not be a back up file to rever to (this should probably
+be yellow).
+
+=item (Green) Pushfile: backed up <oldname> to <newname>
+
+See above, the backup of the old administrative file succeeded.
+
+=item (Red)  Pushfile: Unable to install <filename> <reason>
+
+The new administrative file could not be installed.  In this case,
+the old administrative file is still in use.
+
+=item (Green) Installed new < filename>.                      
+
+The new administrative file was successfullly installed.                                               
+
+=item (Red) Reinitializing lond pid=<pid>                    
+
+The lonc child process <pid> will be sent a USR2 
+signal.
+
+=item (Red) Reinitializing self                                    
+
+We've been asked to re-read our administrative files,and
+are doing so.
+
+=item (Yellow) error:Invalid process identifier <ident>  
+
+A reinit command was received, but the target part of the 
+command was not valid.  It must be either
+'lond' or 'lonc' but was <ident>
+
+=item (Green) isValideditCommand checking: Command = <command> Key = <key> newline = <newline>
+
+Checking to see if lond has been handed a valid edit
+command.  It is possible the edit command is not valid
+in that case there are no log messages to indicate that.
+
+=item Result of password change for  <username> pwchange_success
+
+The password for <username> was
+successfully changed.
+
+=item Unable to open <user> passwd to change password
+
+Could not rewrite the 
+internal password file for a user
+
+=item Result of password change for <user> : <result>
+                                                                     
+A unix password change for <user> was attempted 
+and the pipe returned <result>  
+
+=item LWP GET: <message> for <fname> (<remoteurl>)
+
+The lightweight process fetch for a resource failed
+with <message> the local filename that should
+have existed/been created was  <fname> the
+corresponding URI: <remoteurl>  This is emitted in several
+places.
+
+=item Unable to move <transname> to <destname>     
+
+From fetch_user_file_handler - the user file was replicated but could not
+be mv'd to its final location.
+
+=item Looking for <domain> <username>              
+
+From user_has_session_handler - This should be a Debug call instead
+it indicates lond is about to check whether the specified user has a 
+session active on the specified domain on the local host.
+
+=item Client <ip> (<name>) hanging up: <input>     
+
+lond has been asked to exit by its client.  The <ip> and <name> identify the
+client systemand <input> is the full exit command sent to the server.
+
+=item Red CRITICAL: ABNORMAL EXIT. child <pid> for server <hostname> died through a crass with this error->[<message>].
+                                                 
+A lond child terminated.  NOte that this termination can also occur when the
+child receives the QUIT or DIE signals.  <pid> is the process id of the child,
+<hostname> the host lond is working for, and <message> the reason the child died
+to the best of our ability to get it (I would guess that any numeric value
+represents and errno value).  This is immediately followed by
+
+=item  Famous last words: Catching exception - <log> 
+
+Where log is some recent information about the state of the child.
+
+=item Red CRITICAL: TIME OUT <pid>                     
+
+Some timeout occured for server <pid>.  THis is normally a timeout on an LWP
+doing an HTTP::GET.
+
+=item child <pid> died                              
+
+The reaper caught a SIGCHILD for the lond child process <pid>
+This should be modified to also display the IP of the dying child
+$children{$pid}
+
+=item Unknown child 0 died                           
+A child died but the wait for it returned a pid of zero which really should not
+ever happen. 
+
+=item Child <which> - <pid> looks like we missed it's death 
+
+When a sigchild is received, the reaper process checks all children to see if they are
+alive.  If children are dying quite quickly, the lack of signal queuing can mean
+that a signal hearalds the death of more than one child.  If so this message indicates
+which other one died. <which> is the ip of a dead child
+
+=item Free socket: <shutdownretval>                
+
+The HUNTSMAN sub was called due to a SIGINT in a child process.  The socket is being shutdown.
+for whatever reason, <shutdownretval> is printed but in fact shutdown() is not documented
+to return anything. This is followed by: 
+
+=item Red CRITICAL: Shutting down                       
+
+Just prior to exit.
+
+=item Free socket: <shutdownretval>                 
+
+The HUPSMAN sub was called due to a SIGHUP.  all children get killsed, and lond execs itself.
+This is followed by:
+
+=item (Red) CRITICAL: Restarting                         
+
+lond is about to exec itself to restart.
+
+=item (Blue) Updating connections                        
+
+(In response to a USR2).  All the children (except the one for localhost)
+are about to be killed, the hosts tab reread, and Apache reloaded via apachereload.
+
+=item (Blue) UpdateHosts killing child <pid> for ip <ip>   
+
+Due to USR2 as above.
+
+=item (Green) keeping child for ip <ip> (pid = <pid>)    
+
+In response to USR2 as above, the child indicated is not being restarted because
+it's assumed that we'll always need a child for the localhost.
+
+
+=item Going to check on the children                
+
+Parent is about to check on the health of the child processes.
+Note that this is in response to a USR1 sent to the parent lond.
+there may be one or more of the next two messages:
+
+=item <pid> is dead                                 
+
+A child that we have in our child hash as alive has evidently died.
+
+=item  Child <pid> did not respond                   
+
+In the health check the child <pid> did not update/produce a pid_.txt
+file when sent it's USR1 signal.  That process is killed with a 9 signal, as it's
+assumed to be hung in some un-fixable way.
+
+=item Finished checking children                   
+ 
+Master processs's USR1 processing is cojmplete.
+
+=item (Red) CRITICAL: ------- Starting ------            
+
+(There are more '-'s on either side).  Lond has forked itself off to 
+form a new session and is about to start actual initialization.
+
+=item (Green) Attempting to start child (<client>)       
+
+Started a new child process for <client>.  Client is IO::Socket object
+connected to the child.  This was as a result of a TCP/IP connection from a client.
+
+=item Unable to determine who caller was, getpeername returned nothing
+                                                  
+In child process initialization.  either getpeername returned undef or
+a zero sized object was returned.  Processing continues, but in my opinion,
+this should be cause for the child to exit.
+
+=item Unable to determine clientip                  
+
+In child process initialization.  The peer address from getpeername was not defined.
+The client address is stored as "Unavailable" and processing continues.
+
+=item (Yellow) INFO: Connection <ip> <name> connection type = <type>
+                                                  
+In child initialization.  A good connectionw as received from <ip>.
+
+=over 2
+
+=item <name> 
+
+is the name of the client from hosts.tab.
+
+=item <type> 
+
+Is the connection type which is either 
+
+=over 2
+
+=item manager 
+
+The connection is from a manager node, not in hosts.tab
+
+=item client  
+
+the connection is from a non-manager in the hosts.tab
+
+=item both
+
+The connection is from a manager in the hosts.tab.
+
+=back
+
+=back
+
+=item (Blue) Certificates not installed -- trying insecure auth
+
+One of the certificate file, key file or
+certificate authority file could not be found for a client attempting
+SSL connection intiation.  COnnection will be attemptied in in-secure mode.
+(this would be a system with an up to date lond that has not gotten a 
+certificate from us).
+
+=item (Green)  Successful local authentication            
+
+A local connection successfully negotiated the encryption key. 
+In this case the IDEA key is in a file (that is hopefully well protected).
+
+=item (Green) Successful ssl authentication with <client>  
+
+The client (<client> is the peer's name in hosts.tab), has successfully
+negotiated an SSL connection with this child process.
+
+=item (Green) Successful insecure authentication with <client>
+                                                   
+
+The client has successfully negotiated an  insecure connection withthe child process.
+
+=item (Yellow) Attempted insecure connection disallowed    
+
+The client attempted and failed to successfully negotiate a successful insecure
+connection.  This can happen either because the variable londAllowInsecure is false
+or undefined, or becuse the child did not successfully echo back the challenge
+string.
+
+
+=back
+
+
+=cut