patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: Demi Marie Obenour <demiobenour@gmail.com>, devel@spectrum-os.org
Cc: Yureka Lilian <yureka@cyberchaos.dev>
Subject: Re: [PATCH 1/3] tools/router: use socket activation
Date: Tue, 09 Dec 2025 12:01:51 +0100	[thread overview]
Message-ID: <87tsxzkjfk.fsf@alyssa.is> (raw)
In-Reply-To: <6546d65a-7ee7-4cef-a2da-0f278edec308@gmail.com>

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

Demi Marie Obenour <demiobenour@gmail.com> writes:

> On 12/9/25 05:55, Alyssa Ross wrote:
>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>> 
>>> On 12/8/25 19:38, Alyssa Ross wrote:
>>>> This means we can use readiness notification to wait until the sockets
>>>> are created without having to add special functionality for that to
>>>> the router program, and also means we can do extra system-specific
>>>> setup to the sockets, like changing their owners, outside of the
>>>> router.
>>>>
>>>> Since the socket paths were the only arguments taken by the router,
>>>> this also lets us drop the clap dependency entirely.
>>>
>>> I strongly recommend open-coding the file descriptor stuff instead
>>> of using a third-party library for it.  It's just a two calls to
>>> getsockopt() (SO_DOMAIN and SO_TYPE) per socket, and listenfd pulls
>>> in wasm-bindgen and js-sys!
>> 
>> It pulls in wasm-bindgen and js-sys if you're building for those
>> platforms, which we are not.  An inert mention in Cargo.lock is not a
>> problem.  The only dependency of listenfd in our context (checked via
>> cargo tree) is on libc, which is already a dependency of tokio.
>> 
>> I've implemented systemd socket activation in Rust before, and it's not
>> at all nice, even with libsystemd.  listenfd adds 295 extra lines of
>> code in total.  I think that's worth it.
>
> Ah, I didn't mean to actually implement the whole thing, but rather
> to open-code the specific case used here.
>
> If listenfd is a very popular crate, I'd go with it.  Otherwise,
> I'd be too concerned about supply-chain risk.  On the other hand,
> I might be too used to having to use Fedora and Debian packages for
> my Rust dependencies.

"#28 in Unix APIs", ahead of landlock and just behind libseccomp.

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

  reply	other threads:[~2025-12-09 11:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09  0:38 [PATCH 1/3] tools/router: use socket activation Alyssa Ross
2025-12-09  0:38 ` [PATCH 2/3] host/rootfs: put router app sockets in own dir Alyssa Ross
2025-12-09  0:38 ` [PATCH 3/3] host/rootfs: run router as non-root Alyssa Ross
2025-12-09 10:48 ` [PATCH 1/3] tools/router: use socket activation Demi Marie Obenour
2025-12-09 10:55   ` Alyssa Ross
2025-12-09 10:59     ` Demi Marie Obenour
2025-12-09 11:01       ` Alyssa Ross [this message]
2025-12-09 11:04         ` Demi Marie Obenour
2025-12-09 11:04         ` Alyssa Ross
2025-12-09 11:25           ` 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=87tsxzkjfk.fsf@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=yureka@cyberchaos.dev \
    /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).