[systemd-devel] user service dependency on udev's uaccess rules

Mantas Mikulėnas grawity at gmail.com
Mon Nov 25 11:21:00 UTC 2024


On Mon, Nov 25, 2024 at 12:57 PM Lennart Poettering <lennart at poettering.net>
wrote:

> On So, 24.11.24 12:35, Michael Kilburn (crusader.mike at gmail.com) wrote:
>
> > Hi,
> >
> > OS: Pop!_OS 22.04 LTS (Debian-based distro). User service (fluidsynth)
> > fails to start on user login:
> >
> > ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed:
> > Permission denied
> >
> > because at that moment that device's ACL was not updated yet (to grant
> > access to the user being logged in).
> >
> > When an active user logs in udev executes rules stored in
> > /lib/udev/rules.d/70-uaccess.rules (via 73-seat-late.rules) to grant that
> > user access to local devices (like soundcard, etc).
> >
> > Is there a way to express this dependency between user service and
> > completion of execution of udev rules?
> >
> > Or (if this is a wrong approach) -- what is the correct way to deal with
> > this?
>
> "uaccess" ḿeans access to devices can come and go any time, as the
> user switches sessions, as sessions come and go. This means programs
> which want access to such devices need to be written with this in
> mind: watch udev events, and try to reopen the devices whenever you
> receive an event for the relevant audio device and access is
> permitted. (logind will re-retrigger relevant devices whenever the fg
> session changes, so that the udev rules are rerun and apps are
> notified about the new situation via udev events)
>

I don't see logind doing that here. It seems to only set the new ACLs
directly (devnode_acl_all() in seat.c) but there are no uevents that I
could see during a VT switch.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20241125/b91d02da/attachment-0001.htm>


More information about the systemd-devel mailing list