How do I trigger a udev rule?

和自甴很熟 提交于 2019-12-24 08:51:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!