Results 1 to 3 of 3

Thread: How do I trigger a udev rule?

  1. #1
    Join Date
    May 2018
    Beans
    2

    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.

  2. #2
    Join Date
    May 2014
    Location
    /home
    Beans
    10,929
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How do I trigger a udev rule?

    It could be a typ0 RUN + = "/home/iuk323/authorun.sh" did you want RUN + = "/home/iuk323/autorun.sh"



    Code:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="217f", RUN + = "/home/iuk323/autorun.sh"
    Replace the 0a5c and 217f with the data from lsusb results for the scanner

  3. #3
    Join Date
    May 2018
    Beans
    2

    Re: How do I trigger a udev rule?

    What ? Where is the difference ? I don't get it

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •