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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 11 May 2004 21:14:23 -0000


albertel		Tue May 11 17:14:23 2004 EDT

  Modified files:              
    /loncom	loncron 
  Log:
  - get rid of old 'new' hack for starting using loncnew and use real cmdline arg
  
  
Index: loncom/loncron
diff -u loncom/loncron:1.49 loncom/loncron:1.50
--- loncom/loncron:1.49	Tue May 11 17:08:55 2004
+++ loncom/loncron	Tue May 11 17:14:23 2004
@@ -2,7 +2,7 @@
 
 # Housekeeping program, started by cron, loncontrol and loncron.pl
 #
-# $Id: loncron,v 1.49 2004/05/11 21:08:55 albertel Exp $
+# $Id: loncron,v 1.50 2004/05/11 21:14:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -77,9 +77,9 @@
 }
 
 sub start_daemon {
-    my ($fh,$daemon,$pidfile) = @_;
+    my ($fh,$daemon,$pidfile,$args) = @_;
     my $progname=$daemon;
-    if ($daemon eq 'lonc' && $ARGV[0] eq 'new') {
+    if ($daemon eq 'lonc' && $args eq 'new') {
 	$progname='loncnew'; 
 	print "new ";
     }
@@ -103,7 +103,7 @@
 }
 
 sub checkon_daemon {
-    my ($fh,$daemon,$maxsize,$sendusr1)=@_;
+    my ($fh,$daemon,$maxsize,$sendusr1,$args)=@_;
 
     &log($fh,'<hr /><a name="'.$daemon.'" /><h2>'.$daemon.'</h2><h3>Log</h3><p style="white-space: pre;"><tt>');
     printf("%-10s ",$daemon);
@@ -152,7 +152,7 @@
 	    '</font><br>');
 	&log($fh,"<h3>$daemon not running, trying to start</h3>");
 	
-	if (&start_daemon($fh,$daemon,$pidfile)) {
+	if (&start_daemon($fh,$daemon,$pidfile,$args)) {
 	    &log($fh,"<h3>$daemon at pid $daemonpid responding</h3>");
 	    $simplestatus{$daemon}='restarted';
 	    print "started\n";
@@ -161,7 +161,7 @@
 	    &log($fh,"<h3>$daemon at pid $daemonpid not responding</h3>");
 	    &log($fh,"<p>Give it one more try ...</p>");
 	    print " ";
-	    if (&start_daemon($fh,$daemon,$pidfile)) {
+	    if (&start_daemon($fh,$daemon,$pidfile,$args)) {
 		&log($fh,"<h3>$daemon at pid $daemonpid responding</h3>");
 		$simplestatus{$daemon}='restarted';
 		print "started\n";
@@ -465,6 +465,8 @@
 	    if ($answer eq 'con_lost') {
 		$bad++;
 		$warnings++;
+	    } else {
+		$good++; #self connection
 	    }
 	}
 	if ($answer =~ /con_lost/) { print(" $tryserver down\n"); }
@@ -659,7 +661,9 @@
     if (!$justcheckconnections) {
 	&checkon_daemon($fh,'lonsql',200000);
 	&checkon_daemon($fh,'lond',40000,1);
-	&checkon_daemon($fh,'lonc',40000,1);
+	my $args='new';
+	if ($oldlonc) { $args = ''; }
+	&checkon_daemon($fh,'lonc',40000,1,$args);
 	&checkon_daemon($fh,'lonhttpd',40000);
     }
     if (!$justcheckdaemons) {