[systemd-devel] user service dependency on udev's uaccess rules
Lennart Poettering
lennart at poettering.net
Mon Nov 25 10:50:50 UTC 2024
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)
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list