From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott James Remnant Date: Wed, 23 Nov 2005 08:26:15 +0000 Subject: Re: waiting for an unknown set of udev /dev entries to complete Message-Id: <1132734375.5758.16.camel@localhost.localdomain> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-1OXvDM4/oglkNROZ9nE9" List-Id: References: <20051118223045.GA28401@us.ibm.com> In-Reply-To: <20051118223045.GA28401@us.ibm.com> To: linux-hotplug@vger.kernel.org --=-1OXvDM4/oglkNROZ9nE9 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2005-11-23 at 00:13 +0100, Kay Sievers wrote: > Scott sent a nice patch to remove the /dev/.udev.queue directory if it's > empty. That makes it pretty easy to work around this: > start udevd > mkdir -p /dev/.udev/queue > trigger uevent's in /sys > while test -d /dev/.udev/queue; do sleep 0.1; done >=20 > The last event will just rmdir() the created queue directory. >=20 There's still a potential race here: if an event arrives after you've created the queue directory and finishes just as you finish triggering the uevents, but before the first triggered event gets queued, the queue directory will be removed and the script won't wait. =20 Looking through the kernel code it does look like it's almost impossible, as the triggering of a uevent seems to not complete the write() call until it's been posted down the netlink socket. Almost isn't totally though; so it's there ... but it's such a remote chance that I think it's fine for now, and the only real way to avoid race conditions is just not to wait and arrange your entire boot sequence to be event-driven rather than serial. Scott --=20 Scott James Remnant scott@ubuntu.com --=-1OXvDM4/oglkNROZ9nE9 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDhCenSnQiFMl4yK4RAmeiAJwJYJ8aon1KO4TzYGHRFrWf1mJLQgCeL92N rKy7fe4hG+kpxnLq+cCZWyc= =tspl -----END PGP SIGNATURE----- --=-1OXvDM4/oglkNROZ9nE9-- ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ 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