From mboxrd@z Thu Jan 1 00:00:00 1970 From: Farkas Levente Date: Sat, 09 Jun 2007 13:03:50 +0000 Subject: Re: udev remove ATTR(S) not working Message-Id: <466AA536.7070308@bppiac.hu> List-Id: References: <46673B9D.3000205@bppiac.hu> In-Reply-To: <46673B9D.3000205@bppiac.hu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Andrey Borzenkov wrote: >> On 6/7/07, Farkas Levente wrote: >>> hi, >>> how can i write a RUN udev rules for remove event? i want to recognize >>> my usd pendrive's add and remove. the add is simple since i can use >>> rather specific rules like: >>> --------------------------------------- >>> ACTION="add", SUBSYSTEM="block", ATTR{size}="2880", >>> ATTRS{serial}="07530736300A", ATTRS{product}="USB DISK Pro", >>> RUN+="/xxx" --------------------------------------- >>> but the remove rule is much complicated, since (at least it seems for >>> me) udev don't send ATTR(S) in this case and don't know about anymore >>> the removed device parameters. > > If you absolutely need them on remove (could you explain why? What exactly are > you trying to do?), set environment vars on add and use (match) them on > remove. how can i do so? eg i create a new link SYMLINK+="lfarkas" in the add action and in this case in remove actions env contains DEVLINKS='/dev/lfarkas /dev/...' BUT a rule like this: ACTION="remove", SUBSYSTEM="block", ENV{DEVLINKS}="/dev/lfarkas*" never match, while a rule like this ACTION="remove", SUBSYSTEM="block", DEVLINKS="/dev/lfarkas*", match for all block device. so how can i match for DEVLINKS? or what other methods exists for properly identify a removed device? thanks in advance. -- Levente "Si vis pacem para bellum!" ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ 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