[systemd-devel] systemd and varlink

Lennart Poettering lennart at poettering.net
Fri Nov 29 09:48:17 UTC 2024


On Do, 28.11.24 15:22, Umut Tezduyar Lindskog (Umut.Tezduyar at axis.com) wrote:

> Thank you for your comprehensive answer and your time. I have a good
> understanding.
>
> /proc/net/unix with xattr sounds like a good idea. I guess one
> caveat is that it won’t show the activatable varlinks.

No that should work fine too. We would then add a new systemd .socket
file setting ExtendedAttribute= or so which we could use to tell
systemd to already set the relevant xattr on the entry point inode
when it creates it, so that any AF_UNIX varlink socket could be
recognizable like that regardless if activatable or not.

> Maybe we are talking about 2 kinds of discovery, one of them is the
> service discovery and the other one is the interface discovery
> (registry of which services implement what interface). Maybe the
> service discovery can happen on the file system level (any file in
> /run/varlink folder is a varlink service which should reply to
> Describe interface). I don’t think having a process to resolve the
> good name to socket makes sense for something this simple.

So I kinda like using kernel facilities for discovery, because it's
always there and comes with some basic access control (i.e. you can
only bind a socket in a dir you have write access to).

> Maybe the interface discovery should happen on the interested
> services address space. For example, an API that watches and
> traverses through the service discovery folder and asks each varlink
> about their interfaces to create a registry. The interface discovery
> curious service pays the price of keeping a registry. Maybe the API
> can be part of the sd-varlink in libsystemd.

Well, if one day the /proc/net/unix thing would work I think we should
expose this functionality via Varlink too, so that you can just do a
method call to get a list of all local Varlink sockets, from where you
could then go on.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list