supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "supervision@list.skarnet.org" <supervision@list.skarnet.org>
Subject: Re: runit patches to fix compiler warnings on RHEL 7
Date: Mon, 02 Dec 2019 21:58:38 +0000	[thread overview]
Message-ID: <em67dc4e6e-a425-4bc0-9243-fe80d13151eb@elzian> (raw)
In-Reply-To: <20191202175710.pl475v2li5xnhrho@gromit.local>

[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]


>OK, great!  I just sent my patch series in a separate reply.  I'm happy
>to have a tech discussion about it, and I could possibly change the
>patch series based on the discussion, or if it is determined that my
>patch series should not be accepted, I would accept that as well.

Eh, "fix old compiler warnings" doesn't require much discussion :)


>That's when
>I found runit which did support the concept of a service becoming
>available with its "sv start" command and a "./check" service script.
>This way, I could start it and wait for it to become available before
>starting something else.
>
>So, if s6 can do something similar, I'd be happy to try it out!  Can it?

Yes it can, and it does you one better: if your service supports it, s6
can tell you that it's ready as soon as the service says it is, without
the need for polling at all.
(https://skarnet.org/software/s6/notifywhenup.html for the tech 
details.)

And s6 has, for instance, commands that block until a service is ready,
so you can write your startup sequence without "sv check" shenanigans.


>I see something called sdnotify-wrapper, so maybe I should have a look
>at that?  (It was mentioned to me off-list.)

sdnotify-wrapper will only be useful if your daemon is using the
NOTIFY_SOCKET mechanism (aka sd_notify()) to tell systemd when it is
ready. If it's the case, then yes, you can use sdnotify-wrapper in your
s6 run script and it should automatically do the right thing.

But if you have control over your daemon's source, or the daemon 
supports
it natively (typically via a command line option), the s6 mechanism for
readiness notification is much simpler and lighter. It's just "the
daemon writes a line of text when it's ready, on any file descriptor it
wants, and then closes that file descriptor". For instance, if your
daemon writes "ok" to its stdout when it's ready (and doesn't write
any newline beforehand), you can just use that to inform s6.

And if your daemon doesn't do anything of the sort, you can still poll
it with a "./check" script (or "./data/check" in s6 parlance) as you do
with runit: just prepend your run script with
https://skarnet.org/software/s6/s6-notifyoncheck.html
and your check script will be automatically invoked as necessary, and
the result will be directly piped into the readiness notification
mechanism.

--
Laurent

  parent reply	other threads:[~2019-12-02 21:58 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 21:43 J. Lewis Muir
2019-11-27 20:33 ` J. Lewis Muir
2019-11-28  7:59   ` Ben Franksen
     [not found]   ` <ecdf4d8f-93f6-3f9f-b84c-351fa91c7f02@uni-bremen.de>
2019-11-28 19:04     ` Laurent Bercot
2019-11-28 20:39       ` Steve Litt
2019-11-28 22:17         ` runit or s6 (was: runit patches to fix compiler warnings on RHEL 7) Laurent Bercot
2019-11-29 14:09       ` runit patches to fix compiler warnings on RHEL 7 Jan Braun
2019-11-29 21:46         ` Dewayne Geraghty
2019-11-30  1:22           ` Colin Booth
2019-11-30  0:21         ` Colin Booth
2019-11-30  3:14           ` Steve Litt
2019-11-30 13:32           ` Jeff
2019-11-30 13:46             ` Jeff
2019-11-30 10:15         ` s6 usability (was: runit patches to fix compiler warnings on RHEL 7) Laurent Bercot
2019-11-30 14:32           ` Jeff
2019-11-30 18:58             ` Laurent Bercot
2019-12-02 12:07               ` Jeff
2019-12-02 22:20                 ` Laurent Bercot
2019-12-02  2:47           ` Steve Litt
2019-12-02  3:37             ` s6 usability Dewayne Geraghty
2019-12-02 10:24               ` fungal-net
2019-12-02 21:32             ` s6 usability (was: runit patches to fix compiler warnings on RHEL 7) Laurent Bercot
2019-12-02 23:17               ` s6 usability Samuel Holland
2019-12-03 22:10                 ` Steve Litt
2019-12-21 11:49                   ` Jan Braun
2019-12-04 12:15                 ` Jonathan de Boyne Pollard
2019-12-04 21:02                 ` Laurent Bercot
2019-12-04  1:30             ` s6 usability (was: runit patches to fix compiler warnings on RHEL 7) Casper Ti. Vector
2019-12-21  9:26           ` s6 usability Jan Braun
2019-12-21 18:36             ` Guillermo
2019-12-21 21:19             ` Colin Booth
2019-12-22  1:05               ` Jan Braun
2019-12-22  8:30                 ` Colin Booth
2019-12-21 23:46             ` Laurent Bercot
2019-12-22  5:53               ` Jan Braun
2019-12-22 20:33               ` Steve Litt
2019-12-22 23:20                 ` Laurent Bercot
2019-12-23  1:28                   ` Oliver Schad
2019-12-23  9:14                     ` Laurent Bercot
2019-12-23 10:15                     ` Jonathan de Boyne Pollard
2019-12-24  0:18                       ` Oliver Schad
2019-12-23  1:57                   ` Steve Litt
2019-12-23  9:00                     ` Laurent Bercot
2019-12-22 23:47                 ` Dewayne Geraghty
2019-12-04 11:36         ` runit patches to fix compiler warnings on RHEL 7 Jonathan de Boyne Pollard
2019-12-04 16:40           ` J. Lewis Muir
2019-12-04 20:48             ` Laurent Bercot
2019-12-04 21:32               ` J. Lewis Muir
2019-12-04 21:06             ` Steve Litt
2019-12-04 21:50               ` Laurent Bercot
     [not found]                 ` <20191205132736.7f501460@puter>
2019-12-08 19:10                   ` Laurent Bercot
2019-12-02 17:57       ` J. Lewis Muir
2019-12-02 21:06         ` J. Lewis Muir
2019-12-02 22:22           ` Laurent Bercot
2019-12-02 21:58         ` Laurent Bercot [this message]
2019-12-03 10:57           ` Benjamin Franksen
2019-12-04 10:43       ` Jonathan de Boyne Pollard
2019-12-02 17:13     ` J. Lewis Muir
2019-12-04 11:13       ` Jonathan de Boyne Pollard

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=em67dc4e6e-a425-4bc0-9243-fe80d13151eb@elzian \
    --to=ska-supervision@skarnet.org \
    --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).