问题
I have a barcode scanner, and I would like to run a script when I connect it. With the command
udevadm info -ap /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/tty/ttyACM0
I get information about the device. Here is an excerpt:
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5':
KERNELS == "2-1.5"
SUBSYSTEMS == "usb"
DRIVERS == "usb"
ATTRS {authorized} == "1"
...
Now I've created a new file under / etc / udev / rules /:
rzha097: /etc/udev/rules.d # cat 90-barcode.rules
KERNELS == "2-1.5", SUBSYSTEMS == "usb", ACTION == "add", RUN + = "/home/iuk323/authorun.sh"
Unfortunately, the autorun.sh script is not running. Could someone give me a hint why this did not happen?
The autorun script has sufficient permissions.
来源:https://stackoverflow.com/questions/50346290/how-do-i-trigger-a-udev-rule