--- loncom/lond 2003/09/15 10:03:52 1.143 +++ loncom/lond 2003/09/16 09:47:01 1.144 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.143 2003/09/15 10:03:52 foxr Exp $ +# $Id: lond,v 1.144 2003/09/16 09:47:01 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,6 +60,9 @@ # 09/08/2003 Ron Fox: Told lond to take care of change logging so we # don't have to remember it: # $Log: lond,v $ +# Revision 1.144 2003/09/16 09:47:01 foxr +# Added skeletal support for SIGUSR2 (update hosts.tab) +# # Revision 1.143 2003/09/15 10:03:52 foxr # Completed and tested code for pushfile. # @@ -97,7 +100,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.143 $'; #' stupid emacs +my $VERSION='$Revision: 1.144 $'; #' stupid emacs my $remoteVERSION; my $currenthostid; my $currentdomainid; @@ -485,6 +488,19 @@ sub HUPSMAN { # sig exec("$execdir/lond"); # here we go again } +# +# Called in response to a USR2 signal. +# - Reread hosts.tab +# - All children connected to hosts that were removed from hosts.tab +# are killed via SIGINT +# - All children connected to previously existing hosts are sent SIGUSR1 +# - Our internal hosts hash is updated to reflect the new contents of +# hosts.tab causing connections from hosts added to hosts.tab to +# now be honored. +# +sub UpdateHosts { +} + sub checkchildren { &initnewstatus(); &logstatus(); @@ -727,7 +743,7 @@ $SIG{CHLD} = \&REAPER; $SIG{INT} = $SIG{TERM} = \&HUNTSMAN; $SIG{HUP} = \&HUPSMAN; $SIG{USR1} = \&checkchildren; - +$SIG{USR2} = \&UpdateHosts; # -------------------------------------------------------------- @@ -2501,6 +2517,17 @@ each connection is logged. =item * +SIGUSR2 + +Parent Signal assignment: + $SIG{USR2} = \&UpdateHosts + +Child signal assignment: + NONE + + +=item * + SIGCHLD Parent signal assignment: