I become mad, I don't understand why my script don't want to be launch by udev. I have the latest raspian (wheezy) My rule (in /etc/udev/rules.d/) :
root@raspberrypi:/etc/udev/rules.d# cat 10-box.rules
ACTION=="add", KERNEL=="sd*1", SUBSYSTEM=="block", RUN+="/usr/bin/test.sh"
Now my script :
root@raspberrypi:/usr/bin# ls -al test.sh
-rwxr-xr-x 1 root root 27 Aug 22 11:06 test.sh
root@raspberrypi:/usr/bin# cat test.sh
#!/bin/sh
echo "YOU HAVE ADD A USB KEY"
The device (usb key) :
root@raspberrypi:/usr/bin# udevadm info -an /dev/sda1
..
looking at device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.4/1-1.4:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1':
KERNEL=="sda1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ro}=="0"
ATTR{size}=="1031352"
ATTR{stat}==" 159 0 1280 180 0 0 0 0 0 180 180"
ATTR{partition}=="1"
ATTR{start}=="32"
ATTR{discard_alignment}=="0"
ATTR{alignment_offset}=="0"
ATTR{inflight}==" 0 0"
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.4/1-1.4:1.0/host1/target1:0:0/1:0:0:0/block/sda':
KERNELS=="sda"
SUBSYSTEMS=="block"
....
Why nothing append to stdout when I insert my key ???
Regards