Closed ardrabczyk closed 1 year ago
It looks like a feature - pipes from child to parent are created in udev_event_spawn()
only if udev_log is >= LOG_INFO.
The documentation clearly says that spawned programs should be short lived.
One way to solve the problem is to daemonize the worker that may get delayed (become session leader, detach from parent, close all descriptors). Thus eudev will just trigger the worker execution and continue without waiting for it.
There are also standard ways to implement timeout for the already detached worker - e.g. timeout 5m worker params...
I am closing the issue, in case you can propose a sane fix, please reopen with comments.
Steps to reproduce:
/etc/udev/rules.d/50-test.rules:
/home/ja/udev/udev-script.sh:
/home/ja/udev/sleep.sh:
/etc/udev/udev.conf:
Start udevd in daemon mode:
What happens:
Insert an USB stick, /tmp/UDEV gets created but udev-script.sh is quickly reaped:
even though sleep.sh is still running:
What should happen:
When udev_log is set to debug, info or is not set udev-script.sh becomes zombie process:
and after some time you can see this in /var/log/syslog:
In this case udev waits not only for death of its own children but also children of children and so on before reaping udev-script.sh by passing a file descriptor that will be inherited by all descendant processes. Why doesn't it work like that with udev_log="err"?