From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2467 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Sean MacLennan Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: s6 problems logging Date: Sun, 27 Jan 2019 13:56:46 -0500 Message-ID: <20190127135646.66682ee5@zonker.seanm.ca> References: <20190126221517.70ea00b8@zonker.seanm.ca> <20190127052000.4skktmkfzmit6ykl@cathexis.xen.prgmr.com> <20190127114751.169d2a15@zonker.seanm.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="207931"; mail-complaints-to="usenet@blaine.gmane.org" To: supervision@list.skarnet.org Original-X-From: supervision-return-2057-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Jan 27 19:56:50 2019 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gnpbu-000ryG-9F for gcsg-supervision@m.gmane.org; Sun, 27 Jan 2019 19:56:50 +0100 Original-Received: (qmail 9351 invoked by uid 89); 27 Jan 2019 18:57:16 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 9344 invoked from network); 27 Jan 2019 18:57:15 -0000 X-Session-Marker: 7365616E6D407365616E6D2E6361 X-HE-Tag: unit25_3b5121799964b X-Filterd-Recvd-Size: 1610 In-Reply-To: <20190127114751.169d2a15@zonker.seanm.ca> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2467 Archived-At: So it seems that s6-log does not like buffered output. I modified doorknob to vsnprintf into a buffer and then tried various output methods. 1. puts(msg) Failed as expected (basically the same as vprintf). 2. write(1, msg, strlen(msg)) Worked! So non-buffered ok. 3. fputs(msg, stderr) Then add `fdmove -c 2 1' to the run file works! So fdmove seems to fix things up. Which is probably why most people don't see this problem. Obviously, for 2 and 3 I did a strcat(msg, "\n"). So I think I will go with 2, but to stderr to follow Jonathan de Boyne Pollard's comment "Unix conventions: Logs go to standard error". Thanks everybody for the input. I probably would not have suspected the buffered output was a problem. Cheers, Sean