[LON-CAPA-cvs] cvs: loncom /build Makefile doc/loncapafiles logcleanup.piml

www lon-capa-cvs@mail.lon-capa.org
Fri, 08 Jul 2005 15:46:44 -0000


www		Fri Jul  8 11:46:44 2005 EDT

  Added files:                 
    /doc/loncapafiles	logcleanup.piml 

  Modified files:              
    /loncom/build	Makefile 
  Log:
  Bug #3996: log spam removal
  
  
Index: loncom/build/Makefile
diff -u loncom/build/Makefile:1.176 loncom/build/Makefile:1.177
--- loncom/build/Makefile:1.176	Thu Jul  7 21:31:08 2005
+++ loncom/build/Makefile	Fri Jul  8 11:46:42 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 
-# $Id: Makefile,v 1.176 2005/07/08 01:31:08 albertel Exp $
+# $Id: Makefile,v 1.177 2005/07/08 15:46:42 www Exp $
 
 # TYPICAL USAGE of this Makefile is primarily for two targets:
 # "make build" and "make install".
@@ -119,6 +119,7 @@
 	@echo "         system"
 	@echo "sanitycheck: probe for common errors and recommend fixes to"
 	@echo "             the user"
+	@echo "logcleanup: clean spurious logfile entries"
 	@echo "clean_file_permissions: Remove erroneous keys from the  "
 	@echo "    file_permissions.db"
 	@echo "accesscount_seed: Migrate the access counting mechanism from "
@@ -425,6 +426,11 @@
 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
 	tee -a WARNINGS
 
+logcleanup:
+	cat $(SOURCE)/doc/loncapafiles/logcleanup.piml | \
+	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
+	tee -a WARNINGS
+
 updatequery:
 	cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \
 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
@@ -486,6 +492,7 @@
 	make html_parser_check
 	make cron_lpmlcheck
 	make sanitycheck
+	make logcleanup
 	make sendmail_fix
 	make ownership_fix
 	make wrap_setuid

Index: doc/loncapafiles/logcleanup.piml
+++ doc/loncapafiles/logcleanup.piml
<!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
	"http://lpml.sourceforge.net/DTD/piml.dtd">
<!-- logcleanup.piml -->

<!-- $Id: logcleanup.piml,v 1.1 2005/07/08 15:46:40 www Exp $ -->

<!--

This file is part of the LearningOnline Network with CAPA (LON-CAPA).

LON-CAPA is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

LON-CAPA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with LON-CAPA; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

/home/httpd/html/adm/gpl.txt

http://www.lon-capa.org/

-->

<piml>
<targetroot>/</targetroot>
<files>
<file>
<target dist='default'>/home/httpd/perl/logs/lonnet.perm.log</target>
<perlscript mode='fg'>
unless
    (-e '<TARGET />') # Does file exist?
  {
    print("**** ERROR **** Missing <TARGET />\n");
  } else {
      system('cp <TARGET /> <TARGET />.old');
      open(IN,'<TARGET />.old');
      open(OUT,'&gt;<TARGET />');
      while ($line=&lt;IN&gt;) {
         unless ($line=~/signalled to death/) {
            print OUT $line;
         }
      }
      close(IN);
      close(OUT);
      system('chown www:www <TARGET />'); 
      system('rm <TARGET />.old'); 
  }
</perlscript>
</file>
</files>
</piml>