Getting UDEV working
Hey guys, first post here so go gentle
I've created a udev rule file in my udev/rules.d with the following contents, Code:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="18a5", ATTRS{idProduct}=="0302", RUN+="/etc/demo/insert.sh" Code:
sudo udevadm control --reload-rules Code:
Bus 001 Device 008: ID 18a5:0302 Verbatim, Ltd 32GB Flash Drive I've scoured the net but cant find anything anywhere, any thoughts/suggestions? Thanks Mike |
Check your log if the two events happened at the instant.
Or maybe your system have had no time enough to comple insert.sh before remove.sh takes over. Try: comment the remove.sh line, reload udev, insert, and check by fdisk -l see if the drive is honored. If it is there then you are doing well. Don't forget to Quote:
m.m. |
Quote:
Soooo current status is the insert detection is working....just need to sort the removal one now :) Cheers for your help :) Mike |
Soooo we have progress....kind of, I have a script that I have now set to +x and it will run manually and do everything I want it to do when I fire the script from a command line however when I add it to the udev rules it doesnt seem to do anything at all now (I did get it to create a folder) what would cause it to be able to run fine from a command line but not from the udev rule?.
cheers Mike |
Try check your dev rules.
Attributes? Events? Congratulation. |
getting closer
I have got this working on the box in question and have tried adding my scripts to this rule, on it's own it works perfectly and mounts the USB stick in the media folder in a folder it creates with the same name as the usb stick label, yet when I add my scripts to this they still dont "fire"
Code:
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end" Cheers Mike |
All times are GMT -5. The time now is 10:11 PM. |