I have National Instruments USB<->GPIB bridge. It is an USB board that need special procedure to became usable. I have linux_gpib package installed that provide two kernel modules: gpib_common and ni_usb_gpib. Besides, the gpib_config tool mast be executed before I can talk to any instrument on the GPIB bus. The trick is that board needs about 2 seconds after it was plugged into USB for internal initialization before gpib_config command will take effect. So, I have the following 99-gpib.rules udev rule that does the job perfect:
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="3923", ATTR{idProduct}=="709b", RUN+="/bin/sh -c '/usr/bin/sleep 2; /usr/sbin/gpib_config --minor 0'"
KERNEL=="gpib[0-9]*", MODE="0660", GROUP="gpib"
The problem is it only work if I plug the board when host system is up and running. When I reboot with the dongle plugged in I can see both kernel modules loaded, but the board is unusable, meaning that gpib_config tool wasn't executed. If I run it by hand it work perfectly.
Since reboot scenario is more real, then plugging it while the system is running, I need the correct way to make udev do this on boot. Sure, I can write some init script that will check if the board is plugged and kernel modules are loaded and run the tool during loading process, but this is udev job cause it something to deal with hardware, I think. Any ideas?
gpib_configneedsrootprivileges./usr/local/bin. Provide executable permission and update the path in your udev rulegpib_configis executed, no modules and no actual devices are available.