--- loncom/loncnew 2003/07/02 01:12:35 1.12 +++ loncom/loncnew 2003/07/02 01:31:55 1.13 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # lonc maintains the connections to remote computers # -# $Id: loncnew,v 1.12 2003/07/02 01:12:35 foxr Exp $ +# $Id: loncnew,v 1.13 2003/07/02 01:31:55 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,10 +46,8 @@ # Change log: # $Log: loncnew,v $ -# Revision 1.12 2003/07/02 01:12:35 foxr -# - Add some debugging to killthemall -# - Add better error handling to LondReadable -# - Remove tick logging in the timer handler. +# Revision 1.13 2003/07/02 01:31:55 foxr +# Added kill -HUP logic (restart). # # Revision 1.11 2003/06/25 01:54:44 foxr # Fix more problems with transaction failure. @@ -1434,7 +1432,7 @@ ShowStatus("Parent keeping the flock"); $SIG{INT} = \&KillThemAll; $SIG{TERM} = \&KillThemAll; - +$SIG{HUP} = \&Restart; while(1) { $deadchild = wait(); @@ -1449,6 +1447,24 @@ while(1) { } =pod + +=head1 Restart + +Signal handler for HUP... all children are killed and +we self restart. This is an el-cheapo way to re read +the config file. + +=cut + +sub Restart { + KillThemAll; # First kill all the children. + Log("CRITICAL", "Restarting"); + my $execdir = $perlvar{'lonDaemons'}; + unlink("$execdir/logs/lonc.pid"); + exec("$execdir/lonc"); +} + +=pod =head1 KillThemAll