Help: connect to different dbus session addresses

Joan Torres joan.torres at suse.com
Mon Nov 28 16:24:34 UTC 2022


On 28/11/22 17:00, Zeeshan Ali Khan wrote:
> Hi Joan,
> 
>> This daemon has to connect also to different dbus sessions of different
>> users to use org.freedestkop.systemd1.Manager interface to start a unit
>> service on each session. Here I am in the trouble because the daemon
>> can't connect to other user dbus sessions if it is running as gdm user.
> 
> Why not have a session service setup to start automatically on each
> session start?
That was the initial idea, but there is some data from the system daemon
that needs to know when starting the service and also, the system daemon
is the one responsible for starting and stopping the unit.

If we want to make it start automatically on these sessions and give
this data, it would mean add more complexity to the different elements
on the GNOME pipe that start the session to give the data, and that is
what we are trying to avoid.

> In geoclue2 we solved a similar problem by running our main service on
> the system bus as a special system user (or root) and a
> per-session/user agent service and have them talk to each other. The
> agent start on every user session and register itself with the system
> service.
> 
That's very similar to our situation. Instead of registering, our
session unit must identify which dbus path use on system daemon to
handover a connection.

-- 
Joan Torres
SUSE HW Enablement Team



More information about the dbus mailing list