lkml.org 
[lkml]   [2006]   [Jun]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 05 Jun 2006 10:34:20 +0200
FromOndrej Zary <>
Subjectudev not called on USB disconnect
Hello,
I'm trying to do automount/umount for my Canon camera using udev. The 
camera does not support mass storage so I'm using gphotofs+fuse to 
access it.
I created canon.rules file in /etc/udev/rules.d which contains:

BUS=="usb", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="306e", 
ACTION=="add", RUN+="/usr/bin/gphotofs /mnt/camera -o allow_other"
BUS=="usb", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="306e", 
ACTION=="remove", RUN+="/sbin/umount -f /mnt/camera"
(the file contains only two lines).
When I plug in the camera, the first rule is executed and camera mounted 
properly. However, disconnecting it does not do anything, the second 
rule is never executed. I also tried rule as simple as:

BUS=="usb", RUN+="/bin/touch /123"

If I understand udev correctly, that should create /123 file on each USB 
event. It works when connecting the camera but does not do anything on 
disconnect.

USB connect/disconnect is properly detected by kernel (2.6.16):
usb 1-2: new full speed USB device using uhci_hcd and address 22
usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: USB disconnect, address 22

Is this a bug or a feature?

-- 
Ondrej Zary
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-05 10:37    [from the cache]
©2003-2008