[syslog-ng]CRITICAL: disk flooding bug - disabling of STATS seems to be broken in 1.5.19
Balazs Scheidler
bazsi@balabit.hu
Fri, 9 Aug 2002 15:21:45 +0200
On Fri, Aug 09, 2002 at 01:04:02PM +0200, Dominique Kaiser wrote:
> Disabling STATS reporting with options "{ stats(0); }" doesn't work anymore!
> Instead syslog-ng gets busy reporting STATS all the time without pause -
> and succeeds in eating up all free disk space in a matter of minutes.
> If you don't have an extra mount for /var/log your whole system is rendered
> inoperatible...
>
> the upstream Changelog shows an entry from 2002-06-17 concerning STATS which
> most likely describes the change causing the bug.
>
> I didn't fully study the sources but on first sight it seems to me that
> the error is in main_loop() in src/main.c in the lines 188 and 204.
> I think it should be
> if (s.timeout > 0)
> instead of
> if (s.timeout <= 0)
> especially as the callback timers seem to get deleted in line 201. The
> way it is now STATS might be disabled by providing any positive config
> value??!!
you are right, the condition should be like in the fixed patch:
diff -u -r1.42 main.c
--- main.c 17 Jun 2002 09:23:13 -0000 1.42
+++ main.c 9 Aug 2002 13:20:11 -0000
@@ -185,7 +185,7 @@
s.timeout = backend->configuration->stats_freq;
s.backend = backend;
r.backend = backend;
- if (s.timeout <= 0)
+ if (s.timeout > 0)
io_callout(&backend->super, s.timeout, &s.super);
while (io_iter(&backend->super)) {
@@ -201,7 +201,7 @@
io_callout_flush(&backend->super);
s.timeout = backend->configuration->stats_freq;
- if (s.timeout <= 0)
+ if (s.timeout > 0)
io_callout(&backend->super, s.timeout, &s.super);
r.state = 0;
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1