From: Mike Cappella on
On 9/11/09 5:05 PM, ghe wrote:
>
> On Sep 11, 2009, at 5:51 PM, Mike Cappella wrote:
>
>>> I don't understand this line from today's logwatch report:
>>>
>>> 308 *Warning: Database file needs update
>>>
>>
>> This message appears when you have a map file that requires
>> postmap'ing to bring the db file up to date relative to the source
>> file. Look at the log messages to see which file is not up to date and
>> run postmap on that file.
>
> Thank's Mike. I found a mention of virtual with google, but since I
> couldn't find the message in /var/log/mail*, I couldn't figure it out.
>

Its in the report at detail >= 5:

$ grep 'older than source' maillog | tail | \
postfix-logwatch --detail 5 --max_report_width=70
****** Summary *******************************************************

10 *Warning: Database file needs update

****** Detail (10) ***************************************************

10 *Warning: Database file needs update ----------------------
9 /etc/postfix/virtual
1 /etc/postfix/transport


> Also since I didn't find it, I just re-postmapped 'em all.
>

No need. The file is indicated in the log and via postfix-logwatch (or
logwatch w/detail >= 5).

Consider using a Makefile to keep source up to date, so that you can
just run "make" w/o thinking about which file needs updating.

--
Mike
From: ghe on

On Sep 11, 2009, at 6:18 PM, Wietse Venema wrote:

>> Also since I didn't find it, I just re-postmapped 'em all.
>
> Postfix includes the name of the file that is out-of-date:
>
> warning: database /etc/postfix/access.db is older than source
> file /etc/postfix/access
>
> This is logged when the output file has not been updated withing 100s
> after the input file was modified.

Ah!! Logwatch was giving me the wrong string to grep for. "older than
source" is all over the logs, all complaining about my sender checks.
Thanks, Wietse.

--
Glenn English
ghe(a)slsware.com



From: Mike Cappella on
On 9/11/09 5:57 PM, ghe wrote:
>
> On Sep 11, 2009, at 6:18 PM, Wietse Venema wrote:
>
>>> Also since I didn't find it, I just re-postmapped 'em all.
>>
>> Postfix includes the name of the file that is out-of-date:
>>
>> warning: database /etc/postfix/access.db is older than source
>> file /etc/postfix/access
>>
>> This is logged when the output file has not been updated withing 100s
>> after the input file was modified.
>
> Ah!! Logwatch was giving me the wrong string to grep for. "older than
> source" is all over the logs, all complaining about my sender checks.
> Thanks, Wietse.
>

Most log messages in postfix-logwatch are either canonicalized or
summarized. In this case, the message summary change was an attempt at
being a little more clear, (but perhaps its not). The canonicalization
(and uppercasing of the first word) makes strict grep'ing fail. Eg.,
the grep:

grep 'database is older than source file'

would fail. So you'd have to know a-priori which sub-string to grep for
anyway. I thought the summary message:

Database file needs update

was clearer than the canonicalized:

Database is older than source file

esp. in context of the verbose output. Its best to use the summary
output as a hint to look at more detailed output, and of course the logs.

Finally, as an FYI, you can look at the postfix-logwatch source to see
the section and pattern matches :

add_section ($S, 'databasegeneration', 1, 'd', '*Warning:
Database file needs update');

leads to :

} elsif ($warning =~ /^database (?:[^ ]*) is older than source file
([\w\/]+)$/o) {
#TD warning: database /etc/postfix/client_checks.db is older than
source file /etc/postfix/client_checks
$Totals{'databasegeneration'}++; return unless
($Collecting{'databasegeneration'});
$Counts{'databasegeneration'}{$1}++;


--
Mike
From: ghe on

On Sep 11, 2009, at 7:21 PM, Mike Cappella wrote:

> Most log messages in postfix-logwatch are either canonicalized or
> summarized. In this case, the message summary change was an attempt
> at being a little more clear, (but perhaps its not).

It's great ... when timesSeen > 1.

> The canonicalization (and uppercasing of the first word) makes
> strict grep'ing fail. Eg., the grep:
>
> grep 'database is older than source file' would fail.

Which is why I always leave off the first char.

> I thought the summary message:
>
> Database file needs update
>
> was clearer than the canonicalized:
>
> Database is older than source file
>
> esp. in context of the verbose output. Its best to use the summary
> output as a hint to look at more detailed output, and of course the
> logs.

It is clearer, and I did look. I just looked for the wrong thing. I
first searched for the string, then just "update". If it had said
"database file 'client_checks' needs updating" I would have found the
messages. And I wouldn't have been confused about whether it was
talking about a postfix file or some logwatch file I'd never heard of
("Hmmm. logwatch keeps a database of what it's seen in the mail log?
That's neat...")

OTOH, "older than source file" would have echoed what I see all the
time when I change a file in /etc that postfix keeps in its chroot jail.

> Finally, as an FYI, you can look at the postfix-logwatch source to
> see the section and pattern matches :
>
> add_section ($S, 'databasegeneration', 1, 'd', '*Warning:
> Database file needs update');
>
> leads to :
>
> } elsif ($warning =~ /^database (?:[^ ]*) is older than source
> file ([\w\/]+)$/o) {
> #TD warning: database /etc/postfix/client_checks.db is older
> than source file /etc/postfix/client_checks
> $Totals{'databasegeneration'}++; return unless ($Collecting
> {'databasegeneration'});
> $Counts{'databasegeneration'}{$1}++;

Oh! That's what those CVS sites I found were about! That's
significantly more complex than the little logwatch scripts I've
written :-)

This bears looking into and understanding. Thanks.

The real problem, I think, came up because this message is so rare.
I'm very used to all the others, and the .db files are 'never' out of
date because I use a shell script to add to them. ... And I didn't
know postfix was always looking out for me. Nice work, Wietse :-)

--
Glenn English
ghe(a)slsware.com



From: Wietse Venema on
Mike Cappella:
[ Charset ISO-8859-1 unsupported, converting... ]
> On 9/11/09 5:57 PM, ghe wrote:
> >
> > On Sep 11, 2009, at 6:18 PM, Wietse Venema wrote:
> >
> >>> Also since I didn't find it, I just re-postmapped 'em all.
> >>
> >> Postfix includes the name of the file that is out-of-date:
> >>
> >> warning: database /etc/postfix/access.db is older than source
> >> file /etc/postfix/access
> >>
> >> This is logged when the output file has not been updated withing 100s
> >> after the input file was modified.
> >
> > Ah!! Logwatch was giving me the wrong string to grep for. "older than
> > source" is all over the logs, all complaining about my sender checks.
> > Thanks, Wietse.
> >
>
> Most log messages in postfix-logwatch are either canonicalized or
> summarized. In this case, the message summary change was an attempt at
> being a little more clear, (but perhaps its not). The canonicalization
> (and uppercasing of the first word) makes strict grep'ing fail. Eg.,
> the grep:

I think that it is a mistake to replace the specific

warning: database /etc/postfix/client_checks.db is older than
source file /etc/postfix/client_checks

By the generic

Database file needs update

Because it keeps the reader in the dark (given the generic text,
the user does not even know what to look for in the logfile).

I agree that many programs produce useless error messages. In the
case of Postfix, I actually put in effort to make messages useful.
So would I appreciate it if other people don't dumb down the
information that Postfix tries to give.

Wietse