From: jjluza Date: Sun, 28 Mar 2004 14:35:27 +0000 Subject: Re: add/remove actions for usb devices Message-Id: <200403281635.27382.jjluza@yahoo.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 I try to do that too. I have a script called usbst.dev in /etc/dev.d/block it contains : #!/bin/bash case $ACTION in add) ls -l /dev/usbst1 >> /tmp/udeveventlog mount -t vfat -o sync /dev/usbst1 /mnt/usbst echo "mount done" >> /tmp/udeveventlog ls -l /dev/usbst1 >> /tmp/udeveventlog esac if I try to add a case "remove)", it fails on syntax error it seems udev handles add and remove in the same case (ie "add)"), maybe it is what it should do, but it's not easy to manage. More, when I plug my usb stick, /tmp/udeveventlog contains : brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 mount done mount done brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 This behaviour seems strange for me, isn't it ? Anyway, my usb stick is well mounted, but I get some messages in console which say (2 times) that my stick is already mounted (it seems that the script is run several times), so it's not very clean. And I have to remove it manually for the moment. I think an example could be a good thing too ------------------------------------------------------- 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