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 <supervision@list.skarnet.org>
Subject: Re: Readiness notification exemplars
Date: Wed, 01 Apr 2020 14:55:26 +0000	[thread overview]
Message-ID: <em1dfb8e5a-f9b2-4f9d-ab78-199078c694a4@elzian> (raw)
In-Reply-To: <CAGSetNuLfBwTT_-F=HoDAoDYWoW1qHbfeVqD83BvSpJKpkwv=w@mail.gmail.com>

>I am curious, does anyone on this list know of examples of such daemons? I
>am considering creating and submitting patches for some daemon programs
>that I use that do *not* support this mechanism as yet, and am curious if
>it is as simple as it looks like it should be.

  - I'm trying to make it so that all my long-lived programs that provide
a service support this. For instance, s6-log as Casper mentioned, but
also s6-[ipc|tcp]server[d], which are the basic building blocks for
simple service implementation.

  - There is a non-negligible amount of existing daemons in the wild that
happen to print a line when they're ready, even though they're not
necessarily aware that printing such a line can be used as readiness
notification. For instance:
    * dbus-daemon has the --print-address=fd option that can be used
to notify readiness (since the address of the bus is only known after
the bus socket is ready).
    * Xorg has the -displayfd option that can also be used for the
same purpose (since it only knows its display once it is ready)
    * Lots of daemons have an option to print a pidfile. If you run
them and give /dev/fd/3 (or whatever your notification-fd is) as a
pidfile, they will trigger the notification mechanism when attempting
to print their pidfile. Be aware, though, that it does not necessarily
mean they're ready; they *should* be, because they should not stamp
their pid once they're certain they're going to provide service, but
they don't have to, because they know their pid as soon as they're
running - and since they're designed badly enough to think a pidfile
is a good thing, it's also very possible that they're printing it too
early. So you have to check with the daemon's source before using the
pidfile option as a readiness check.

  It is definitely as simple as it looks, it was designed to be able to
reuse existing daemon behaviours, and I strongly encourage you to submit
patches to spread the use of the mechanism :)

--
  Laurent



      parent reply	other threads:[~2020-04-01 14:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 13:23 Brett Neumeier
2020-04-01 13:36 ` Casper Ti. Vector
2020-04-01 14:21 ` Serge E. Hallyn
2020-04-01 15:06   ` Laurent Bercot
2020-04-01 15:28     ` Serge E. Hallyn
2020-04-01 15:59       ` Laurent Bercot
2020-04-01 16:26         ` Serge E. Hallyn
2020-04-01 17:13           ` Laurent Bercot
2020-04-04 15:02             ` Serge E. Hallyn
2020-04-04 15:54               ` Laurent Bercot
2020-04-03  7:41           ` Jonathan de Boyne Pollard
2020-04-04 15:48             ` Serge E. Hallyn
2020-04-04 21:29               ` Laurent Bercot
2020-04-04 22:18                 ` Serge E. Hallyn
2020-04-07 23:03                   ` Brett Neumeier
2020-04-08 11:02                     ` Laurent Bercot
2020-04-09 10:31                     ` Jonathan de Boyne Pollard
2020-04-01 14:55 ` Laurent Bercot [this message]

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=em1dfb8e5a-f9b2-4f9d-ab78-199078c694a4@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).