scanspool, hostname resolution error logging

Florian Schlichting fschlich at CIS.FU-Berlin.DE
Wed Aug 3 22:58:39 UTC 2011


Hi Julien,

> I hope you enjoyed your holidays and had a good weather (which was
> not the case in July ? at least in France).

ah, it was terrible! No more than two or three days where one would want
to go swimming, we even lighted the chimney once...


I've got to work a bit on the manpage for scanspool, find attached what
I've come up with based on the extensive comments in the script; also,
reading the code in light of its manpage, I found a few typos and added
a little clarification.


Finally, I noticed that innd will log problems resolving a peer's
hostname from incoming.conf to news.err, whereas innfeed logs similar
errors with hostnames from innfeed.conf to news.notice, where they get
buried in all the other stuff. This is unfortunate, I think, as typos in
these hostnames as well as peers gone missing are things that require
manual attention.

innd uses "syslog(L_ERROR, ..." directly, whereas innfeed uses the more
generic warn(); but then I got confused because the message handler
message_log_syslog_warning writes to news.notice only (as warning is less
than err) - but what's the point in having three functions notice(),
warn(), and die() if they don't correspond to the three syslog files
news.notice, news.err and news.crit? Why would we differentiate between
notice() and warn() if it ends up in the same place anyway? Perhaps
someone can shed light on this...

(And innreport doesn't seem to care about hostname lookup errors either
- that's ok for connecting client hostnames, but shouldn't issues with
configuration values be treated differently?)

confused,
Florian


-------------- next part --------------
=head1 NAME

scanspool - Perform a big scan over all articles in I<patharticles>

=head1 SYNOPSIS

B<scanspool> [B<-a> I<active_file>] [B<-s> I<spool_dir>] [B<-v>] [B<-c>] [B<-n>]

=head1 DESCRIPTION

B<scanspool> is a Perl script for use with a I<tradspool> article spool.
It will scan the F<active> file as well as all articles in the spool 
and report on the errors it encounters.  As this may take a while,
using the B<-v> switch is recommended to see how far the program has
progressed.

First, B<scanspool> scans the F<active> file, noting problems such as:

=over 4

=item * malformed line

=item * group aliased to a non-existent group

=item * group aliased to a group that is also aliased

=back

Then it will examine all articles under your news spool directory,
complaining about articles that:

=over 4

=item * have a basename that starts with a leading 0

=item * have a basename that is out of range according to the active file

=item * do not contain a Newsgroups: line

=item * are all header and no text

=item * are in a directory for which there is no active group

=item * are is in a group to which they do not belong

=back

Scanspool understands aliased groups.  Thus, if an article is posted
to foo.old.name that is aliases to foo.bar, it will be expected to
be found under foo.bar and not foo.old.name.

Articles posted to a group of type 'j' or 'x' (4th field of the active file)
will be expected to show up under the I<junk> group.

Scanspool assumes that the path of a valid newsgroup's directory
from the root of the spool tree will not contain any "." character.
Thus, directories such as out.going, tmp.dir, in.coming and
news.archive will not be searched.  This program also assumes that
article basenames contain only decimal digits.  Last, files under
the top level directory "lost+found" are not scanned.

=head1 OPTIONS

=over 4

=item B<-a> I<active_file>

F<active> file to use (default F<< <pathdb>/active >>).

=item B<-s> I<spool_dir>

Root of the spool tree (default F<< <patharticles> >>).

=item B<-v>

Verbose mode:
Print which group is currently worked upon.
List all articles found in non-active directories (i.e., 
articles sorted into groups no longer present in the F<active> file),
rather than just printing the group once.

=item B<-c>

Only check article filenames, don't actually scan the Newsgroups:
header of the articles.

=item B<-n>

Don't throttle innd while scanning.

=back


=head1 DIAGNOSTICS

The output of scanspool will start with one of 4 forms:

=over 4

=item * C<FATAL:> (to stderr)

Fatal or internal error.

=item * C<WARN:> (to stderr)

F<active> or article format problem, group alias problem, find error,
article open error.

=item * C<path/123:> (to stdout)

Issues such as

=over 4

=item * basename starts with 0

=item * article number out of range

=item * article in the wrong directory

=item * article in a directory not related to an active non-aliased newsgroup

=back

=item * C<\t ...> (to stdout)

Verbose messages start with a tab.

=back

=head1 BUGS

B<scanspool> is unable to detect and properly deal with spool formats
other than I<tradspool>. However, if the files that store your articles
are named other than just all-digits, they will simply be skipped
(and your I<active> is still checked).

B<scanspool> only considers the first line of the Newsgroups: header.
Continuation lines are not taken into account.

=head1 HISTORY

B<scanspool> was written by Landon Curt Noll (chongo was here  /\../\).

This manual page was written by Florian Schlichting,
largely based on comments in the script.

$Id$

=cut

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-scanspool-typos-and-clarifications.patch
Type: text/x-diff
Size: 2916 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/inn-workers/attachments/20110804/4796fb89/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5557 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/inn-workers/attachments/20110804/4796fb89/attachment-0001.bin>


More information about the inn-workers mailing list