From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Vlasov Date: Thu, 09 Nov 2006 20:58:37 +0000 Subject: Re: Udev - Trapping "Add" - Subsystem "module" Message-Id: <20061109235837.f0b9fedd.vsu@altlinux.ru> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0358028292==" List-Id: References: <335DD0B75189FB428E5C32680089FB9F8040B0@mtk-sms-mail01.digi.com> In-Reply-To: <335DD0B75189FB428E5C32680089FB9F8040B0@mtk-sms-mail01.digi.com> To: linux-hotplug@vger.kernel.org --===============0358028292== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__9_Nov_2006_23_58_37_+0300_q7xiElYNRrCykbS7" --Signature=_Thu__9_Nov_2006_23_58_37_+0300_q7xiElYNRrCykbS7 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 9 Nov 2006 12:44:52 -0600 Kilau, Scott wrote: > My rule (currently I put in "10-dgap.rules"): >=20 > ACTION=3D=3D"add", KERNEL=3D=3D"dgap", SUBSYSTEM=3D=3D"module", \ > RUN+=3D"/usr/sbin/dgapdl", OPTIONS+=3D"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. --Signature=_Thu__9_Nov_2006_23_58_37_+0300_q7xiElYNRrCykbS7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFU5aBW82GfkQfsqIRAjo1AJ4wuv4MJ6F/aUYTSTXEsqRUQ35NsQCfY4dL GFKrNSo45BcxxpLhvaZXIWI= =FT5v -----END PGP SIGNATURE----- --Signature=_Thu__9_Nov_2006_23_58_37_+0300_q7xiElYNRrCykbS7-- --===============0358028292== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --===============0358028292== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0358028292==--