Bug 19587

Summary: [PATCH] 'Nother bug in periodic scripts
Product: Base System Reporter: howardjp <howardjp>
Component: confAssignee: Brian Somers <brian>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description howardjp 2000-06-29 21:10:01 UTC
This may not be a bug, but the etc/periodic/daily/460.status-mail-rejects
only checks the two most recent log files for problems.  If someone has a
busy mail server and rotates the logs more often than once a day, they
will miss notifications.  Also (and this may seem like a non-issue), the
script is less portable this way.  The patch below should correct this.

How-To-Repeat: 
N/A
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-06-30 08:23:19 UTC
Responsible Changed
From-To: freebsd-bugs->brian

Over to the effective maintainer. ;-)
Comment 2 Brian Somers 2000-06-30 09:22:53 UTC
> >Number:         19587
> >Category:       conf
> >Synopsis:       [PATCH] 'Nother bug in periodic scripts
[.....]
> --- 460.status-mail-rejects.orig	Thu Jun 29 15:42:10 2000
> +++ 460.status-mail-rejects	Thu Jun 29 15:42:42 2000
> @@ -8,7 +8,7 @@
>    echo Checking for rejected mail hosts:
>  
>    start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
> -  zcat -fc /var/log/maillog.0* /var/log/maillog | grep reject= |
> +  zcat -fc /var/log/maillog.* /var/log/maillog | grep reject= |
>  	perl -ne "print \"\$2\n\" 
>  	if /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o;" |
>  	sort | uniq -c | sort -nr

Hi,

I don't think this is the right answer to the problem.  Some people 
may keep lots of old mail logs....

I've added another variable - daily_status_mail_rejects_logs that 
defaults to 3 (the previous code only did two files, leaving a window 
of missed lines at the end of maillog.1* if the logs were rotated 
after midnight and before 460.status-mail-rejects).

Cheers.
-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
Comment 3 Brian Somers freebsd_committer freebsd_triage 2000-06-30 10:41:25 UTC
State Changed
From-To: open->closed

A slightly different patch has been applied. 
Thanks