not really in the sense that qemu-nbd launches and immediately gives the hand back to the script that called it.
the script ends positively and qemu-nbd is killed by systemd because it is considered to be garbage left behind by the script.
the script ends positively and qemu-nbd is killed by systemd because it is considered to be garbage left behind by the script.
this is not quite the case of a timeout that systemd terminates, but the result is the same.
in this case, qemu-nbd looks more like a daemon.
I was wondering if there was a way to propagate the killmode through a udev rule that starts a script (like a service)... but it seems from the documentation that the answer is no :-(
"""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."""I would appreciate (and maybe I won't be the only one) a concrete example based, for example, on my problem ;-)
let's just say that my rule is :
KERNEL=="sdb", RUN+="/usr/local/sbin/myscript"
and my script is :
#!/usr/bin/bash
qemu-nbd -r -s -f raw -c /dev/nbd0 /dev/sdb
qemu-nbd -r -s -f raw -c /dev/nbd0 /dev/sdb
regards, lacsaP.
Le ven. 20 mai 2022 à 17:43, Mike Gilbert <floppym@xxxxxxxxxx> a écrit :
On Fri, May 20, 2022 at 10:51 AM Pascal <patatetom@xxxxxxxxx> wrote:
> 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... ;-)
Sorry, I missed this last line. Are you sure it isn't long-running? It
really makes no sense for it to fork this way.