--- loncom/lond 2004/08/02 21:02:20 1.205.2.1 +++ loncom/lond 2004/07/22 23:08:43 1.206 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.205.2.1 2004/08/02 21:02:20 albertel Exp $ +# $Id: lond,v 1.206 2004/07/22 23:08:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,14 +50,13 @@ use File::Copy; use LONCAPA::ConfigFileEdit; use LONCAPA::lonlocal; use LONCAPA::lonssl; -use Fcntl qw(:flock); my $DEBUG = 0; # Non zero to enable debug log entries. my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.205.2.1 $'; #' stupid emacs +my $VERSION='$Revision: 1.206 $'; #' stupid emacs my $remoteVERSION; my $currenthostid; my $currentdomainid; @@ -1146,11 +1145,10 @@ sub checkchildren { &logthis('Going to check on the children'); my $docdir=$perlvar{'lonDocRoot'}; foreach (sort keys %children) { - #sleep 1; + sleep 1; unless (kill 'USR1' => $_) { &logthis ('Child '.$_.' is dead'); &logstatus($$.' is dead'); - delete($children{$_}); } } sleep 5; @@ -1168,7 +1166,6 @@ sub checkchildren { #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.$_`; - delete($children{$_}); alarm(0); } } @@ -1176,7 +1173,6 @@ sub checkchildren { $SIG{ALRM} = 'DEFAULT'; $SIG{__DIE__} = \&catchexception; &status("Finished checking children"); - &logthis('Finished Checking children'); } # --------------------------------------------------------------------- Logging @@ -1221,19 +1217,17 @@ sub logstatus { &status("Doing logging"); my $docdir=$perlvar{'lonDocRoot'}; { + my $fh=IO::File->new(">>$docdir/lon-status/londstatus.txt"); + print $fh $$."\t".$clientname."\t".$currenthostid."\t" + .$status."\t".$lastlog."\t $keymode\n"; + $fh->close(); + } + &status("Finished londstatus.txt"); + { my $fh=IO::File->new(">$docdir/lon-status/londchld/$$.txt"); print $fh $status."\n".$lastlog."\n".time."\n$keymode"; $fh->close(); } - &status("Finished $$.txt"); - { - open(LOG,">>$docdir/lon-status/londstatus.txt"); - flock(LOG,LOCK_EX); - print LOG $$."\t".$clientname."\t".$currenthostid."\t" - .$status."\t".$lastlog."\t $keymode\n"; - flock(DB,LOCK_UN); - close(LOG); - } &status("Finished logging"); } @@ -2238,11 +2232,14 @@ sub make_new_child { # ------------------------------------------------------------------------- put } elsif ($userinput =~ /^put/) { if(isClient) { - my ($cmd,$udom,$uname,$namespace,$what) + my ($cmd,$udom,$uname,$namespace,$what,@extras) =split(/:/,$userinput); $namespace=~s/\//\_/g; $namespace=~s/\W//g; if ($namespace ne 'roles') { + if (@extras) { + $what .= ':'.join(':',@extras); + } chomp($what); my $proname=propath($udom,$uname); my $now=time;