[syslog-ng]Bug in unix_stream/dgram() dest drivers 1.6.0rc4

Balazs Scheidler syslog-ng@lists.balabit.hu
Tue, 17 Feb 2004 12:04:58 +0100

2004-02-17, k keltezéssel 09:04-kor Andreas Schulze ezt írta:
> >>it seems I've found a bug in the unix_stream/unix_dgram
> >>destination drivers.
> >>
> >>The problem is, that running sysng with something like
> >>
> >>	destination d_dgram  { unix-dgram("/tmp/dgram_sock"); };
> >>
> >>it doesn't create the socket in the file system, so the
> >>connect() fails. Seems that bind_unix_socket() is never called.
> > 
> > bind is called by the program creating the UNIX dgram socket. in this
> > case you instructed syslog-ng to connect to such a socket, where binding
> > is not necessary.
> Yepp. But the problem ist, that syslogd doesn't start, if the socket
> wasn't created via bind() by a running program.
> I think, the general question is:
> Who is responsible to create (bind()) the socket?
> The client or the server process? In general IMHO the server process.

absolutely true. the client could not even try to bind it.

> In destination {unix-dgram()} context syslogd acts like a server
> process and should do the bind().

no. destination { unix-dgram() } is a client process. you want to use
source { unix-dgram() } instead. (source in the context of syslog-ng
means that messages are read _from_ this source, e.g. it behaves like a
server for other processes)

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