supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Jan Braun <janbraun@gmx.de>
To: Paul Sopka <psopka@sopka.ch>
Cc: supervision@list.skarnet.org
Subject: Re: s6/s6-rc policy for Gentoo
Date: Mon, 8 Jul 2024 12:48:37 +0200	[thread overview]
Message-ID: <ZovEBTkjn2G_H0sC@abakus> (raw)
In-Reply-To: <e239ea99-0740-4d19-ba58-640b6b2312ed@sopka.ch>

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

Paul Sopka schrob:
> An alternative would be two main bundles per user service tree, that itself
> always starts on boot:
> 
> One to start at boot time.
> Another one to start on first login and stop on last login.
> This seems the most elegant and efficient. Am I overlooking anything?

I am not too familiar with s6 bundles (I use runit, not s6), but that
sounds reasonable.

> > This sounds unnecessarily complicated. Why not simply test for existence
> > of a well-known entry point somewhere in $HOME and let that set up the
> > user supervision tree however it sees fit (or not at all)?
> 
> If I understand correctly, this would only be possible using instantiated
> services, I like the idea and I am looking into this.

Not sure what you mean by "instantiated services". But see below.

> > Ugh. I hate this thinking. [...]
> 
> It looks like I just do not have enough experience, that's why I am asking
> you all on those points. You are right.

Sorry for my tone, I realize I was grumpy, possibly offensively so. You
took it well, thanks. :)

> Using the idea I stated above, one could use different PAM modules to start
> different bundles tho, e.g. an ssh bundle on ssh login, a getty bundle on
> getty login, a greetd bundle on greetd login.

While I don't know why one would want to differentiate between those,
you probably can do that quite straightforwardly with pam_exec(8)
calling a tiny script that tracks the number of active sessions (of type
"$1") and calls s6-rc on zeroes.


And if you want to make this machinery user-customizable, you'll need
three user entry points:
~/.foo/supervisor
    defaulting to "s6-svscan $scandir"
~/.foo/login <type> <concurrent>
    defaulting to "if $concurrent == 0 then s6-rc start $type"
~/.foo/logout <type> <concurrent>
    defaulting to "if $concurrent == 0 then s6-rc stop $type"

And you'll need one admin action which creates the service supervising
~$USER/.foo/supervisor (if that service doesn't exist yet). To be
triggered on user account creation, or probably on login if things like
ldap are involved.

regards,
    Jan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-07-08 10:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 14:09 Paul Sopka
2024-07-05 20:23 ` Mobin Aydinfar
2024-07-05 21:43   ` Paul Sopka
2024-07-05 20:54 ` Laurent Bercot
2024-07-05 22:27   ` Paul Sopka
2024-07-06 10:40     ` Laurent Bercot
2024-07-06 13:09       ` Paul Sopka
2024-07-07 15:18         ` Hoël Bézier
2024-07-07 15:56           ` Paul Sopka
2024-07-08  7:16         ` Jan Braun
2024-07-08  9:03           ` Paul Sopka
2024-07-08 10:48             ` Jan Braun [this message]
2024-07-08 13:10               ` Paul Sopka
     [not found] ` <CAN09KnJje7L-W5BaBjMgPou_=uXwfZvsLGrnoirofRNqdU+Yqw@mail.gmail.com>
2024-07-05 23:03   ` Paul Sopka

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=ZovEBTkjn2G_H0sC@abakus \
    --to=janbraun@gmx.de \
    --cc=psopka@sopka.ch \
    --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).