[opensuse-packaging] packaging udev rules
Hi, What are the guidelines for packaging udev rules? 1) So far I've found that files should be placed in %{_udevrulesdir}. 2) Should the package call "udevadm control --reload" in %post and %postun? I've found that there's a macro for this %udev_rules_update [1]. But I couldn't find any package doing that. [1] https://build.opensuse.org/package/view_file/openSUSE:Factory/systemd/macros... -- Adam Mizerski
25.06.2016 14:17, Adam Mizerski пишет:
Hi,
What are the guidelines for packaging udev rules?
1) So far I've found that files should be placed in %{_udevrulesdir}.
Yes.
2) Should the package call "udevadm control --reload" in %post and %postun? I've found that there's a macro for this %udev_rules_update [1]. But I couldn't find any package doing that.
udevd checks rules directories timestamp every 3 seconds and reloads rules if it changed. Updating file via RPM is guaranteed to update directory timestamp because RPM creates temporary file first. So the question is whether you care about 3 seconds window enough to reload rules manually.
[1] https://build.opensuse.org/package/view_file/openSUSE:Factory/systemd/macros...
W dniu 25.06.2016 o 20:50, Andrei Borzenkov pisze:
25.06.2016 14:17, Adam Mizerski пишет:
2) Should the package call "udevadm control --reload" in %post and %postun? I've found that there's a macro for this %udev_rules_update [1]. But I couldn't find any package doing that.
udevd checks rules directories timestamp every 3 seconds and reloads rules if it changed. Updating file via RPM is guaranteed to update directory timestamp because RPM creates temporary file first. So the question is whether you care about 3 seconds window enough to reload rules manually.
Thanks. That explains a lot. -- Adam Mizerski
participants (2)
-
Adam Mizerski
-
Andrei Borzenkov