perl-filter: filter_mode invocations

Christoph Biedl cbiedl at gmx.de
Thu Aug 11 11:26:52 UTC 2005


The perl filter does not have a callback for shutdown. This is
documented at
http://www.eyrie.org/~eagle/software/inn/docs-2.4/hook-perl.html and
probably some other places, too. However, preserving data across a
restart (e.g. empdump in cleanfeed) is not as easy as it seems.

As I read in that document: "Then, if the news administrator follows the
strongly recommended shutdown procedure of throttling the server before
shutting it down, the filter state will be safely saved to disk and can
be reloaded when innd restarts". So I added a short statement to
filter_mode:

|    slog ('N', 'filter_mode: (Mode, NewMode, reason) = ' .
|        "($mode{Mode}, $mode{NewMode}, $mode{reason})");
[ Yeah, slog is cleanfeed, lesson learned ]

to see when and how filter_mode is called.

Big surprise: Shutdown using 'rc.news stop' does NOT result in an
filter_mode invocation. In other words, rc.news itself does not follow
the recommended shutdown procedure, the memory info is lost. Upon
restart, cleanfeed might reload an empdump from past times when an
explicit throttle was done.

Workaround: Before shutting down (rc.news:40) do a
| ${PATHBIN}/ctlinnd throttle 'rc.news stop'

Solution: "shutdown" should do a throttle - or, instead of simply
disabling the perl filter, call filter_mode a last time with appropriate
parameters. Same for "xexec".

    Christoph


More information about the inn-workers mailing list