Exectuing a script from the rules file
Hi,
I'm new to writing rules and have a question on
calling a shell script from the rules file. Whenever a USB device is attached or removed I need to write the ACTION, Vendor Id and Product Id in a text file.
1) I don't know how to pass these information to the shell script from the rules file.
So I started with just calling a script that prints a string in a temporary file. The following is the script
#!/bin/sh
echo "The Vendor id is" >> /tmp/debug_out
2) When I try to run the script with "RUN" keyword it never gets executed when I plug in a USB device. But the kernel has detected the USB device and prints out appropriate messages.
I created a 10-udev.rules file in the /etc/udev/rules.d directory. The following is the rule
SUBSYSTEM="usb", ACTION="add", RUN="/root/2.sh"
Can some one please let me know where am I going wrong.
Warm Regards,
Shankar
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel