patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: James Smith <james.software.smith@gmail.com>,
	nrr@corvidae.org, Demi Marie Obenour <demiobenour@gmail.com>
Cc: systemd <systemd-devel@lists.freedesktop.org>,
	Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: Arranging groups of services
Date: Wed, 20 Aug 2025 16:01:05 +0200	[thread overview]
Message-ID: <875xeium72.fsf@alyssa.is> (raw)
In-Reply-To: <CAOeoMYnB+rZY8txszpB5rEi4iy9Dt=B71Uvh1yC-ZBoEgXONhw@mail.gmail.com>

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

James Smith <james.software.smith@gmail.com> writes:

> Forwarding for <Nathaniel Reindal nrr@corvidae.org> on this :
>
> Both systemd and s6, so I might be uniquely qualified here. (Though, I must
> admit that I haven't been deep in systemd's internals lately.)
>
> Any chance I can take a peek at some s6 service directories to get a better
> idea of how things work currently? A quick perusal of the spectrum git tree
> wasn't terribly enlightening.

Hi James, thanks for offering to have a look!

For the host, s6 services are here:

https://spectrum-os.org/git/spectrum/tree/host/rootfs/etc/s6-linux-init/run-image/service

And some s6-rc services are here:

https://spectrum-os.org/git/spectrum/tree/host/rootfs/etc/s6-rc

My idea for grouping services with s6 was going to be running an
s6-svscan instance for each VM, inside a cgroup, running virtiofsd,
cloud-hypervisor, etc. below it.  That way we'd be able to enforce
resource limits per-VM.

> On Sat, Aug 16, 2025, 6:11 PM Demi Marie Obenour <demiobenour@gmail.com>
> wrote:
>
> I'm working on Spectrum OS (https://spectrum-os.org/) and am
> currently porting it from s6 (https://skarnet.org/software/s6-linux-init/)
> to systemd.
>
> Spectrum OS's host (which is what is being ported) is rather
> different from a normal system:
>
> - The root filesystem is completely read-only.  There's no writable /var.
>   I decided to put a tmpfs there for now.
> - There is no network access, so /etc/resolv.conf isn't needed.
> - The real work happens in VMs, each of which depends on a few services:
>   - Cloud Hypervisor (https://www.cloudhypervisor.org) which runs the VM.
>   - crosvm (https://crosvm.dev/book/) used for graphics.
>   - virtiofsd (https://virtio-fs.gitlab.io) to provide a filesystem
>   - Spectrum OS's own proxy for the XDG desktop portals
>   - In the future, an instance of vhost-device-sound
>     (
> https://github.com/rust-vmm/vhost-device/blob/main/vhost-device-sound/README.md
> )
>     used for sound
>   - A per-VM D-Bus daemon
>   - An instance of xdg-desktop-portal
>
> If the Cloud Hypervisor instance is stopped or exits, the others
> should be stopped automatically, as they have no other use.
> Having BindsTo=, After=, PropagatesStopTo=, and PropagatesReloadTo=
> should handle most cases, but I don't know if that is sufficient
> if Cloud Hypervisor exits spontaneously (because the guest shut down)
> or crashes.
>
> Additionally, these services have different sandboxing needs.
> Cloud Hypervisor should only be able to connect to its own instance
> of the daemons that serve it, rather than to any instance.
> crosvm needs GPU and Wayland access and vhost-device-sound needs
> to connect to PipeWire.  virtiofsd needs an id-mapped mount.
> I would also like to block abstract AF_UNIX socket access.
>
> Are there existing systemd features that can easily meet these
> needs?  For the sockets I am thinking of placing them in
> RuntimeDirectory= and only giving the correct units access to
> those directories.  Also, I would like to use `DynamicUser=`
> for everything where that is possible.

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

  reply	other threads:[~2025-08-20 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17 14:34 Arranging groups of services James Smith
2025-08-20 14:01 ` Alyssa Ross [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-16 23:11 Demi Marie Obenour

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=875xeium72.fsf@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=james.software.smith@gmail.com \
    --cc=nrr@corvidae.org \
    --cc=systemd-devel@lists.freedesktop.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.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

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).