From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Sat, 25 Aug 2007 22:42:40 +0000 Subject: Re: udev remove problems Message-Id: <3ae72650708251542l77bcf5b4m6cc68150d6c55730@mail.gmail.com> List-Id: References: <1531272489@web.de> In-Reply-To: <1531272489@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On 8/26/07, Juergen Bausa 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 ------------------------------------------------------------------------- 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