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: superstition <supervision@list.skarnet.org>
Subject: Re: runit SIGPWR support
Date: Mon, 24 Feb 2020 00:33:34 +0000	[thread overview]
Message-ID: <emd3af536f-b2e9-43b3-a7ec-0379f8a502a0@elzian> (raw)
In-Reply-To: <6637411582479111@sas8-ed615920eca2.qloud-c.yandex.net>

>have you ever used s6 as process #1 on any other platform than Linux ?
>i bet you have not even tried to do so on any of the BSDs.

The BSDs are a different kind of beast: they're much more tightly
integrated than your run-of-the-mill Linux distro, and you can't
easily switch out one of the components of a BSD distro.

Replacing a BSD's init is absolutely doable: it just requires knowing
exactly what sequence of BSD-specific system calls is needed to
achieve a correct boot, and perform those in a s6-$os-init sequence,
either in stage 1 or stage 2. The problem is that it's not supposed
to be a stable API, so the BSDs are free to change it and the work
would need to be done again.

I don't think that it's worth prioritizing until there is real
traction for s6 which means a chance to get the change upstreamed - and
even then, because for many reasons, most of them good, the BSDs are
extremely reluctant to change if it comes from an outsider. Until it
can be upstreamed, bsd-with-s6-as-pid-1 can't be anything more than a
fun hack. Some people have toyed with it in the #s6 channel though.

Also, s6 works fine on the BSDs as a simple supervisor that doesn't
substitute itself to init, so you can already have its advantages
without the drawbacks. You can even have a strong supervision guarantee
if you use /etc/gettys to start the supervision tree.


>so why are you sticking to all this "POSIX-correctness" ?
>adding a few lines of code to support a specific platform (linux or any other
>unix) looks not like a big problem to me.
>sticking to POSIX features in the default case is a good way to
>achieve portability, that's right.
>but avoiding platform specific advantages at all costs seems
>pretty strange to me.

I value reproducible behaviour very much. When software behaves
differently depending on the platform is run on, it can quickly become
a maintenance nightmare. So unless a nonportable feature is *vital* to
get correct behaviour, I'd rather not use it.

For the SIGPWR and SIGWINCH thing, I made an exception because 1.
correctness is more important than anything else and 2. the patch was
absolutely trivial, so the increase in complexity due to having
architecture-dependent code paths was extremely minor. But the cost
needs to be evaluated on a case-by-case basis.

Note that I'm not avoiding platform-specific advantages when they can
achieve the same functionality. For instance, skalibs declares a
getpeereid() function, which isn't standardized in POSIX. The BSDs all
provide that function in their libc, so skalibs defers to the direct
libc implementation. Linux does not provide it, but has the SO_PEERCRED
option to getsockopt() that provides equivalent functionality. Solaris
doesn't have either of those things, but it has a getpeerucred()
function, which once again allows for some getpeereid() implementation.


