I tried to use this rule: > attach 0 { > match "vendor" "0x04b4"; > match "product" "0x6022"; > action "/bin/echo hello $device-name >> /tmp/dev.txt"; > }; but it doesn't work (no /tmp/dev.txt appears). But this rule works: > notify 100 { > match "system" "USB"; > match "subsystem" "DEVICE"; > match "type" "ATTACH"; > match "vendor" "0x04b4"; > match "product" "0x6022"; > action "/bin/echo hello $device-name >> /tmp/dev.txt"; > }; Some other system-supplied rules in /etc/devd.conf use the first form too, which means that they also wouldn't work when the matching device would appear? > ugen8.5: <vendor 0x04b4 product 0x6022> at usbus8 FreeBSD xx.xx.xx 12.0-STABLE FreeBSD 12.0-STABLE r347548 GENERIC amd64
Additionally, $device-name expands to the empty string for in the above command.