flock... LOCK_EX + LOCK_NB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

flock... LOCK_EX + LOCK_NB

Post by nielsene »

So the first off-site install of my software is going on right now. We've been debugging it over AIM for a while, but run into some interesting behavoir and I was wondering if anyone here can shed any light on the problem.

One of the backend scripts that handles statistic generate using a lock file to avoid simultaneous rebuilds. It all works fine on my development machines and on the live production server. (Different flavors of Linux (RH and Debian).

My user is installing it on a Mandrake Linux machine. The flock($fp,LOCK_EX+LOCK_NB) returns false, even when no other processes have requested a lock. Removing the LOCK_NB term doesn't chance the result at all, flock still returns false AND doesn't wait as it should.

Doea anyone have any experience with this? Does anyone know how I can force a release of all locks on a file if its gotten into this wierd state?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

which version of mandrake, apache, php? php mod or cgi? On what filesystem?
Post Reply