[LON-CAPA-cvs] cvs: loncom / lond

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 16 Sep 2003 09:47:02 -0000


foxr		Tue Sep 16 05:47:02 2003 EDT

  Modified files:              
    /loncom	lond 
  Log:
  Added skeletal support for SIGUSR2 (update hosts.tab)
  
  
Index: loncom/lond
diff -u loncom/lond:1.143 loncom/lond:1.144
--- loncom/lond:1.143	Mon Sep 15 06:03:52 2003
+++ loncom/lond	Tue Sep 16 05:47:01 2003
@@ -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 $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 @@
     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{INT}  = $SIG{TERM} = \&HUNTSMAN;
 $SIG{HUP}  = \&HUPSMAN;
 $SIG{USR1} = \&checkchildren;
-
+$SIG{USR2} = \&UpdateHosts;
 
 
 # --------------------------------------------------------------
@@ -2498,6 +2514,17 @@
  When invoked for the B<lond> parent I<PID>,
 SIGUSR1 is sent to all the children, and the status of
 each connection is logged.
+
+=item *
+
+SIGUSR2
+
+Parent Signal assignment:
+    $SIG{USR2} = \&UpdateHosts
+
+Child signal assignment:
+    NONE
+
 
 =item *