[Logcheck-commits] CVS logcheck/src

CVS User ttroxell logcheck-devel@lists.alioth.debian.org
Mon, 10 Jan 2005 23:18:11 -0700


Update of /cvsroot/logcheck/logcheck/src
In directory haydn:/tmp/cvs-serv25860/src

Modified Files:
	logcheck logtail 
Log Message:
send logtail errors to STDERR
set logcheck to redirect stderr+stdout both when running logtail
add note in logtail.NEWS about this change


--- /cvsroot/logcheck/logcheck/src/logcheck	2005/01/08 10:04:53	1.101
+++ /cvsroot/logcheck/logcheck/src/logcheck	2005/01/11 06:18:10	1.102
@@ -22,7 +22,7 @@
 # along with Logcheck; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# $Id: logcheck,v 1.101 2005/01/08 10:04:53 ttroxell Exp $
+# $Id: logcheck,v 1.102 2005/01/11 06:18:10 ttroxell Exp $
 
 if [ $UID == 0 ]; then
     echo "logcheck should not be run as root. Use su to invoke logcheck:"
@@ -391,7 +391,7 @@
 	        # assume the log is rotated by savelog(8)
 		    debug "Running logtail on rotated: $file.0"
 		    $LOGTAIL -f $file.0 -o $offsetfile $LOGTAIL_OPTS > \
-			$TMPDIR/logoutput/$(basename $file) \
+			$TMPDIR/logoutput/$(basename $file) 2>&1 \
 			|| error "Could not run logtail or save output"
 		    rm -f $offsetfile \
 		        || error "Could not remove $offsetfile"
@@ -399,7 +399,7 @@
 		# assume the log is rotated by logrotate(8)
 		    debug "Running logtail on rotated: $file.1"
 		    $LOGTAIL -f $file.1 -o $offsetfile $LOGTAIL_OPTS > \
-			$TMPDIR/logoutput/$(basename $file) \
+			$TMPDIR/logoutput/$(basename $file) 2>&1 \
 			|| error "Could not run logtail or save output"
 		    rm -f $offsetfile \
 		        || error "Could not remove $offsetfile"
@@ -408,7 +408,7 @@
 	fi
 	debug "Running logtail: $file"
 	$LOGTAIL -f $file -o $offsetfile $LOGTAIL_OPTS \
-	    >> $TMPDIR/logoutput/$(basename $file) \
+	    >> $TMPDIR/logoutput/$(basename $file) 2>&1 \
 	    || error "Could not run logtail or save output"
     else
 	echo "E: File could not be read: $file" >> $TMPDIR/errors \
--- /cvsroot/logcheck/logcheck/src/logtail	2004/07/15 15:03:03	1.8
+++ /cvsroot/logcheck/logcheck/src/logtail	2005/01/11 06:18:10	1.9
@@ -30,7 +30,7 @@
 getopts("f:o:t", \%opts);
 
 if (! $opts{f}) {
-   print "No logfile to read. Use -f switch.\n";
+   print STDERR "No logfile to read. Use -f switch.\n";
    exit 66;
 } elsif ($opts{t}) {
     $TEST_MODE = 1;
@@ -39,7 +39,7 @@
 my ($logfile, $offsetfile) = ($opts{f}, $opts{o});
 
 if (! -f $logfile) {
-    print "File $logfile cannot be read.\n";
+    print STDERR "File $logfile cannot be read.\n";
     exit 66;
 }
 unless ($offsetfile) {
@@ -48,7 +48,7 @@
 }
 
 unless (open(LOGFILE, $logfile)) {
-    print "File $logfile cannot be read.\n";
+    print STDERR "File $logfile cannot be read.\n";
     exit 66;
 }
 
@@ -69,7 +69,7 @@
     }
 
     unless ((undef,$ino,undef,undef,undef,undef,undef,$size) = stat $logfile) {
-        print "Cannot get $logfile file size.\n", $logfile;
+        print STDERR "Cannot get $logfile file size.\n", $logfile;
         exit 65;
     }
 
@@ -98,7 +98,7 @@
 # update offset, unless test mode
 unless ($TEST_MODE) {
     unless (open(OFFSET, ">$offsetfile")) {
-        print "File $offsetfile cannot be created. Check your permissions.\n";
+        print STDERR "File $offsetfile cannot be created. Check your permissions.\n";
         exit 73;
     }
     print OFFSET "$ino\n$size\n";