[syslog-ng]time_reopen, continuous reconnects, and syslog-ng1.4.10 - 1.4.12.

Ramji Chandramouli ramji@aventail.com
Fri, 17 Aug 2001 01:22:30 +0000


This sounds a lot like a problem I was running into when the server syslog-ng
died and I could not get the client syslog-ng to try to reconnect.

I made the following change to
afinet.c.

In the function do_init_afinet_dest(),

        if (self->conn_fd) {
                return ST_OK | ST_GOON;
        }
        else {
                werror("Error creating AF_INET socket (%z)\n", strerror(errno));

+                 io_callout(self->cfg->backend,
+                     self->cfg->time_reopen,
+                           make_driver_reinit(&self->super.super.super,
self->cfg));
        }

Once I added this io_callout(), I was able to get it working in my set-up.
I hope this helps.


matthew.copeland@honeywell.com wrote:

> > > I just don't like the idea of having to login to 250 systems just to HUP
> > > the syslog-ng process.  Even if I can script it.
> >
> > This is a bug I didn't have time to track down. As it seems syslog-ng tries
> > to reconnect after connection failure, and sometimes after a successful
> > connection establishment just stops sending data, and also stops trying to
> > reconnect. Reading the source didn't reveal any information, and I couldn't
> > reproduce the problem myself.
>
> Here is how I reproduce the problem.  It happens everytime when I do
> this.  Unfortunately, it requires about 20 minutes or so.  :)
>
> On client syslog-ng, fire up syslog-ng with --debug with the config
>         pointing to the server.
> On server syslog-ng, fire up syslog-ng with --debug.
>
> use a little test program to generate some data.  The one I have been
> using is
>
> #!/usr/bin/perl
>
> local($i) = 0;
> while(1)
> {
>         print "The number is ", $i, "\n";
>         $i++;
> }
>
> Now, try it out to make sure that you get a connection and that data goes
> through.  Kill the test program.  Reach around the back of your
> computer (laptop in my case) and disconnect the computer from the
> network.  Fire up the test program.  Wait until you get the message saying
> "Connection broken, reopening in %i seconds", where %i is the reopen
> time.  Wait until after that reopen attempt should have gone through.  (In
> my case, I have reopen set to 30, so I wait more than 30 seconds.)  Now,
> reconnect the client to the network.  Bingo, no data until you HUP the
> process to get it to reconnect.
>
> Matthew M. Copeland
>
> _______________________________________________
> syslog-ng maillist  -  syslog-ng@lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng