* Udev - Trapping "Add" - Subsystem "module"
@ 2006-11-09 18:44 Kilau, Scott
2006-11-09 19:09 ` Kris van Rens
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-09 18:44 UTC (permalink / raw)
To: linux-hotplug
Hi everyone,
I have a quick question that I am hoping has a quick answer. =)
I want to hook my driver when its added to the module subsystem.
After spending quite a bit of time trying to figure out why I
couldn't get the right hook, I finally found that it can't
be trapped, currently on purpose.
My rule (currently I put in "10-dgap.rules"):
ACTION="add", KERNEL="dgap", SUBSYSTEM="module", \
RUN+="/usr/sbin/dgapdl", OPTIONS+="last_rule"
But it won't hook, because of the rule in 05-udev-early.rules:
# ignore these events until someone needs them
SUBSYSTEM="module", OPTIONS="ignore_device"
To verify that I did actually have the right hook okay,
I made a 01-dgap.rules and put my rule in there,
and it did hook like I wanted it to.
I really don't want to have a 01-dgap.rules, mainly because
I suspect its probably frowned upon...
(ie, I don't see anyone else doing it...)
Is there any way I can "override" the 05-udev-early.rules for
just this entry in my 10-dgap.rules file?
Thanks!
Scott Kilau
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Udev - Trapping "Add" - Subsystem "module"
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
@ 2006-11-09 19:09 ` Kris van Rens
2006-11-09 19:17 ` Kilau, Scott
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kris van Rens @ 2006-11-09 19:09 UTC (permalink / raw)
To: linux-hotplug
Hi,
Kilau, Scott wrote:
> Is there any way I can "override" the 05-udev-early.rules for
> just this entry in my 10-dgap.rules file?
How about taking a lower number, say, 04-dgap.rules? The rules are handled in lexical order I believe so it wouldn't even matter if you'd take the same number as another rule.
Just be sure not to overrule other rules in 05-udev-early.rules.
-Kris
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&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
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: Udev - Trapping "Add" - Subsystem "module"
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
2006-11-09 19:09 ` Kris van Rens
@ 2006-11-09 19:17 ` Kilau, Scott
2006-11-09 19:22 ` Kris van Rens
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-09 19:17 UTC (permalink / raw)
To: linux-hotplug
Hi Kris,
> How about taking a lower number, say, 04-dgap.rules? The
> rules are handled in lexical order I believe so it wouldn't
> even matter if you'd take the same number as another rule.
I was thinking about doing it that way, but I just want to
make sure its "proper udev etiquette".
A google search doesn't seem to show anyone making any
scripts before the "05"...
And of course, all the regular udev docs suggest using 10-*whatever
for "custom" udev rules...
I just want to be sure that doing an 04- script doesn't violate
anything in udev that might not be happy about it...
Scott Kilau
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Udev - Trapping "Add" - Subsystem "module"
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
2006-11-09 19:09 ` Kris van Rens
2006-11-09 19:17 ` Kilau, Scott
@ 2006-11-09 19:22 ` Kris van Rens
2006-11-09 20:58 ` Sergey Vlasov
2006-11-10 2:05 ` Kilau, Scott
4 siblings, 0 replies; 6+ messages in thread
From: Kris van Rens @ 2006-11-09 19:22 UTC (permalink / raw)
To: linux-hotplug
Kilau, Scott wrote:
> I just want to be sure that doing an 04- script doesn't violate
> anything in udev that might not be happy about it...
Yeah, I have been searching for that too, but indeed; (probably because of the example in the howto) everybody makes rules 10-* or higher.
But, I'd say if there's nowhere to be read that it's an evil thing to make rules below 10-* then why not? As long as you're careful.
That's all the certainty I can give you I'm afraid :)
-Kris
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Udev - Trapping "Add" - Subsystem "module"
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
` (2 preceding siblings ...)
2006-11-09 19:22 ` Kris van Rens
@ 2006-11-09 20:58 ` Sergey Vlasov
2006-11-10 2:05 ` Kilau, Scott
4 siblings, 0 replies; 6+ messages in thread
From: Sergey Vlasov @ 2006-11-09 20:58 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 1171 bytes --]
On Thu, 9 Nov 2006 12:44:52 -0600 Kilau, Scott wrote:
> My rule (currently I put in "10-dgap.rules"):
>
> ACTION=="add", KERNEL=="dgap", SUBSYSTEM=="module", \
> RUN+="/usr/sbin/dgapdl", OPTIONS+="last_rule"
This does not seem to be a good idea. The module add event is
generated early - even before the module init routine is invoked; so
the program you run may even find that the module was not loaded
because the module initialization failed. And even if the module
loads successfully, there will be a race - when your program will try
to access your module, it might break because the module init is not
yet complete. This race might be hard to notice on an uniprocessor
machine, because the udevd process which handles uevents will most
likely be scheduled only after the module init code completes (but you
should be able to reproduce it easily if you insert some sleeps in the
module init code).
The proper way to handle initialization is to have your module
register some devices and then catch addition of these devices in udev
rules. At this time you can be sure that the corresponding device
file has been created by udevd.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: Udev - Trapping "Add" - Subsystem "module"
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
` (3 preceding siblings ...)
2006-11-09 20:58 ` Sergey Vlasov
@ 2006-11-10 2:05 ` Kilau, Scott
4 siblings, 0 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-10 2:05 UTC (permalink / raw)
To: linux-hotplug
> The proper way to handle initialization is to have your module
> register some devices and then catch addition of these devices in udev
> rules. At this time you can be sure that the corresponding device
> file has been created by udevd.
Ah, thanks for the answer.
Yes, this sure does seem like a better solution.
Thanks for the suggestion, I will give it a whirl!
Scott Kilau
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-11-10 2:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
2006-11-09 19:09 ` Kris van Rens
2006-11-09 19:17 ` Kilau, Scott
2006-11-09 19:22 ` Kris van Rens
2006-11-09 20:58 ` Sergey Vlasov
2006-11-10 2:05 ` Kilau, Scott
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).