From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8283 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: /dev/log: datagram, stream, both? Date: Tue, 11 Aug 2015 17:41:20 -0400 Message-ID: <20150811214119.GB21230@brightrain.aerifal.cx> References: <55C911F3.2090809@skarnet.org> <20150811045938.GA21230@brightrain.aerifal.cx> <55C99003.1020609@skarnet.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1439329308 17634 80.91.229.3 (11 Aug 2015 21:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2015 21:41:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8295-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 11 23:41:38 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZPHIg-00055B-8r for gllmg-musl@m.gmane.org; Tue, 11 Aug 2015 23:41:38 +0200 Original-Received: (qmail 1833 invoked by uid 550); 11 Aug 2015 21:41:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1804 invoked from network); 11 Aug 2015 21:41:32 -0000 Content-Disposition: inline In-Reply-To: <55C99003.1020609@skarnet.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8283 Archived-At: On Tue, Aug 11, 2015 at 08:02:43AM +0200, Laurent Bercot wrote: > On 11/08/2015 06:59, Rich Felker wrote: > >AFAIK it was always SOCK_DGRAM. > > It definitely wasn't, say, 6ish years ago. I have seen > glibc's and uClibc's syslog() work with SOCK_STREAM. I didn't > check the client code, maybe it tried both, but it *was* > succeeding in logging stuff when there was a server listening > on a /dev/log SOCK_STREAM. Busybox 1.0 syslogd: http://git.busybox.net/busybox/tree/sysklogd/syslogd.c?id=1_00#n561 That's from 2004. We could go back even earlier but I don't know where the syslogd was (or if it even had one) if we go further back. > >SOCK_DGRAM would be a huge advantage over SOCK_STREAM if it actually > >worked the way I intended it -- that the initial connect() binds the > >address even if syslogd isn't listening yet and keeps it working even > >if syslogd is restarted. Unforunately it doesn't work that way, which > >means there's no way for chrooted processes to re-establish their > >syslog connections if syslogd goes down. > > And that's why a correct supervision architecture must perform > fd-holding on the fd outputting the logs. Which is only possible > if it knows that fd before the client start, i.e. the client logs > to stderr instead of syslog. > > Are there real, current advantages of SOCK_DGRAM - not only > hypothetical ones - and most importantly, is there a specification > anywhere ? I'm not sure. Rich