From: Juergen Bausa <Juergen.Bausa@web.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev remove problems
Date: Sun, 26 Aug 2007 21:46:22 +0000 [thread overview]
Message-ID: <1535020076@web.de> (raw)
In-Reply-To: <1531272489@web.de>
> -----Ursprüngliche Nachricht-----
> Von: "Kay Sievers" <kay.sievers@vrfy.org>
> Gesendet: 26.08.07 00:42:51
> An: "Juergen Bausa" <Juergen.Bausa@web.de>
> CC: linux-hotplug-devel@lists.sourceforge.net
> Betreff: Re: udev remove problems
>
> On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> wrote:
> > udev remove problems
> >
> > I am using udev 0.105-4 on debian etch. I am trying to setup rules for pvr (hard disk recorder)
> > that is connected to my system via usb. Add and remove events should start scripts. The add
> > event works fine:
> >
> > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> > GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev"
> >
> > In my first try, I used the following for remove:
> >
> > ACTION="remove", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", \
> > RUN+="/usr/local/bin/tf5000pvr_udev"
> >
> > This did not work (in the case of remove nothing happens). I think its because sysfs
> > values are already gone in case of an remove event. I found a hint on this on the web
> > and tried the following:
> >
> > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> > GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev", ENV{toppy}="%p"
> >
> > ACTION="remove", ENV{toppy}="%p" , RUN+="/usr/local/bin/tf5000pvr_udev"
>
> > So, the variable is saved and found on the remove event, but the script isnt called. What is wrong here?
>
> The string you compare against may not run through the format char
> replacement, not sure. Just do ENV{toppy}="?*", or use the
> ENV{REMOVE_CMD}="/usr/local ..." which Debian supports. So you don't
> need a separate remove rule at all.
>
> Kay
>
Thanks. I used REMOVE_CMD and the script is called. But now I have the problem, that the
remove event appears, when the device is accessed.
When I plug in, add is called many times (ca. 5). That is no problem, because my script works
only on the first call. The script creates a desktop icon and starts a daemon, that allows me to
access my device through a local ftp server. This works without any problem.
But when I try to login to the ftp server, which triggers actual transfer to the usb device, the
remove event is run and my remove script is called.
I have no idea why. Any Hints?
Juergen
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc\x022220
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2007-08-26 21:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-25 22:22 udev remove problems Juergen Bausa
2007-08-25 22:42 ` Kay Sievers
2007-08-26 21:46 ` Juergen Bausa [this message]
2007-08-26 22:10 ` Kay Sievers
2007-08-28 19:48 ` Juergen Bausa
2007-08-29 4:26 ` Kay Sievers
2007-08-29 19:32 ` Juergen Bausa
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=1535020076@web.de \
--to=juergen.bausa@web.de \
--cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).