>solaris, AIX and even OS X are all POSIX platforms, hence it
>would be interesting to see if s6 will work out of the box there
>(as process #1; handling SIGPWR may be a requirement here).
>i am sure it will since unlike systemd it is portable.

You are making a disingenuous argument. /sbin/init, aka the first
process that is launched by the kernel at boot time, is inherently
non-portable, because the exact API between the kernel and init has
not been standardized and every system does it differently. However,
once the non-portable sequence has been run, there's nothing that
prevents s6 from being able to run as process 1. The separation
between /sbin/init and cruising phase pid 1 is the very reason for
the existence of s6-linux-init (which does the nonportable things
for Linux, then execs into the portable s6-svscan), and the package
is named s6-linux-init because it is implied that there could easily
be s6-freebsd-init, s6-openbsd-init, s6-solaris-init, s6-macos-init
and others in the same vein if someone wanted to write them.

Again, I have not prioritized this work, but that doesn't mean it's
impossible, or even difficult. It just has low value at the moment.

The point is that the s6 package, implementing the supervision
mechanism, should remain portable, because there's no reason at all
it should be OS-dependent. All the nonportable details have been
confined to the s6-$os-init package.


>those platforms cannot be "POSIX-correct" if not.
>hence their kernels should be made "POSIX-correct" to run the
>"POSIX-correct" s6 unchanged as process #1.
>
>so who has to adapt, s6 or those kernels ?

  *You* have to adapt. You need to stop making false dichotomies and
fallacious arguments, because they don't work here. :P

--
  Laurent



  reply	other threads:[~2020-02-24  0:33 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1beb6e35-d4be-60b8-fc52-af666c4fffe3@gmx.com>
2020-02-12 14:25 ` innerspacepilot
2020-02-12 21:54   ` Colin Booth
2020-02-12 22:16     ` Dewayne Geraghty
2020-02-14  9:38     ` Jeff
2020-02-14 12:38       ` Steve Litt
2020-02-15 10:47       ` fungal-net
2020-02-14 10:08     ` Jeff
2020-02-14 10:46     ` Jeff
2020-02-14 12:29       ` innerspacepilot
2020-02-14 12:45         ` Steve Litt
     [not found]           ` <CALZWFRLvtofWfP4kzxJ8_8_K3nzebPjCR-NsJ2MU22cSuaOLng@mail.gmail.com>
     [not found]             ` <20200214182241.15614126@mydesk.domain.cxm>
2020-02-17 19:46               ` Cameron Nemo
2020-02-23 16:11                 ` Jeff
2020-02-17 14:39         ` Jeff
2020-02-14 14:02       ` Casper Ti. Vector
2020-02-17 14:45     ` Jeff
2020-02-17 14:50       ` Jeff
2020-02-14 13:15   ` Casper Ti. Vector
2020-02-14 13:39     ` innerspacepilot
2020-02-14 13:57       ` Casper Ti. Vector
2020-02-14 14:06         ` innerspacepilot
2020-02-14 14:25           ` Casper Ti. Vector
2020-02-14 18:30       ` Laurent Bercot
2020-02-17 10:00         ` innerspacepilot
2020-02-17 15:13           ` Jeff
2020-02-18  9:39             ` Laurent Bercot
2020-02-20 20:39               ` Serge E. Hallyn
2020-02-23 16:51               ` Jeff
2020-02-23 23:53                 ` Laurent Bercot
2020-02-24  6:31                   ` innerspacepilot
2020-02-24 10:23                     ` Laurent Bercot
2020-02-24 13:00                       ` Jeff
2020-02-24 19:53                         ` Laurent Bercot
2020-02-24 13:12                       ` innerspacepilot
2020-02-24 15:26                         ` Serge E. Hallyn
2020-02-26  8:07                           ` innerspacepilot
2020-02-28  6:39                             ` Jan Braun
2020-02-28  9:45                               ` Alex Suykov
2020-02-28 23:50                                 ` fungal-net
2020-02-29 13:44                                 ` Jonathan de Boyne Pollard
2020-02-29 18:20                             ` Guillermo
2020-03-06 20:07                               ` innerspacepilot
2020-03-06 20:09                               ` innerspacepilot
2020-02-25  8:39                       ` Jonathan de Boyne Pollard
2020-02-24 21:13                   ` Guillermo
2020-02-24 22:25                     ` Laurent Bercot
2020-02-24 22:49                       ` Laurent Bercot
2020-02-24 23:08                         ` Guillermo
2020-02-25  1:48                           ` Laurent Bercot
2020-02-25  9:08                             ` Jonathan de Boyne Pollard
2020-02-25 18:38                               ` Guillermo
2020-03-16 12:49                               ` Jeff
2020-03-16 17:13                               ` Jeff
2020-02-24 23:03                       ` Guillermo
2020-03-16 12:31                       ` Jeff
2020-03-16 18:03                         ` Laurent Bercot
2020-02-23 17:31               ` Jeff
2020-02-24  0:33                 ` Laurent Bercot [this message]
2020-02-14 19:08   ` John W Higgins
2020-02-14 23:18     ` Laurent Bercot
2020-02-14 23:38       ` John W Higgins
2020-02-15  2:15         ` Laurent Bercot
2020-04-14 16:57 Maxim Vetsalo
  -- strict thread matches above, loose matches on Subject: below --
2020-01-23 20:44 innerspacepilot
2020-01-31  4:39 ` Colin Booth

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=emd3af536f-b2e9-43b3-a7ec-0379f8a502a0@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).