From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Wed, 24 Aug 2005 19:06:01 +0000 Subject: Re: [Thinstation-developer] Re: udev PROGRAM action Message-Id: <20050824190601.GA9483@vrfy.org> 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 On Wed, Aug 24, 2005 at 09:47:47AM -0400, Bill Nottingham wrote: > Miles Roper (mroper@xtra.co.nz) said: > > 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? > > sd* device names are on the SCSI bus, not the USB bus. That should match, cause udev will walk up the chain of devices in sysfs. Matching on SYSFS, DRIVER and BUS on any of the devices following the "device" link should work. (But all matches must be true on the same device directory, you can't match BUS and SYSFS from different devices at the same time. See "udevinfo -a -p /block/sda".) It's RUN+="...", not RUN=+"...". :) And you can't match on BUS with "remove" cause there is no bus anymore, while the device is removed. Only in the environment of the event you will find PHYSDEVBUS, cause the kernel knows that, but the sysfs directory is already gone. ENV{PHYSDEVBUS}="..." should work if really needed. Kay ------------------------------------------------------- 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