From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: Strange Rule Behaviour
Date: Sun, 16 Apr 2006 06:14:02 +0000 [thread overview]
Message-ID: <200604161014.12694.arvidjaar@mail.ru> (raw)
In-Reply-To: <BAY113-F360970A35506E11713EF00AAC10@phx.gbl>
-----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&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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
next prev parent reply other threads:[~2006-04-16 6:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-15 21:04 Strange Rule Behaviour Robert Kennedy
2006-04-16 6:14 ` Andrey Borzenkov [this message]
2006-04-16 14:53 ` Robert Kennedy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200604161014.12694.arvidjaar@mail.ru \
--to=arvidjaar@mail.ru \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).