14.06.2019 17:13, Germano Massullo пишет:
> I have two different options at the moment, and I would like to ask
> you for a feedback.
> 
> 
> A file
> 
> /usr/lib/udev/rules.d/01-boinc-gpu-plugged.rules
> 
> containing
> 
> ACTION=="add", SUBSYSTEM=="drm", RUN+=systemctl --no-block restart
> boinc-client.service
> 
> should restart BOINC client when a new DRM device (under /dev/dri)
> appears. So we can fix the problem that unables BOINC to detect OpenCL
> capabilities if BOINC service is loaded before the videocard drivers.
> 
> Flag
> --no-block
> is needed to avoid udev time it out agains things runned by RUN. When
> udev runs something with RUN it has a timeout and it kills the process
> after that so that udev doesn't get blocked on some long running
> script triggered from a rule.
> By the way since udev has various sandbox rules that restict things
> like what sort of sockets you can connect to and what system calls can
> be used, this approach could not be recommended.
> 
> Another approach that should avoid this problems is
> 
> ACTION=="add", SUBSYSTEM=="drm", TAG+="systemd",
> ENV{SYSTEMD_WANTS}+="boinc-restart.service"
> 
> and then have a simple service (""boinc-restart.service") that does
> the restart. By the way this means that the machine will have two
> systemd unit files for BOINC client and perhaps even a
> boinc-restart.service marked as running among running services.
> 
> What do you think about?

Third approach - your service listens to udev events and automatically
discovers whatever it is interested in.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to