[Logcheck-devel] Bug#302689: Patch for logcheck handling egrep return incorrectly
Matthew Toseland
toad at amphibian.dyndns.org
Sat Apr 2 16:46:42 UTC 2005
Package: logcheck
Version: 1.2.36
Followup-For: Bug #302689
Logcheck will produce spurious errors at the moment, because egrep
returns 2 on error but 1 if no lines are returned. A patch is attached
to fix this.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.6
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages logcheck depends on:
ii adduser 3.63 Add and remove users and groups
ii cron 3.0pl1-87 management of regular background p
ii debconf [debconf 1.4.47 Debian configuration management sy
ii debianutils 2.13.2 Miscellaneous utilities specific t
ii exim [mail-trans 3.36-14 An MTA (Mail Transport Agent)
ii lockfile-progs 0.1.10 Programs for locking and unlocking
ii logcheck-databas 1.2.36 A database of system log rules for
ii logtail 1.2.36 Print log file lines that have not
ii mailx 1:8.1.2-0.20040524cvs-4 A simple mail user agent
ii sysklogd [system 1.4.1-16 System Logging Daemon
-- debconf information:
* logcheck/noroot:
logcheck/changes:
* logcheck/install-note:
-------------- next part --------------
--- /usr/sbin/logcheck 2005-03-31 03:08:41.000000000 +0100
+++ logcheck 2005-04-02 17:40:49.000000000 +0100
@@ -379,8 +379,8 @@
debug "cleanchecked - dir - $clean"
for file in $(ls -1 $clean/); do
debug "cleanchecked - dir - $clean/$file"
- (egrep --text -v -f $clean/$file $TMPDIR/checked \
- || warn "Could not process file $file") | cat \
+ (egrep --text -v -f $clean/$file $TMPDIR/checked;
+ if [[ $? == 2 ]]; then warn "Could not process file $file"; fi) | cat \
>> $TMPDIR/checked.1 \
|| error "Could not output to $TMPDIR/checked.1 Disk Full?"
mv $TMPDIR/checked.1 $TMPDIR/checked \
More information about the Logcheck-devel
mailing list