[systemd-devel] question regarding DBUS_SESSION_BUS_ADDRESS in multiseat environment

Mantas Mikulėnas grawity at gmail.com
Fri Dec 2 08:41:50 UTC 2016


On Fri, Dec 2, 2016 at 10:39 AM, Mantas Mikulėnas <grawity at gmail.com> wrote:

> On Fri, Dec 2, 2016 at 10:28 AM, Mohan R <mohan43u at gmail.com> wrote:
>
>> Hi,
>>
>> I'm working on a display-manager for a multiseat environment. Here is how
>> we use logind
>>
>> 1. create new seat through udev
>> 2. we set the XDG_SEAT in pamenv before calling pam_open_session()
>> 3. we take XDG_SESSION_ID, XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS
>> from pam_systemd
>>
>> Let say if a user already have a session(session0) in a seat
>> (customseat0) and he want to start another session in another seat
>> (customseat1). Our display manager would get the same
>> DBUS_SESSION_BUS_ADDRESS from pam_systemd for session1.
>>
>> As we cannot use the same address for two sessions, we have to start
>> dbus-session manually. Using the address provided by dbus-session as
>> DBUS_SESSION_BUS_ADDRESS, we then proceed with starting gnome-keyring and
>> gnome-session.
>>
>> Problem is, processes forked by 'systemd --user' will have
>> DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" but processes
>> forked by gnome-session will have DBUS_SESSION_BUS_ADDRESS=$DBUS
>> _SESSION_PROVIDED_ADDRESS.
>>
>> Is there any way to make pam_systemd provides uniq
>> DBUS_SESSION_BUS_ADDRESS for every session (may be
>> unix:path=$XDG_RUNTIME_DIR/$XDG_SESSION_ID/bus)? or is there any way to
>> ask 'systemd --user' to provide different DBUS_SESSION_BUS_ADDRESS to the
>> childs?
>>
>
> No, only one graphical session at a time is supported. While you can start
> additional sessions using `dbus-run-session` or the old `dbus-launch` (and
> have them run independently, "traditional way"), systemd --user will only
> ever use the main user bus.
>
> Also, if you made systemd specify different bus envvars for different
> services, you wouldn't be able to start the same service for *both*
> sessions at once...
>
> (*Technically,* I suppose it would be possible to make logind start
> per-session instances of --user and so on and so on, but as it is nothing
> like that is supported.)
>
> --
> Mantas Mikulėnas <grawity at gmail.com>
>

(to clarify, the "1 graphical session" limitation is course per-user, not
system-wide)

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20161202/624a4efb/attachment.html>


More information about the systemd-devel mailing list