[LON-CAPA-cvs] cvs: loncom / loncnew loncron /init.d loncontrol

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Oct 2003 15:36:21 -0000


albertel		Tue Oct 14 11:36:21 2003 EDT

  Modified files:              
    /loncom	loncnew loncron 
    /loncom/init.d	loncontrol 
  Log:
  - making it easier to run loncnew,
     /etc/init.d/loncontrol startnew
     /etc/init.d/loncontrol restartnew
    will now start loncnew in place of lonc 
  
  
Index: loncom/loncnew
diff -u loncom/loncnew:1.27 loncom/loncnew:1.28
--- loncom/loncnew:1.27	Tue Oct  7 07:23:03 2003
+++ loncom/loncnew	Tue Oct 14 11:36:21 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # lonc maintains the connections to remote computers
 #
-# $Id: loncnew,v 1.27 2003/10/07 11:23:03 foxr Exp $
+# $Id: loncnew,v 1.28 2003/10/14 15:36:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -45,6 +45,12 @@
 
 # Change log:
 #    $Log: loncnew,v $
+#    Revision 1.28  2003/10/14 15:36:21  albertel
+#    - making it easier to run loncnew,
+#       /etc/init.d/loncontrol startnew
+#       /etc/init.d/loncontrol restartnew
+#      will now start loncnew in place of lonc
+#
 #    Revision 1.27  2003/10/07 11:23:03  foxr
 #    Installed and tested code to process reinit in parent server.
 #
@@ -1774,7 +1780,7 @@
     Log("CRITICAL", "Restarting");
     my $execdir = $perlvar{'lonDaemons'};
     unlink("$execdir/logs/lonc.pid");
-    exec("$execdir/lonc");
+    exec("$execdir/loncnew");
 }
 
 =pod
Index: loncom/loncron
diff -u loncom/loncron:1.43 loncom/loncron:1.44
--- loncom/loncron:1.43	Thu Sep 11 15:49:59 2003
+++ loncom/loncron	Tue Oct 14 11:36:21 2003
@@ -51,7 +51,12 @@
 
 sub start_daemon {
     my ($fh,$daemon,$pidfile) = @_;
-    system("$perlvar{'lonDaemons'}/$daemon 2>>$perlvar{'lonDaemons'}/logs/${daemon}_errors");
+    my $progname=$daemon;
+    if ($daemon eq 'lonc' && $ARGV[0] eq 'new') {
+	$progname='loncnew'; 
+	print "new ";
+    }
+    system("$perlvar{'lonDaemons'}/$progname 2>>$perlvar{'lonDaemons'}/logs/${daemon}_errors");
     sleep 2;
     if (-e $pidfile) {
 	print $fh "Seems like it started ...<p>";
Index: loncom/init.d/loncontrol
diff -u loncom/init.d/loncontrol:1.11 loncom/init.d/loncontrol:1.12
--- loncom/init.d/loncontrol:1.11	Tue Sep 16 17:01:39 2003
+++ loncom/init.d/loncontrol	Tue Oct 14 11:36:21 2003
@@ -51,16 +51,26 @@
 if (($command eq "restart") or ($command eq "reload")) {
     print 'Restarting LON-CAPA'."\n";
     print 'Ending LON-CAPA client and daemon processes'."\n";
-    foreach my $daemon ('lonsql','lond','lonc','lonhttpd') {
+    foreach my $daemon ('lonsql','lond','lonc','loncnew','lonhttpd') {
 	&stop_daemon($daemon);
     }
     print 'Starting LON-CAPA client and daemon processes (please be patient)'.
 	"\n";
     system("su -c '/home/httpd/perl/loncron' www");
 }
+elsif (($command eq "restartnew") or ($command eq "reloadnew")) {
+    print 'Restarting LON-CAPA'."\n";
+    print 'Ending LON-CAPA client and daemon processes'."\n";
+    foreach my $daemon ('lonsql','lond','lonc','loncnew','lonhttpd') {
+	&stop_daemon($daemon);
+    }
+    print 'Starting LON-CAPA client and daemon processes (please be patient)'.
+	"\n";
+    system("su -c '/home/httpd/perl/loncron new' www");
+}
 elsif ($command eq "stop") {
     print 'Stopping LON-CAPA'."\n";
-    foreach my $daemon ('lonsql','lond','lonc','lonhttpd') {
+    foreach my $daemon ('lonsql','lond','lonc','loncnew','lonhttpd') {
 	&stop_daemon($daemon);
     }
 }
@@ -69,6 +79,12 @@
     print 'Starting LON-CAPA client and daemon processes (please be patient)'.
 	"\n"; 
     system("su -c '/home/httpd/perl/loncron' www");
+}
+elsif ($command eq "startnew") {
+    print 'Starting LON-CAPA'."\n";
+    print 'Starting LON-CAPA client and daemon processes (please be patient)'.
+	"\n"; 
+    system("su -c '/home/httpd/perl/loncron new' www");
 }
 elsif ($command eq "status") {
     $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`;