Hi Bazsi,

Thanks for your reply first of all!

I've never used strace but I'll try it.

Yes, my program is using buffer and actually that's the first thing I checked. But I'm pretty sure it's not there.

This is somewhat related to pipe openning. If I make sure syslog-ng opens the pipe before my program, then everything is OK. The code in my program is something like this:

        .
        .
initializing
        .
        .
while(1)
{
        open pipe       #block here until syslog-ng open the pipe
        while(1)
        {
                select on the pipe      #block here until the pipe is ready for read or timeout (5 sec)
                next if timeout
                last if other side close the pipe       #jump out the loop and try to open pipe again
               
                read and process the message    #normal
        }
}
               
Bazsi, you see anything wrong here?

Thanks,

Andy                             



-----Original Message-----
From: Balazs Scheidler [mailto:bazsi@balabit.hu]
Sent: Monday, July 15, 2002 10:59 AM
To: syslog-ng@lists.balabit.hu
Subject: Re: [syslog-ng]Strang behaviour of syslog-ng (and my program)


On Mon, Jul 15, 2002 at 10:32:08AM -0400, Antai Ning wrote:
> Hi Gents,

> I'm posting the question again because I really need an answer for it,

> Thanks a lot,

can you check whether strace shows anything insane?

are you using buffering in your perl program?

syslog-ng uses a read/write pipe, and writes messages as soon as the pipe
becomes writable. if the pipe is not writable (as indicated by poll),
messages are buffered in a fifo, whose size is controlled by
log_fifo_size().

--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1

_______________________________________________
syslog-ng maillist  -  syslog-ng@lists.balabit.hu
https://lists.balabit.hu/mailman/listinfo/syslog-ng
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html