From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Iragne Date: Fri, 26 Mar 2004 21:13:23 +0000 Subject: Re: add/remove actions for usb devices Message-Id: <40649CF3.6000400@labri.fr> List-Id: References: <40648838.2040703@labri.fr> In-Reply-To: <40648838.2040703@labri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Greg KH wrote: >On Fri, Mar 26, 2004 at 08:44:56PM +0100, Florian Iragne wrote: > > >>Hello everybody, >> >>i've just a simple question and i didn't find any clues about the answer >>on the internet, so i ask you : why is there no "remove" action for usb >>devices with hotplug? >> >> > >The remove event happens just fine. It's just that the current scripts >don't do anything with it :) > > > >>my current problem is that i looking for a solution to mount/umount >>usb-storage devices automagically when they are plugged/unplugged, but >>since there is no remove event, i must write a complex script to do it >>(currently working on 2.6.4-ck1 and udev). >> >> > >But there is an event. You can catch it on your own if you want. Just >put your script in /etc/hotplug.d/usb/ > > > well actually, i've already try this and never catch the remove event. just to test i've made this single script : if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then echo "add" >> /var/log/hotplug fi if [ "$ACTION" = "remove" -a "$TYPE" = "usb" ]; then echo "remove">>/var/log/hotplug fi i do catch the add, but no trace of remove action in the log >Or if you want to catch the fact when udev removes a /dev node (which >odds are is what you really want to catch), put your script, or a link >to it in /etc/dev.d/block/ with the extension .dev and you will get both >add and remove events that corrisponded to a udev create or remove >device node. > > yes, i think it's a better way, since currently i have to add a "sleep 10" instruction to wait for udev to create th node i want to move >Hope this helps, > >greg k-h > > thanks a lot, i will try this! Florian ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ 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