public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Ondrej Zary <linux@rainbow-software.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: udev not called on USB disconnect
Date: Mon, 5 Jun 2006 09:18:07 -0700	[thread overview]
Message-ID: <20060605161807.GB26259@kroah.com> (raw)
In-Reply-To: <4483EC8C.6070507@rainbow-software.org>

On Mon, Jun 05, 2006 at 10:34:20AM +0200, Ondrej Zary wrote:
> 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"

You can't read sysfs values when a device is removed, because those
sysfs files are not present anymore.  Try testing the environment
variables instead.

> (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.

Are you sure that no other rule ahead of this one stopped this rule from
ever being read?

Also, udev questions belong on the linux-hotplug-devel mailing list...

thanks,

greg k-h

      reply	other threads:[~2006-06-05 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05  8:34 udev not called on USB disconnect Ondrej Zary
2006-06-05 16:18 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060605161807.GB26259@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox