Bug#396003: patch for allowing the reporting of paniclog messages only once
Marc Haber
mh+debian-packages at zugschlus.de
Thu Feb 7 15:03:10 UTC 2008
On Sun, Dec 02, 2007 at 01:36:44PM +0000, Vasilis Vasaitis wrote:
> Attached is a patch to exim4-base.cron.daily that implements what
> has been described as an acceptable solution in this bug report:
>
> - If $E4BCD_WATCH_PANICLOG is set to "no", no reporting is done (no
> change).
> - If it is set to "yes", non-zero size paniclog is always reported
> (no change again).
> - If it is set to "once" however, a non-zero paniclog is reported
> only if it has changed since the last time the cron.daily script has
> run; so effectively only once for each time it changes.
>
> To implement this the script creates a zero size file in
> /var/lib/exim4 called paniclog.timestamp, which would also mean that
> the exim4-base package should contain /var/lib/exim4 (but this is just
> nitpicking).
I have, in svn, implemented Josip's suggestion to have a dedicated
file /etc/logrotate.d/exim4-paniclog to allow manual rotation of the
paniclog. This could be called when E4BCD_WATCH_PANICLOG=once to
automatically move the log away, resulting in the following patch:
--- debian/exim4-base.cron.daily (revision 2246)
+++ debian/exim4-base.cron.daily (working copy)
@@ -54,7 +54,7 @@
fi
}
-if [ "$E4BCD_WATCH_PANICLOG" = "yes" ]; then
+if [ "$E4BCD_WATCH_PANICLOG" != "no" ]; then
if [ -s "/var/log/exim4/paniclog" ]; then
if [ -x "/usr/local/lib/exim4/nonzero_paniclog_hook" ]; then
/usr/local/lib/exim4/nonzero_paniclog_hook
@@ -64,6 +64,9 @@
if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: root\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail system might be broken" "$(hostname --fqdn)" "$(hostname --fqdn)" | exim4 root; then
log_this "PANIC: sending out e-mail warning has failed, exim has non-zero return code"
fi
+ if [ "$E4BCD_WATCH_PANICLOG" != "once" ]; then
+ logrotate -f /etc/logrotate.d/exim4-paniclog
+ fi
fi
fi
fi
I'd appreciate you trying this patch and reporting back whether it
does what you suggest.
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
More information about the Pkg-exim4-maintainers
mailing list