--- loncom/Attic/lonc 2000/02/08 17:34:24 1.5 +++ loncom/Attic/lonc 2000/02/10 23:20:13 1.6 @@ -64,8 +64,8 @@ sub REAPER { # ta $SIG{CHLD} = \&REAPER; my $pid = wait; my $wasserver=$children{$pid}; - &logthis( - "CRITICAL: Child $pid for server $wasserver died"); + &logthis("CRITICAL: " + ."Child $pid for server $wasserver died ($childatt{$wasserver})"); delete $children{$pid}; delete $childpid{$wasserver}; my $port = "$perlvar{'lonSockDir'}/$wasserver"; @@ -90,13 +90,14 @@ sub HUPSMAN { # sig } sub USRMAN { - %childatt=(); &logthis("USR1: Trying to establish connections again"); foreach $thisserver (keys %hostip) { $answer=subreply("ping",$thisserver); - &logthis( - "USR1: Ping $thisserver (pid >$childpid{$thisserver}<): >$answer<"); + &logthis("USR1: Ping $thisserver " + ."(pid >$childpid{$thisserver}<, $childatt{thisserver} attempts): " + ." >$answer<"); } + %childatt=(); } # -------------------------------------------------- Non-critical communication @@ -178,13 +179,12 @@ while (1) { # See who died and start new one foreach $thisserver (keys %hostip) { if (!$childpid{$thisserver}) { - if ($childatt{$thisserver}<=$childmaxattempt) { - my $ainfoatt=1*$childatt{$thisserver}; + if ($childatt{$thisserver}<=$childmaxattempts) { + $childatt{$thisserver}++; &logthis( "INFO: Trying to reconnect for $thisserver " - ."($ainfoatt of $childmaxattempts attempts)"); + ."($childatt{$thisserver} of $childmaxattempts attempts)"); make_new_child($thisserver); - $childatt{$thisserver}++; } } }