[syslog-ng] remote logging not reliable

Balazs Scheidler bazsi at balabit.hu
Mon Mar 13 17:44:16 CET 2006


On Fri, 2006-03-10 at 09:04 -0500, John Morrissey wrote:
> On Thu, Mar 09, 2006 at 06:56:47PM -0800, stucky wrote:
> > I will try 1.9.9 again when I have more time. I tried it once and it
> > literally killed me with stats although I had stats(0) set.
> > It was insane so I turned it off again.
> 
> I noticed the same behavior when upgrading from 1.6.x to 1.9.x and filed a
> Debian bug report:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=352362

I would prefer bugreports posted to this list, for instance I did not
know about this one until now.

I've just committed this fix which also fixes a minor issue that
syslog-ng did not care about the changed value of stats_freq on SIGHUP
(tomorrow's snapshot should include this patch)

--- orig/src/main.c
+++ mod/src/main.c
@@ -140,12 +140,14 @@ main_loop_run(GlobalConfig *cfg)
 {
   GMainLoop *main_loop;
   gint iters;
+  guint stats_timer_id = 0;

   msg_notice("syslog-ng starting up",
              evt_tag_str("version", VERSION),
              NULL);
   main_loop = g_main_loop_new(NULL, TRUE);
-  g_timeout_add(cfg->stats_freq * 1000, stats_timer, NULL);
+  if (cfg->stats_freq > 0)
+    stats_timer_id = g_timeout_add(cfg->stats_freq * 1000, stats_timer, NULL);
   while (g_main_loop_is_running(main_loop))
     {
       if (cfg->time_sleep > 0)
@@ -163,6 +165,12 @@ main_loop_run(GlobalConfig *cfg)
           msg_notice("SIGHUP received, reloading configuration", NULL);
           cfg = cfg_reload_config(cfgfilename, cfg);
           sig_hup_received = FALSE;
+          if (cfg->stats_freq > 0)
+            {
+              if (stats_timer_id != 0)
+                g_source_remove(stats_timer_id);
+              stats_timer_id = g_timeout_add(cfg->stats_freq * 1000, stats_timer, NULL);
+            }
         }
       if (sig_term_received)
         {






-- 
Bazsi



More information about the syslog-ng mailing list