[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /auth lonlogin.pm lonroles.pm /build Makefile /cgi clusterstatus.pl /interface lonerrorhandler.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 05 Aug 2003 12:52:23 -0000


This is a MIME encoded message

--www1060087943
Content-Type: text/plain

www		Tue Aug  5 08:52:23 2003 EDT

  Modified files:              
    /loncom	loncapa_apache.conf 
    /loncom/auth	lonlogin.pm lonroles.pm 
    /loncom/build	Makefile 
    /loncom/cgi	clusterstatus.pl 
    /loncom/interface	lonerrorhandler.pm 
  Log:
  Bug #1968: version information more easily available
  
  
--www1060087943
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20030805085223.txt"

Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.58 loncom/loncapa_apache.conf:1.59
--- loncom/loncapa_apache.conf:1.58	Fri Aug  1 13:25:40 2003
+++ loncom/loncapa_apache.conf	Tue Aug  5 08:52:22 2003
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.58 2003/08/01 17:25:40 www Exp $
+## $Id: loncapa_apache.conf,v 1.59 2003/08/05 12:52:22 www Exp $
 ##
 
 #
@@ -759,6 +759,7 @@
 # ******** THESE "SHOULD" NEVER BE ALTERED BY THE USER ************************
 # ====================================== Internal Settings / Perl Configuration
 
+PerlSetVar	 lonVersion   '<!-- VERSION -->'
 PerlSetVar       lonIDsDir    /home/httpd/lonIDs
 PerlSetVar       lonTabDir    /home/httpd/lonTabs
 PerlSetVar       lonUsersDir  /home/httpd/lonUsers
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.43 loncom/auth/lonlogin.pm:1.44
--- loncom/auth/lonlogin.pm:1.43	Wed Jul 16 16:42:31 2003
+++ loncom/auth/lonlogin.pm	Tue Aug  5 08:52:23 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.43 2003/07/16 20:42:31 www Exp $
+# $Id: lonlogin.pm,v 1.44 2003/08/05 12:52:23 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -81,6 +81,7 @@
     my $tabdir  = $r->dir_config('lonTabDir');
     my $include = $r->dir_config('lonIncludes');
     my $expire  = $r->dir_config('lonExpire');
+    my $version = $r->dir_config('lonVersion');
 
 # --------------------------------------------- Default values for login fields
 
@@ -432,7 +433,8 @@
      <b>&nbsp;&nbsp;&nbsp;System Administration:</b><br />
      <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sysadm</tt><br />
      <b>&nbsp;&nbsp;&nbsp;Server Administration:</b><br />
-     <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$servadm<br />&nbsp;</tt>
+     <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$servadm</tt><br />&nbsp;<br />
+     &nbsp;&nbsp;&nbsp;$version
     </small>
    </td>
 
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.64 loncom/auth/lonroles.pm:1.65
--- loncom/auth/lonroles.pm:1.64	Thu Jul 24 21:16:29 2003
+++ loncom/auth/lonroles.pm	Tue Aug  5 08:52:23 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.64 2003/07/25 01:16:29 bowersj2 Exp $
+# $Id: lonroles.pm,v 1.65 2003/08/05 12:52:23 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -570,7 +570,10 @@
 	    }
 	}
     }
-
+    if ($advanced) {
+	$r->print('<p><small><i>This is LON-CAPA '.
+		  $r->dir_config('lonVersion').'</i></small></p>');
+    }
     $r->print("</body></html>\n");
     return OK;
 } 
Index: loncom/build/Makefile
diff -u loncom/build/Makefile:1.152 loncom/build/Makefile:1.153
--- loncom/build/Makefile:1.152	Mon Jul 28 21:06:36 2003
+++ loncom/build/Makefile	Tue Aug  5 08:52:23 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 
-# $Id: Makefile,v 1.152 2003/07/29 01:06:36 albertel Exp $
+# $Id: Makefile,v 1.153 2003/08/05 12:52:23 www Exp $
 
 # TYPICAL USAGE of this Makefile is primarily for two targets:
 # "make build" and "make install".
