From owner-freebsd-current Sun Jan 5 10:39:20 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B73937B401; Sun, 5 Jan 2003 10:39:18 -0800 (PST) Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2768143EB2; Sun, 5 Jan 2003 10:39:17 -0800 (PST) (envelope-from se@FreeBSD.org) Received: from fwd03.sul.t-online.de by mailout05.sul.t-online.com with smtp id 18VFg3-0001q5-05; Sun, 05 Jan 2003 19:39:15 +0100 Received: from Gatekeeper.FreeBSD.org (520047440004-0001@[217.81.11.225]) by fmrl03.sul.t-online.com with esmtp id 18VFfq-0blkUiC; Sun, 5 Jan 2003 19:39:02 +0100 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id EFE745F1C; Sun, 5 Jan 2003 19:38:58 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id BF297161F; Sun, 5 Jan 2003 19:38:58 +0100 (CET) Date: Sun, 5 Jan 2003 19:38:58 +0100 From: Stefan Esser To: current@FreeBSD.org Subject: Periodic scripts ignore bzip2ed log files Message-ID: <20030105183858.GA9274@StefanEsser.FreeBSD.org> Mail-Followup-To: Stefan Esser , current@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-Sender: 520047440004-0001@t-dialin.net Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG When newsyslog.conf was modified to compress rotated log files with bzip2 instead of gzip some 3 months ago, most of the periodic scripts that process those log files were not tought how to decompress those archived files. This affects the following scripts: etc/periodic/daily/470.status-named etc/periodic/security/800.loginfail etc/periodic/security/900.tcpwrap The result is incomplete processing of log files and possibly the loss of important warnings that else might have been generated. In case there are no objections, I intend to commit the following patches (which should be merged to 5.0R before the release, IMHO). Regards, STefan Index: etc/periodic/daily/470.status-named =================================================================== RCS file: /usr/cvs/src/etc/periodic/daily/470.status-named,v retrieving revision 1.4 diff -u -r1.4 470.status-named --- etc/periodic/daily/470.status-named 7 Dec 2002 23:37:44 -0000 1.4 +++ etc/periodic/daily/470.status-named 4 Jan 2003 17:33:00 -0000 @@ -14,7 +14,13 @@ catmsgs() { find /var/log -name 'messages.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f /var/log/messages ] && cat /var/log/messages } Index: etc/periodic/security/800.loginfail =================================================================== RCS file: /usr/cvs/src/etc/periodic/security/800.loginfail,v retrieving revision 1.4 diff -u -r1.4 800.loginfail --- etc/periodic/security/800.loginfail 24 Sep 2002 18:53:46 -0000 1.4 +++ etc/periodic/security/800.loginfail 4 Jan 2003 17:33:15 -0000 @@ -45,7 +45,13 @@ catmsgs() { find ${LOG} -name 'auth.log.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f ${LOG}/auth.log ] && cat $LOG/auth.log } Index: etc/periodic/security/900.tcpwrap =================================================================== RCS file: /usr/cvs/src/etc/periodic/security/900.tcpwrap,v retrieving revision 1.2 diff -u -r1.2 900.tcpwrap --- etc/periodic/security/900.tcpwrap 24 Sep 2002 18:53:46 -0000 1.2 +++ etc/periodic/security/900.tcpwrap 4 Jan 2003 17:33:38 -0000 @@ -45,7 +45,13 @@ catmsgs() { find ${LOG} -name 'messages.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f ${LOG}/messages ] && cat $LOG/messages } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message