From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miles Roper Date: Wed, 24 Aug 2005 11:05:24 +0000 Subject: Re: [Thinstation-developer] Re: udev PROGRAM action Message-Id: <430C5474.6020007@xtra.co.nz> List-Id: References: <430C3C87.4080209@xtra.co.nz> In-Reply-To: <430C3C87.4080209@xtra.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi Kay, Thanks very much for your help so far. Its starting to make sense :o) I still can't get the below rule to work :o( KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh" KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh" neither script gets run (as they create a test file in /tmp if they run) I can post info from syslog when the device is added if you want? Thanks Miles Kay Sievers wrote: > On Wed, Aug 24, 2005 at 10:17:57PM +1200, Miles Roper wrote: > >>this still doesn't work. >> >>is this the way I should be hotplugging? I've spent hours looking on the >>net and hotplug.d seems depreciated with udev0.68. > > > A while ago we moved hotplug.d/ handling into udev to be able to plug > HAL into the hotplug process and get rid of the hotplug/sysfs races. > Now we removed that from udev itself again, cause with udev-rules you > can do the same as hotplug.d/ did without all the problems of matching > only on the subsystem. > You can still use the old hotplug multiplexer or put a small helper > from the extras/run_directory/ into a udev rule that runs the hotplug.d/ > programs. > > >>>From what I see of udev >>it seems to do everything I need. Not being able to specify the name when >>using RUN by design, or will that get added later? > > > I'm not sure what you mean. If you specify a NAME rule, RUN will also > be called, but if you use NAME, no other action than "add" can ever > trigger that rule. So if you want to call a script for a specific device > for _all_ actions and rename the device at the same time, just use two rules, > one for the name and one for the "generic" RUN. > I think the best way to do this is to add two rules, one for "add" and > one for "remove". > > Kay > > >>Kay Sievers wrote: >> >>>On Wed, Aug 24, 2005 at 09:23:19PM +1200, Miles Roper wrote: >>> >>> >>>>KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh >>>>%k" >>>>KERNEL="sd*", ACTION="remove", NAME="%k", >>>>RUN=+"/etc/udev/scripts/usb.sh %k" >>>> >>>>what i'm trying to achieve is hotpluging my usbkey. removing the NAME >>>>key above still doesn't seem to work, infact it stops it from even >>>>calling the script. the line now is >>>> >>>>KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k" >>>> >>>>if I remove the NAME key, how can I specify the device name I want in >>>>/dev? >>> >>> >>>It will just get the default name. >>> >>> >>> >>>>Can I use the %k in above, as I need to pass this to the script so I know >>>>which device to mount/umount? >>> >>> >>>Yes, also the environment contains DEVNAME. > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Thinstation-developer mailing list > Thinstation-developer@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/thinstation-developer > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ 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