|
Message-ID: <20150708034334.GL1173@brightrain.aerifal.cx>
Date: Tue, 7 Jul 2015 23:43:34 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] close syslog socket on error to recreate it later
On Tue, Jul 07, 2015 at 08:14:52AM +0300, Timo Teras wrote:
> On Mon, 6 Jul 2015 19:21:38 -0400
> Rich Felker <dalias@...c.org> wrote:
>
> > On Sat, Jul 04, 2015 at 07:58:04PM +0300, Timo Teräs wrote:
> > > if syslogd is restarted, the socket is left in unconnected state
> > > and all logging will cease
> >
> > Here's a simple version with reopening, IMO simpler than the one you
> > gave on IRC. Adding checks for errno value would be easy if we want to
> > retry only on certain error(s).
>
> Nice.
Attached is a better patch which I'm going to apply, I think. It
avoids the race window where the fd reservation could be lost and
making a new socket could fail due to resource exhaustion. It only
handles the "syslogd restarted" case but I think that's the only one
where this makes sense anyway.
Rich
View attachment "syslog_reopen_v2.diff" of type "text/plain" (708 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.