Results 1 to 3 of 3
I'm trying to run a script when a sd card is inserted into the drive.
my udev rules are as follows:
BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="058F63356336", NAME="sdcard", RUN+="/bin/mount /dev/sdcard"
BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="058F63356336", ...
- 08-30-2010 #1
run script from udev
I'm trying to run a script when a sd card is inserted into the drive.
my udev rules are as follows:
BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="058F63356336", NAME="sdcard", RUN+="/bin/mount /dev/sdcard"
BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="058F63356336", OPTIONS+="last_rule", RUN+="/home/user/test"
The first line works, naming the device as "sdcard" and mounting it in the correct location. The second line should run a simple script to write a file with some text in it. If I run the script it works so I'm assuming it's not being done by udev but I done know why.
Just for info, my intention is to run an encryption program when the sdcard is inserted.
- 08-30-2010 #2
Probably your script is not using full paths to commands, udev is not running in your user environment.
- 10-01-2010 #3
well I solved it in the end, turns out that I needed to include this line in my script
export Display=:0.0
before running a program with a GUI eg kwrite in the above exampleLast edited by spg666; 10-01-2010 at 01:13 PM.


Reply With Quote
