From: Demi Marie Obenour <demiobenour@gmail.com>
To: Alyssa Ross <hi@alyssa.is>, devel@spectrum-os.org
Cc: Yureka Lilian <yureka@cyberchaos.dev>
Subject: Re: [PATCH 1/3] tools/router: use socket activation
Date: Tue, 9 Dec 2025 06:25:08 -0500 [thread overview]
Message-ID: <1c3740e8-019e-43c4-894d-3ce79beb7382@gmail.com> (raw)
In-Reply-To: <87pl8nkjao.fsf@alyssa.is>
[-- Attachment #1.1.1: Type: text/plain, Size: 2098 bytes --]
On 12/9/25 06:04, Alyssa Ross wrote:
> Alyssa Ross <hi@alyssa.is> writes:
>
>> 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.
>
> (And also packaged by both Fedora and Debian.)
Go ahead and use it then!
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2025-12-09 11:25 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
2025-12-09 11:04 ` Demi Marie Obenour
2025-12-09 11:04 ` Alyssa Ross
2025-12-09 11:25 ` Demi Marie Obenour [this message]
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=1c3740e8-019e-43c4-894d-3ce79beb7382@gmail.com \
--to=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
--cc=hi@alyssa.is \
--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).