This question came from our site for professional and enthusiast programmers.

1

Didn't you mean to post on Unix & Linux? What's your kernel version? Did you run udevadm trigger or plug a device in to apply the new rule?
– GillesFeb 22 '13 at 15:41

Yes, I do that after every edit of the rules to try them out. I edited the question accordingly. This is the way udev works for a while now, but I am running 3.5.0-23-generic.
– RedsandroFeb 22 '13 at 16:12

Note : I use auto-mount with kde so I check for the folder to appears. You can pass the /dev/sd* parameter in the fifo from the udev rule and mount it yourself in the script. To write in the fifo don't forget that udev is not a shell and that redirection doesn't works. Your RUN should be like :

Looks like a nice script, +1. One thing I'd suggest is using list instead of just one string in call(). That way if it's necessary to provide arguments to the foobar.sh script, you can do that dynamically.
– Sergiy KolodyazhnyyDec 23 '18 at 9:41

1

Fair point. My "real" script (linked from the answer) uses a list. In this minimalist version I pasted here, I messed up and accidentally used a string. Thanks! I've updated the answer.
– Denilson Sá MaiaDec 24 '18 at 11:30

Does not answer the question: This only covers boot-time (and using udev for other times are not a "few little modifications") and the Raspberry Pi. There is an unnecessary sudo - rc.local runs as root, it is a privilege escalation issue - a file that is editable by a normal user is run as root.
– Gert van den BergAug 24 '18 at 13:51