From what I understand I can create a udev rule to run a script e.g. when a USB device is plugged in:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="0815", SYMLINK+="mydevice", ACTION=="add", RUN+="/path/to/my/script.sh"
My question is now, which rights does this script have?
I found two questions that relate to the subject:
- Does udev need sudo in run: the problem was elsewhere and the question in the title was never answered
- Notification not showing up by script run by udev rules: an answer says to “use
sudoto runnotify-sendas same user (Not asroot)”, which to me implies that a) the script has the right tosudoand b) would run asrootif you don’t specify the user
I could not find any documentation that went beyond stating that the RUN parameter exists for udev rules concerning its rights and abilities.