Using D-Bus for private IPC

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon Sep 26 21:23:08 UTC 2022


On Mon, 26 Sep 2022 14:34:00 -0400, Link Dupont wrote:

> It's a one-to-many model, so I'm not sure peer-to-peer would work.
> One process is the server, and there are many processes that are
> clients.

So you do the conventional thing, and have the server listen on a socket
for incoming connections. It can accept as many client connections as
it can handle.

Also if you use AF_UNIX sockets, you can query the credentials of the
process at the other end, and do authentication that way.

And on Mon, 26 Sep 2022 11:39:12 -0400, Link Dupont wrote:

> Is there a better way to create a private bus session from within a
> systemd unit, or is 'ExecStart=dbus-run-session /usr/bin/myprog' the
> recommended way to start up a private bus?

systemd also allows you to tell it you have a socket, and it will
automatically launch your listener on demand
<https://www.freedesktop.org/software/systemd/man/systemd.socket.html>.


More information about the dbus mailing list