[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bind and syslog



On Sat, Dec 18, 1999 at 02:35:30PM -0600, Steve Greenland wrote:
> On 17-Dec-99, 13:05 (CST), Marek Habersack <grendel@vip.net.pl> wrote: 
> > * Steve Greenland said:
> > > IMO, this is a bug in syslog(3). IIRC, it only affects programs that
> > No, it isn't. You can't expect syslogd to keep an open connection to
> > /dev/log when it is being restarted...
> 
> No, but I can expect syslog(3) (the library function) to catch the
> signal and re-open. Ok, it would have to maintain state, but doesn't
> it anyway? It's not like openlog() returns a handle that's passed to
> syslog. Why force every user to deal with this? Especially since there's
> no real hint on the man page that it might be necessary. (Hmm, I guess
> that's the one man page I shouldn't complain about...:-))

I've just checked out glibc 2.1.2, and it does have error checking. If the
connection to the local syslogd is broken (e.g. a SIGPIPE or EPIPE is
received), the connection is reopened, and the message triggering EPIPE is
written to the console.

It's unfortunate, that sendmail opens a connection at startup, and this
connection is inherited through fork()-s, and if syslogd is restarted, the
broken connection is inherited, thus the first message of each forked
children is lost, and is sent to the console.

A solution would be to add code to libc, to try to resend a message _once_
again, if an EPIPE is received. 

Another nice thing would be to add some timeout to syslog sending, because
now all programs block if syslogd is stalled.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt


Reply to: