1

I have tried this: How to execute a shellscript when I plug-in a USB-device and have the following output for "lsusb":

Bus 002 Device 007: ID 046d:0825 Logitech, Inc. Webcam C270

and in /etc/udev/rules.d/camset.rules

ATTRS{idvendor}=="046d", ATTRS{idproduct}=="0825", RUN+="camset.sh"

and camset.sh is located at the root directory. When I run "sh camset.sh" it runs fine so I don't think there is any problem with that. Thanks for the help

Sam
  • 11

1 Answers1

1

From the udev documentation:

RUN
(…) If no absolute path is given, the program is expected to live in /usr/lib/udev, otherwise the absolute path must be specified.

Udev doesn't use the PATH environment variable. You need to specify a full path. According to the usual directory structure conventions, this should be /usr/local/sbin/camset.sh — /usr/local for locally-written files, sbin for a directory containing executables that only make sense for root. Don't put files in the root directory.