From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Beau Date: Sun, 22 Jun 2003 06:31:56 +0000 Subject: Re: Hotplug bug in Linux 2.4.21? Message-Id: 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 On Saturday 21 June 2003 18:11, Adrien Beau wrote: > > > You'll need to find some other way of knowing when a lockfile > > exists and is stale... something that can handle more than > > one process that is started at identical times (or nearly > > so). > > Even with the very short interval between them, the scripts > find without error that the lockfile exists, and read it > without error. However, they then go to decide that 1 is > greater than 60, and *that*, I can't understand. > > I'm going to put some sleep(1) at appropriate places and see if > this helps. It quickly turned out that this was a wrong idea, since the scripts are started at the same time. It only makes things worse, since the the lockfile then disappears while a script is sleeping. It doesn't matter any more, though, since I have found a solution to this problem. I tried to find what made the test fail. It turns out that expr $currenttime '-' $timestamp '<' $MAX_LOCK_AGE returns 1 to stdout, which means that indeed, expr thinks that 0 or 1 are less than 60. The bug is that, when run in "normal" conditions, at a few seconds interval, the above command has an exit status of 0, but when run in "stress" conditions, at a few hundredth of seconds interval, its exit status is 1. That's just weird (a bug in the kernel or glibc, or what?), but that can be worked around. I ended up using [ `expr $currenttime '-' $timestamp` -lt $MAX_LOCK_AGE ] instead, which works fine. -- adrien.beau@free.fr - http://adrien.beau.free.fr/ ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ 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