From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Sun, 16 Apr 2006 06:14:02 +0000 Subject: Re: Strange Rule Behaviour Message-Id: <200604161014.12694.arvidjaar@mail.ru> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 16 April 2006 01:04, Robert Kennedy wrote: > I have a simple rule that runs a script that creates extra cd related > symlinks. > > The rule is as follows: > > ACTION="add", BUS="scsi", KERNEL="sr[0-9]*", SYSFS{type}="5", > RUN+="/lib/udev/cdsymlinks.sh" > > This rule works great. When a new CDRW drive is plugged in, the script is > called and creates additional symlinks. > it is better to change this script to return list of symlinks and use ACTION="add", BUS="scsi", KERNEL="sr[0-9]*", SYSFS{type}="5", PROGRAM="/lib/udev/cdsymlinks.sh", SYMLINK="%c" In this case symlinks will be deleted by udev in "remove". It also allows querying for them using udevinfo. > I also have a rule to run the same script which will remove these cd > symlinks when the CDRW driver is removed (e.g. removable CDRW drive). I > first tried this rule: > > ACTION="remove", BUS="scsi", KERNEL="sr[0-9]*", SYSFS{type}="5", > RUN+="/lib/udev/cdsymlinks.sh" > > It did not work. I could only get the rule to be matched and run when I > changed the rule to: > > ACTION="add", BUS="block", KERNEL="sr[0-9]*", > RUN+="/lib/udev/cdsymlinks.sh" > > I am curious why I had to change the remove rule. Does anyone have any > ideas? > sysfs entry for device is not available on "remove". - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEQeC0R6LMutpd94wRAmXYAKDHS51SJqmn8EEej2ilw/ctIeIK+gCeI5eV mil6gsxFFZhsEWh9nhI3POk=ePVn -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ 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