ACTION=="add", SUBSYSTEM=="usb", ATTRS{modalias}=="usb:v0...50", RUN+="/home/user/svn/bin/hotplugscript"
had to put in a sleep 6 before doing anything in the newly mounted fs because it seems to take about 5 s to settle down. (probably should loop-and-test in production-level code.) oh, and one other handy thing i googled up: use blockdev --flushbufs /dev/sdc1, for example, to flush one block device. sync just flushes them all. i have the whole bash script in brackets with a trailing & to make it fork off and return immediately; that's important because otherwise i found it hangs or dies at the sleep and nothing after that gets executed. and i did find that a umount after business is done in the udev script causes no problems.
No comments:
Post a Comment