@@ -124,8 +124,10 @@
 	@echo "             procedure (via the UPDATE command)"
 	@echo "postinstall: double-check things after installation"
 	@echo "VERSION: tag the filesystem with version information inside"
-	@echo "         /etc/loncapa-release"
+	@echo "         /etc/loncapa-release and"
+	@echo "         /home/httpd/html/lon-status/version.txt"
 	@echo "aboutVERSION: place version information inside about.html"
+	@echo "              and loncapa_apache.conf"
 	@echo "*** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***"
 	@echo "Makefile.configinstall: generate a Makefile for configuration"
 	@echo "                        files; built dynamically from"
@@ -364,12 +366,16 @@
 	fi
 	cp -v $(SOURCE)/loncom/license/about.html \
 	$(SOURCE)/loncom/license/about.html.orig
+	cp -v $(SOURCE)/loncom/loncapa_apache.conf \
+	$(SOURCE)/loncom/loncapa_apache.conf.orig
 	make aboutVERSION
 	cd $(SOURCE); \
 	tar --no-recursion --numeric-owner --files-from MANIFEST \
 	-h -czf $(DIRTARGET).tar.gz 2>tar_WARNINGS || [ "0" == "0" ]
 	mv -v $(SOURCE)/loncom/license/about.html.orig \
 	$(SOURCE)/loncom/license/about.html
+	mv -v $(SOURCE)/loncom/loncapa_apache.conf.orig \
+	$(SOURCE)/loncom/loncapa_apache.conf
 	cat $(SOURCE)/tar_WARNINGS | \
 	xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
 	rm -f $(SOURCE)/tar_WARNINGS
@@ -410,6 +416,9 @@
 	install -d $(TARGET)/etc
 	echo -n "LON-CAPA release $(VERSION)-" > $(TARGET)/etc/loncapa-release
 	date +"%Y%m%d" >> $(TARGET)/etc/loncapa-release
+	install -d $(TARGET)/home/httpd/html/lon-status
+	echo -n "$(VERSION)-" > $(TARGET)/home/httpd/html/lon-status/version.txt
+	date +"%Y%m%d" >> $(TARGET)/home/httpd/html/lon-status/version.txt
 
 aboutVERSION:
 	cat $(SOURCE)/loncom/license/about.html | \
@@ -417,6 +426,11 @@
 	$(SOURCE)/loncom/license/about.html.new
 	mv -v $(SOURCE)/loncom/license/about.html.new \
 	$(SOURCE)/loncom/license/about.html
+	cat $(SOURCE)/loncom/loncapa_apache.conf | \
+	perl -e '$$d=`date +"%Y%m%d"`;chomp($$d);while(<>){s/\<\!\-\- VERSION \-\-\>/$(VERSION)-$$d/; print;}' > \
+	$(SOURCE)/loncom/loncapa_apache.conf.new
+	mv -v $(SOURCE)/loncom/loncapa_apache.conf.new \
+	$(SOURCE)/loncom/loncapa_apache.conf
 
 # ========= *** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***
 
Index: loncom/cgi/clusterstatus.pl
diff -u loncom/cgi/clusterstatus.pl:1.14 loncom/cgi/clusterstatus.pl:1.15
--- loncom/cgi/clusterstatus.pl:1.14	Fri Aug  1 15:20:26 2003
+++ loncom/cgi/clusterstatus.pl	Tue Aug  5 08:52:23 2003
@@ -3,7 +3,7 @@
 # The LearningOnline Network with CAPA
 # Cluster Status
 #
-# $Id: clusterstatus.pl,v 1.14 2003/08/01 19:20:26 www Exp $
+# $Id: clusterstatus.pl,v 1.15 2003/08/05 12:52:23 www Exp $
 
 use lib '/home/httpd/lib/perl/';
 use LONCAPA::Configuration;
