supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Peter Shkenev" <petershh@disroot.org>
To: "Ihor Antonov" <ihor@antonovs.family>, <supervision@list.skarnet.org>
Subject: Re: s6-rc as user service manager
Date: Mon, 17 Oct 2022 23:42:02 +0300	[thread overview]
Message-ID: <8F72C59D-7F58-4084-94B4-CBEF75421327@disroot.org> (raw)
In-Reply-To: <20221017175034.jmwoagcwrd6k4j2r@localhost>

Hello,

On Mon Oct 17, 2022 at 8:50 PM MSK, Ihor Antonov wrote:
> Kicking off another thread because it is slightly different from UX
> related questions.
>
> I am trying to get s6-rc set up as a user service manager (similar how
> systemd allows user's to manage their own services with systemctl --user
> start bla).
> This is useful for example for starting user's dbus, pipewire,
> xdg-desktop-portal services, and other stuff that is strictly user
> related.
>
> This usecase is geared towards a desktop/laptop.

(There were numerous rants of user services by Laurent Bercot and Colin
Booth on IRC, and I'm going to use those rants as a source).

Firstly, let's try to define "user services" without "bla". There are
three very different options:

1) User services are services running as a given user and started at a
boot time
This option is a trivial one with s6.

2) User services are services defined by users and running supervised
when the user wants it.
You can implement this with s6-usertree-maker [1], which would provide
you with a supervision tree rooted in a system one which can be managed
by user. User will have its own scandir and they can use all commands
provided by s6/s6-rc on their scandir.

3) User services are services that are started when user logs in.
I guess this is what you had in mind when you was typing your letter.
This is the hardest one and badly defined one. There are a lot of
questions:

- What does "user logs in" mean? Do we want services to be
  started when user logs in on the console or at seat? Sshd? Serial
  line?

- When do we stop services? "When the user logs out"? And if the user
  has both an X session and a shell in a console? We need to wait for
  the last connection to drop? How would we get this information? One
  needs some time to shut down the supervision tree.
  One can remember how did systemd killed all user processes on the
  logout.

- Moreover, some services (pipewire, for example) are supposed to be run
  in certain cases, e.g. a graphical session.

- There may be a lot of questions I don't know about.

> - Minor: a test utility for svscan dir would be nice
> - Minor: a test utility for live dir would be nice

If you use s6-rc, those are the same directories, filled by s6-rc-init
and changed by s6-rc-update. So the test would actually test those
utilities, I guess.

[1] https://skarnet.org/software/s6/s6-usertree-maker.html

---
Best regards,
Peter

  reply	other threads:[~2022-10-17 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 17:50 Ihor Antonov
2022-10-17 20:42 ` Peter Shkenev [this message]
2022-10-17 23:49   ` Ihor Antonov
2022-10-18  0:58     ` Laurent Bercot
2022-10-18  3:12       ` Ihor Antonov

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=8F72C59D-7F58-4084-94B4-CBEF75421327@disroot.org \
    --to=petershh@disroot.org \
    --cc=ihor@antonovs.family \
    --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).