user1343318
user1343318

Reputation: 2141

udev rules once a device is added in linux does not work

Here is a simple rule I created in /etc/udev/rules.d/70-persistent-cd.rules:

ACTION=="remove", ENV{DEVTYPE}=="usb_device",    
ATTRS{serial}=="NA453QQS", SUBSYS\
TEM=="usb", RUN+="~/1/linux/MyCode/Code/run.sh"

The run.sh is pretty simple and uses insmod and rmmod to insert and remove a module from kernel.

Now my external drive is added and remove but the run.sh fails to run. What is the problem here?

I have looked at documentation as well as this question here. I am using a Debian machine.

Upvotes: 0

Views: 408

Answers (1)

P. Morel
P. Morel

Reputation: 86

You should not use the tilde since your HOME directory is not set. Use an absolute PATH for the run.sh program

Upvotes: 1

Related Questions