[systemd-devel] udev - device nodes removed even if created/copied from /lib/udev/devices/

Dr. Todor Dimitrov dimitrov at technology.de
Mon Apr 8 13:59:52 UTC 2019


Hello,

we are observing a weird problem with udev, where the nodes /dev/ttyUSB* are removed as soon as the corresponding devices are unplugged, although they have been statically created using /lib/udev/devices/. According to the documentation/change logs, this should not happen:

---
udev 152
========
Bugfixes.

...

The option "ignore_remove" was removed from udev. With devtmpfs
udev passed control over device nodes to the kernel. This option
should not be needed, or can not work as advertised. Neither
udev nor the kernel will remove device nodes which are copied from
the /lib/udev/devices/ directory.
---

Upon start, the device nodes are properly created/copied from /lib/udev/devices/. When a USB device is plugged, it is correctly wired to the ttyUSB0. Unfortunately, when the device is unplugged, the /dev/ttyUSB0 is removed. Note that this only happens if udevd is running. If the udev daemon is not running, the device node remains after unplugging and can be later reused.

In an older revision (2202), we found the following change in etc/udev/rules.d/50-udev-default.rules:

---
# do not delete static device nodes
ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove"
---

But since "ignore_remove" has been removed in udev 152, it seems that this functionality has not been reimplemented.

Any help or suggestions are highly appreciated. We need the device nodes to be static since we are bind mounting them inside a container.

Thanks in advance,
Todor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3868 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190408/1f459466/attachment.bin>


More information about the systemd-devel mailing list