@@ -206,6 +206,10 @@
 	print ("<tr><td bgcolor='#DDBBBB'><font color='#552222' size='+2'>$trouble</font></td></tr>");
     }
     print "<tr><td bgcolor='#BBBBBB'>";
+# version
+    if ($host{$local.'_version'}) {
+	print "<br />Version: ".$host{$local.'_version'}
+    }
 # load
     if (($host{$local.'_load_doomed'}>0.5) || ($mode eq 'load_doomed')) {
 	print "<br />Load: ".$host{$local.'_load'}
@@ -393,6 +397,15 @@
 	    $host{$local.'_errors'}=$loncron{'errors'};
 	}
     }
+# -- Check version
+    &statuslist($local,'Version');
+    my $version=&request($local,'/lon-status/version.txt',7200);
+    if ($version eq 'local_error') {
+	$host{$local.'_version'}='Could not determine.';
+	$host{$local.'_unresponsive_doomed'}++;
+    } else {
+	$host{$local.'_version'}=$version;
+    }
 # -- Check user status
     &statuslist($local,'Users');
     my %userstatus=&replyhash($local,'/cgi-bin/userstatus.pl?simple',600);
@@ -570,6 +583,9 @@
 	my $count=0;
 	foreach $local (sort keys %hostname) {
 	    my $trouble='';
+	    if ($host{$local.'_unresponsive_doomed'}>3) {
+		$trouble='Does not respond to several queries.<br />';
+	    }
 	    if ($host{$local.'_errors'}) {
 		$trouble='Has loncron errors.<br />';
 	    } elsif ($host{$local.'_loncron_doomed'}>600) {
Index: loncom/interface/lonerrorhandler.pm
diff -u loncom/interface/lonerrorhandler.pm:1.3 loncom/interface/lonerrorhandler.pm:1.4
--- loncom/interface/lonerrorhandler.pm:1.3	Wed Dec 19 12:17:46 2001
+++ loncom/interface/lonerrorhandler.pm	Tue Aug  5 08:52:23 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Internal Server Error Handler
 #
-# $Id: lonerrorhandler.pm,v 1.3 2001/12/19 17:17:46 albertel Exp $
+# $Id: lonerrorhandler.pm,v 1.4 2003/08/05 12:52:23 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -25,16 +25,12 @@
 #
 # http://www.lon-capa.org/
 #
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer
-#
+
 package Apache::lonerrorhandler;
 
 use strict;
 use Apache::Constants qw(:common);
+use Apache::loncommon;
 
 sub handler {
     my $r = shift;
@@ -54,18 +50,19 @@
      my $recipients=$r->dir_config('lonAdmEMail').','.
                      $r->dir_config('lonSysEMail'); 
 
+     my $version=$r->dir_config('lonVersion');
+
      my $req=$r->as_string();
      $req=~s/\"/\'\'/g;
 
+    my $bodytag=&Apache::loncommon::bodytag('Could Not Process Request');
 # --------------------------------------------------- Print login screen header
     $r->print(<<ENDDOCUMENT);
 <html>
 <head>
 <title>The LearningOnline Network with CAPA</title>
 </head>
-<body bgcolor="#FFFFFF">
-<img src="/adm/lonKaputt/lonlogo_broken.gif" align=left>
-<h1>Sorry!</h1>
+$bodytag
 <h2>Somewhere something went wrong - please help us to find out what.</h2>
 Please take a moment to fill out the form below. Your information, together
 with internal debugging information, will be emailed to the system and server
@@ -81,6 +78,7 @@
 <h3>Do you have any guesses why this might have happened?</h3>
 <textarea name=guesses cols=50 rows=5>
 </textarea>
+<input type=hidden name=version value="$version">
 <input type=hidden name=environment value="$env"><p>
 <input type=submit value="Send Information">
 </form>

--www1060087943--