supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Sean MacLennan <seanm@seanm.ca>
To: supervision@list.skarnet.org
Subject: Re: s6 problems logging
Date: Sun, 27 Jan 2019 13:56:46 -0500	[thread overview]
Message-ID: <20190127135646.66682ee5@zonker.seanm.ca> (raw)
In-Reply-To: <20190127114751.169d2a15@zonker.seanm.ca>

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


  parent reply	other threads:[~2019-01-27 18:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-27  3:15 Sean MacLennan
2019-01-27  5:20 ` Colin Booth
2019-01-27 16:47   ` Sean MacLennan
2019-01-27 17:56     ` Laurent Bercot
2019-01-27 18:13     ` Colin Booth
2019-01-27 18:56     ` Sean MacLennan [this message]
2019-01-27 19:27       ` Roger Pate
2019-01-28 11:00         ` Peter Pentchev
2019-02-01  9:22           ` Jonathan de Boyne Pollard
2019-01-27 19:35       ` Guillermo
2019-01-27 14:39 ` smaclennan/doorknob Jonathan de Boyne Pollard
2019-02-02 18:32   ` smaclennan/doorknob Sean MacLennan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190127135646.66682ee5@zonker.seanm.ca \
    --to=seanm@seanm.ca \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).