Am 05.01.2017 um 10:29 schrieb tomas@tuxteam.de:
> and delegates to specialized subsystems. In a pinch you can just sneak
> a complete shell script in an udev rule (and I'm guilty of having done
> such a thing [2]), but doing this as "system architecture" might lead to
> madness :-)
> [2] Once, for a customer: inserting the right storage medium (with
> the right UUID) triggered a system backup.
Please don't do that. udev is a not a service manager and starting (long
running) tasks from a udev rule is bad.
See also the udev man page:
Starting daemons or other long-running processes is not appropriate
for udev; the forked processes, detached or not, will be
unconditionally killed after the event handling has finished.
If you want to trigger the start of a service via udev, tag the device
with "systemd" and use SYSTEMD_WANTS [1] via a custom udev rule, like
<your matches>,TAG+="systemd",ENV{SYSTEMD_WANTS}="foo.service"
Regards,
Michael
[1]
https://www.freedesktop.org/software/systemd/man/systemd.device.html#SYSTEMD_WANTS=
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Attachment:
signature.asc
Description: OpenPGP digital signature