supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Paul Sopka <psopka@sopka.ch>
To: supervision@list.skarnet.org,
	Laurent Bercot <ska-supervision@skarnet.org>
Subject: Re: Have an external script wait for a oneshot service
Date: Fri, 6 Dec 2024 13:41:34 +0100	[thread overview]
Message-ID: <e5a58bbd-b00f-4756-bd57-662d09456524@sopka.ch> (raw)
In-Reply-To: <em06859e26-3823-444a-9cba-a3e13c5d06da@7c9fd885.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 4676 bytes --]

>  Exactly. That's the YAGNI principle: don't try to solve problems you
> haven't encountered yet. Chances are you'll actually never encounter
> them. Adding complexity in the name of "just in case" is overengineering
> and it will only worsen your design.
We now have two examples of application from the other mails.

>  And if I have learned anything about users, it's that most of your
> users will have trouble understanding what a supervised service is,
> and if you start talking about them about s6-rc services, their brain
> will start melting and they'll run away from your system as fast as
> they can. And they won't be wrong. 
When I talked about "users", I mean people actually *using* these tools,
meaning s6, s6rc, execline, POSIX tools, ... hence power users and 
distribution maintainers.
People using their computers only to consume media or write documents 
(whom I will refer to as consumers),
will use Windows, MacOS or, in the best case, a highly managed Linux 
distro anyway.
Thus I do not consider them, since they will never interact with
service management directly anyway.

I therefore try to make life as easy as possible for power users
and distribution maintainers, who manage their own supervision trees
or setup the presets for said managed distros respectively.

>  The user has a supervision tree. They can install their longrun directly
> in it. They don't need s6-rc for that. Pure s6 is enough.
>  Their service will run as long as they keep it there. They can stop
> it with s6-svc. Or s6-svunlink. 

Assuming s6-rc is used for the main supervision tree and on login,
which is fair, since the very thing we discuss about is part of my project
doing all of that with s6-rc,
this would cause users to need to learn s6 additionally to s6-rc,
when s6-rc can be used for all cases.

>  You want to run s6-rc at login time, sure, I can totally see where i
> can be beneficial there. But earlier? Even systemd doesn't run user
> stuff before a user logs in. And if *they* don't do it, it means that
> there are ZERO use cases.
This is an argumentum ad verecundiam.
Systemd is fundamentally flawed in other places too.

>  And what is preventing that? The fact that your default bundle does not
> include the services that the user has defined themself. This should give
> you a hint that this design goes against what supervision is supposed to
> be doing, and thus, that it's not a good design. Whatever longrun the
> user wants to have survive a reboot should survive a reboot and the
> user shouldn't need a PhD to accomplish that. 
>  If the user has installed their service in the pure s6 way with e.g.
> one (1) call to s6-svlink, it works: after a reboot, the snooze will
> be back up. 
We have, due to my poor wording, a misunderstanding here:
Said "default" bundle is part of the user's user-tree,
it is entirely under his control and offers the user a way to have
user-services started at boot time.

I have assumed that the scan-directory of the user-tree is mounted tmpfs.
This would require additional support in 1a/2a
to save the state of the scan-directory on shutdown and load it on boot.
Or let s6-rc-init and s6-rc do this work, by adding the service to the 
user-tree bundle "default"
and running s6-rc for each user-tree at boot.

>  It's more inconvenient, complex and inconsistent because you want to
> keep the framework that makes it so. Remove a little more and you'll
> have something elegant again.
What is the "little more" you are talking about?

>  Little to no cost? This whole thread is about the costs! And from my
> perspective, "probably going to be useful at some point" is a pretty
> light argument, it's definitely not going to outweigh "too complex to
> make work properly". 
The cost is, quoting myself, one(mutually exclusive) of the following:

> - S1    Script s6-fifodir functionality in bot the system-oneshot 
> 1b/2c and the script L.
>
> - S2    Add a readiness api for s6-rc oneshots like s6 longruns have 
> and wait for that of system-oneshot 1b/2c in the script.
>
> - S3    Have the script L do the same as system-oneshot 1b/2c:
>         - 1bi/2ci    Prepare the live directory for the user-tree 
> (preferably under /run/user/${USER}).
>         - 1bii/2cii    Start "s6-rc-init -b" and "s6-rc start login".
>   Utilizing blocking locks and tests to work parallel to 
> system-oneshot 1b/2c.
>   This can only be done if the script is ran through PAM, 
> since 1bi/2ci requires root privileges. 
I do not see where this exceeds "little".

Regards

Paul


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3195 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2024-12-06 12:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 15:28 Paul Sopka
2024-12-04 15:38 ` Charles Cazabon via supervision
2024-12-04 17:12   ` Paul Sopka
2024-12-04 21:47     ` Hoël Bézier
2024-12-04 20:00 ` Brett Neumeier via supervision
2024-12-04 20:05   ` Paul Sopka
2024-12-04 20:18     ` Brett Neumeier via supervision
2024-12-04 20:59       ` Paul Sopka
2024-12-04 21:58         ` Re[2]: " Laurent Bercot
2024-12-05  5:59           ` Tanuj Bagaria
2024-12-05  6:54           ` Paul Sopka
2024-12-05  8:05             ` Re[2]: " Laurent Bercot
2024-12-05 13:52               ` Paul Sopka
2024-12-05 19:44                 ` Re[2]: " Laurent Bercot
2024-12-05 21:10                   ` Paul Sopka
2024-12-05 21:42                     ` Brett Neumeier via supervision
2024-12-06  5:32                       ` Paul Sopka
2024-12-05 23:03                     ` Re[2]: " Laurent Bercot
2024-12-06 12:41                       ` Paul Sopka [this message]
2024-12-06 15:43                         ` Laurent Bercot
2024-12-06 16:11                           ` Hoël Bézier
2024-12-06 17:14                           ` Paul Sopka
2024-12-07 23:46                           ` Jan Braun
2024-12-05 21:24                   ` Jan Braun
2024-12-05 23:15                     ` Re[2]: " Laurent Bercot
2024-12-04 20:09   ` Tanuj Bagaria

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=e5a58bbd-b00f-4756-bd57-662d09456524@sopka.ch \
    --to=psopka@sopka.ch \
    --cc=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).