[syslog-ng] Output to file in /proc

Balazs Scheidler bazsi at balabit.hu
Wed Mar 2 10:42:57 CET 2011


On Wed, 2011-03-02 at 07:31 +0100, Valentijn Sessink wrote:
> Op 01-03-11 22:40, Balazs Scheidler schreef:
> > It depends on what the write() syscall returns to syslog-ng. The only
> > way to check that is to use strace on the syslog-ng process and see if
> > writing the proc file returns failure on write or not.
> 
> OK, so I'm just lucky for not forcing sync() on this file.
> 
> Would there be any way around this, i.e. a way to force syslog-ng to act
> as if a certain message has been delivered OK, without retry?

well, not currently. But with this patch it can:


commit bae327dc1754909bba62b09c7a5dda6dadf534eb
Author: Balazs Scheidler <bazsi at balabit.hu>
Date:   Wed Mar 2 10:42:17 2011 +0100

    LogWriter: added support for a new flag 'ignore-errors'
    
    This flag make syslog-ng ignore write errors, since in special cases a
    write error may indicate a temporary failure related to the current
    message being written out.
    
    Such an example is /proc/net/xt_recent/violators, where an ill formatted
    message will cause a write error, but suspending the destination
    because of that is not good.
    
    The LogWriter will cancel the complete I/O operation, e.g. it is not
    recommended to use flush_lines() or any other kind of write coalescing.
    
    Reported-By: Valentijn Sessink <valentyn at blub.net>
    Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>

It is on 3.3 currently, but should probably be quite easy to backport it to 3.2


-- 
Bazsi



More information about the syslog-ng mailing list