[systemd-devel] Ordering after udev applied rules to `/dev/dri/card0`

Lennart Poettering lennart at poettering.net
Tue Mar 31 15:09:27 UTC 2020


On Do, 19.03.20 20:24, Andrei Borzenkov (arvidjaar at gmail.com) wrote:

> 19.03.2020 19:47, Paul Menzel пишет:
> > Dear systemd folks,
> >
> >
> > I am using Debian Sid/unstable with systemd 245.2 and Weston 8.0.0.
> >
> > I amtrying to start a graphical desktop as soon as possible. Currently,
> > I use Weston, but unfortunately accessing `/dev/dri/card0` it gets a
> > permission denied error. The Weston service unit is ordered after
> > `systemd-logind.service`.
> >
> > Weston now fails to start, because it gets a permission denied error
> > accessing `/dev/dri/card0` [1][2].
> >
> >     drmModeSetCrtc(backend->drm.fd, output->crtc_id,
> > scanout_state->fb->fb_id, 0, 0, connectors, n_conn, &mode->mode_info);
> >
> > Right before Weston starts, the permission and ownership are like below.
> >
> >     $ ls -l /dev/dri:
> >     insgesamt 0
> >     crw------- 1 root root 226,   0 Mär 19 17:29 card0
> >     crw------- 1 root root 226, 128 Mär 19 17:29 renderD128
> >
> > After udev applied the rules, it looks like below, meaning users in
> > group `video` are allowed to access the device.
> >
> >     $ ls -l /dev/dri
> >     insgesamt 0
> >     drwxr-xr-x  2 root root         80 Mär 19 17:29 by-path
> >     crw-rw----+ 1 root video  226,   0 Mär 19 17:29 card0
> >     crw-rw----+ 1 root render 226, 128 Mär 19 17:29 renderD128
> >
> > Is there a way to order a service in such a way, that it’s guaranteed
> > that udev rules to devices were applied?
> >
>
> After=device should work. udev announces device after all rules have
> been processed.

After= only orders, but this doesn't pull the device unit into the job
queue. To do that, you need to add Wants= on the device unit as well.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list