Andre
Andre

Reputation: 1267

How do I trigger a udev rule?

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.

Upvotes: 1

Views: 2441

Answers (0)

Related Questions