[systemd-devel] killmode

Mike Gilbert floppym at gentoo.org
Fri May 20 15:39:09 UTC 2022


On Fri, May 20, 2022 at 10:51 AM Pascal <patatetom at gmail.com> wrote:
>
> hi,
>
> is it possible to influence the killmode of a script launched by an udev rule ?
>
> I have a udev rule that starts a script that itself starts qemu-nbd that gets killed once the script is finished (qemu-nbd links a block device to an nbd node).
>
> it is not strictly speaking a long-running process but it is a child who survives his father and who is killed when his father stops living successfully ! what a strange world these children live in... ;-)

Quoting the udev(7) man page:

https://www.freedesktop.org/software/systemd/man/udev.html#RUN%7Btype%7D

"Starting daemons or other long-running processes is not allowed; the
forked processes, detached or not, will be unconditionally killed
after the event handling has finished. In order to activate
long-running processes from udev rules, provide a service unit and
pull it in from a udev device using the SYSTEMD_WANTS device property.
See systemd.device(5) for details."


More information about the systemd-devel mailing list