Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150709050222.GR1173@brightrain.aerifal.cx>
Date: Thu, 9 Jul 2015 01:02:22 -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 11:43:34PM -0400, Rich Felker wrote:
> 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.

That didn't cover all the needed errno values, so here's an improved
version that also avoids closing the socket at open time if connect
failed (since the connect can be retried later anyway).

Rich

View attachment "syslog_reopen_v4.diff" of type "text/plain" (1457 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.