problem with UDEV rules
Hi ,
i wrote a new rule for detecting a USB drive(thump drive) connected and automatically create a file in USB drive connected. The rule which i wrote is given below. KERNEL="sd[a-z][0-9]",SYMLINK="My_USB",RUN+="/usr/bin/script.sh" when i connected the USB drive, the symbolic name got created . but the script is not getting executed. The script i wrote is as follows. #!/bin/sh echo "Hii" mount /dev/My_USB usb cd usb touch ff.txt cd .. umount /dev/My_USB Why 'RUN+' command is not working...? is there any problem in my script file? If i am running this script seperately it's working fine. I am using RED HAT enterprise edition 4 and kernal version 2.6.20.14 Please help... |
Are there SerialATA or SCSI hard drives in your box?
It could be the reason, because My_USB became a link to the HDD already. |
i have SCSI hard disk in my system .. I am able to create the symbolic name My_USB and if i am running the script seperately, i am able to perform the operation using the same symbolic link. That means link is created properly right? Only when i am trying to invoke the script through RUN+=RUN+="/usr/bin/script.sh", the required action is not taking place.
|
How do you know your script isn't being executed? You are not recording any information in a meaningful way (stdout is redirected to /dev/null). Try touching a file in '/tmp' or something to give you an indication of what's happening.
|
Problem with UDEV rules
Quote:
|
As Vit77 already wrote, udev doesn't like double links. I'd suggest to try the script from the udev rule without the "mount" and "umount" commands.
|
All times are GMT -5. The time now is 07:55 AM. |