I'm having trouble with udev rules not running. Here's an example:
I have a rule /etc/udev/rules.d/99-test.rules which contains:
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", RUN+="/sayhi"
And sayhi just has:
#!/bin/bash
date +"%Y-%m-%d %H:%M:%S,%3N" >> /saidhi
This being an Intel machine, I obviously have many vendor 0x8086 PCI devices:
root@imtrobot:~# lspci -n |grep 8086
00:00.0 0600: 8086:2770 (rev 02)
00:02.0 0300: 8086:2772 (rev 02)
00:1d.0 0c03: 8086:27c8 (rev 01)
[ etc. 12 lines total ]
And yet, when I boot, /saidhi will either not be created at all, or will have 1 or 2 date lines in it.
If, after booting, I run udevadm trigger --action=add --subsystem-match=pci then /saidhi will get exactly the right number of dates added to it.
Why doesn't this work during the boot process?