[systemd-devel] Logind: how to access a device when you're not the session controller

Pekka Paalanen ppaalanen at gmail.com
Tue May 26 13:55:19 UTC 2020


Hi,

I'm looking at letting Weston's 'meson test' run DRM-backend tests
automatically and without the need of root privileges. I have a spare
DRM device in my machine that is dedicated for this purpose, so I make
my normal desktop environment not touch it. My problem is, is there any
way to set up things so that logind would give Weston access to that
DRM device while my normal desktop is active?

I can keep the spare DRM device in the default seat, or I can assign it
to a seat of its own.

If I assign it to a seat of its own, I don't know how to tell logind
that, from within my current session on the default seat, I would like
to take over the other seat as well, but from a different process.

If I keep the spare DRM device on the default seat, I think logind
wouldn't give Weston access, because it is not the session controller.
My normal desktop environment has the session control.

I have a feeling that I'm trying to do things backwards: that seats
spawn sessions on them, and not sessions taking over seats.

Any suggestions on what might work?

I thought that assigning the spare DRM device to a non-default seat
would implicitly make everything work: my normal desktop automatically
ignores it, the Weston test won't attempt to open my input devices
since those are all in the default seat, I don't have to point weston
to a specific device but just the seat, using non-default seat implies
not touching anything about VTs so no special-casing those, and logind
would let me run as a normal user. Too good to be true?

If I can't make logind work, my fallback plan is to use Weston's
launcher-direct, which will attempt to open the DRM device directly.
For that, I need to change the device node permissions, and modify
launcher-direct to work as non-root, without touching any VT stuff, and
never get/drop DRM master.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200526/dd62f002/attachment.sig>


More information about the systemd-devel mailing list