[systemd-devel] starting qt application after DRM initialized
Belisko Marek
marek.belisko at gmail.com
Fri Dec 7 11:45:30 UTC 2018
On Fri, Dec 7, 2018 at 12:34 PM Lennart Poettering
<lennart at poettering.net> wrote:
>
> On Do, 06.12.18 22:58, Belisko Marek (marek.belisko at gmail.com) wrote:
>
> > [Unit]
> > Description=Demo
> > After=systemd-user-sessions.service
> >
> > [Service]
> > ExecStart=-/usr/bin/appcontroller /opt/test --applications-root /data/user/qt
> >
> > [Install]
> > WantedBy=multi-user.target
> >
> > I think it is some kind of timing issue as when booting same image
> > from usb stick application will automatically start while when booting
> > from hdd I get above error. Would be possible to postpone it somehow
> > until DRM display is initialized? Thanks.
>
> You have two options:
>
> 1. The correct solution: make your tool wait internally that the
> CanGraphical= bus property of logind's Seat object "seat0" turns to
> "true". Then enumerate all devices belonging to the Seat, and open
> and use them. This is how "gdm" does and how this should be done in
> generic codepaths.
>
> 2. If you want a quicker, slightly sloppy solution that only works if
> you design for a specific hardware setup you know well: mark your
> drm device via a udev rule with the "systemd" tag
> (TAGS+="systemd"). This makes the drm device show up as a ".device"
> unit in systemd. Then, change your service to say "Wants=…" and
> "After=…" that .device unit. This then makes sure that the service
> will not even be started before the device is around.
Thanks a lot for valuable info. I'll try and get back with results.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
BR,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
More information about the systemd-devel
mailing list