--- loncom/lond	2003/05/08 22:07:48	1.129
+++ loncom/lond	2003/10/08 20:31:28	1.132.2.2
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.129 2003/05/08 22:07:48 albertel Exp $
+# $Id: lond,v 1.132.2.2 2003/10/08 20:31:28 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -73,7 +73,7 @@ my $DEBUG = 0;		       # Non zero to ena
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.129 $'; #' stupid emacs
+my $VERSION='$Revision: 1.132.2.2 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid;
 my $currentdomainid;
@@ -276,17 +276,17 @@ sub checkchildren {
             alarm(300);
 	    &logthis('Child '.$_.' did not respond');
 	    kill 9 => $_;
-	    $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
-	    $subj="LON: $currenthostid 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.$_`;
+	    #$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
+	    #$subj="LON: $currenthostid 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.$_`;
 	    alarm(0);
 	  }
         }
     }
     $SIG{ALRM} = 'DEFAULT';
-    $SIG{__DIE__} = \&cathcexception;
+    $SIG{__DIE__} = \&catchcexception;
 }
 
 # --------------------------------------------------------------------- Logging
@@ -826,7 +826,7 @@ sub make_new_child {
 			     if ($pwdcorrect) {
 				 my $execdir=$perlvar{'lonDaemons'};
 				 &Debug("Opening lcpasswd pipeline");
-				 my $pf = IO::File->new("|$execdir/lcpasswd > /home/www/lcpasswd.log");
+				 my $pf = IO::File->new("|$execdir/lcpasswd > $perlvar{'lonDaemons'}/logs/lcpasswd.log");
 				 print $pf "$uname\n$npass\n$npass\n";
 				 close $pf;
 				 my $err = $?;
@@ -2026,7 +2026,7 @@ sub make_passwd_file {
 	    {
 		&Debug("Executing external: ".$execpath);
 		&Debug("user  = ".$uname.", Password =". $npass);
-		my $se = IO::File->new("|$execpath > /home/www/lcuseradd.log");
+		my $se = IO::File->new("|$execpath > $perlvar{'lonDaemons'}/logs/lcuseradd.log");
 		print $se "$uname\n";
 		print $se "$npass\n";
 		print $se "$npass\n";
@@ -2080,8 +2080,8 @@ sub userload {
 	my $curtime=time;
 	while ($filename=readdir(LONIDS)) {
 	    if ($filename eq '.' || $filename eq '..') {next;}
-	    my ($atime)=(stat($perlvar{'lonIDsDir'}.'/'.$filename))[8];
-	    if ($curtime-$atime < 3600) { $numusers++; }
+	    my ($mtime)=(stat($perlvar{'lonIDsDir'}.'/'.$filename))[9];
+	    if ($curtime-$mtime < 3600) { $numusers++; }
 	}
 	closedir(LONIDS);
     }
@@ -2090,6 +2090,7 @@ sub userload {
     if ($maxuserload) {
 	$userloadpercent=100*$numusers/$maxuserload;
     }
+    $userloadpercent=sprintf("%.2f",$userloadpercent);
     return $userloadpercent;
 }