[syslog-ng] syslog-ng 1.1.24

Balazs Scheidler bazsi@balabit.hu
Thu, 10 Jun 1999 20:29:30 +0200


On Thu, Jun 10, 1999 at 01:17:55PM -0400, Rob Cermak wrote:
> That patch is holding.  Logging seems to be working, but nothing appears
> in the log file.  syslog-ng did create the file.
> 
> -rw-------   1 root     daemon         0 Jun  9 15:28 sys
> 
> (gdb) run -d -v -f /etc/syslog-ng.conf
> Starting program: /usr/local/sbin/syslog-ng -d -v -f /etc/syslog-ng.conf
> [New LWP    2        ]
> [New LWP    3        ]
> [New LWP    4        ]
> syslog-ng version 1.1.24 starting
> [New LWP    5        ]
> [New LWP    6        ]
> [New LWP    7        ]
> [New LWP    8        ]
> [New LWP    9        ]
> [New LWP    10        ]
> [New LWP    11        ]
> [New LWP    12        ]
> [New LWP    13        ]
> [New LWP    14        ]
> 
> A new LWP line appears for each telnet/etc attempt.
> 
> Sending a SIGHUP.
> 
> Program received signal SIGHUP, Hangup.
> 0xef637368 in poll ()
> (gdb) cont
> Continuing.
> SIGHUP received, restarting syslog-ng
> new configuration initialized
> 
> The restart message is not seen in /var/log/sys.

if you add -d to the command line it will _NOT_ write its internal messages
to the log file only to the console.

Could you please put a breakpoint to afdoor_server_proc, and check its
parameters when log messages arrive?

afdoor_server_proc has the following parameters:

void afdoor_server_proc(void *cookie, char *argp, size_t arg_size,
door_desc_t *dp, size_t n_desc)

* cookie is a parameter can be passed to this callback function, it contains
  the pointer of the afdoor_source pointer
* argp should contain the log message itself
* arg_size is the number of characters in argp
* dp is an array of n_desc elements, which may contain additional arguments 

The log message itself should be pointed by argp. 

void afdoor_server_proc(void *cookie, char *argp, size_t arg_size, door_desc_t *dp, size_t n_desc)
{
        CAST(afdoor_source, handler, cookie);
        if (argp) {
                struct log_info *msg = make_log_info(c_format("%z", argp, arg_size));
                HANDLE_LOG(handler, msg);
        }
        door_return(NULL, 0, NULL, 0);
}

Please add the last line of this function to your afdoor.c (the one with the
door_return invocation)


-- 
Bazsi
PGP key: http://www.balabit.hu/pgpkey.txt, or finger bazsi@balabit.hu