Re: setlock oddity - stale lock file?

Andy Bradford <[email protected]> Fri, 15 Jun 2007 22:22:39 -0600
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
Thus said Charles Cazabon on Thu, 14 Jun 2007 09:16:17 MDT:

> So it  appears setlock thought the  lock file was locked,  even though
> there was  no process with  it open, etc.  I didn't think  setlock was
> susceptible to this type of problem.

The source for setlock is extremely small  and easy to read. From what I
can  tell, it  looks  like it  shouldn't have  this  problem unless  the
operating system  tells it  that the  file is locked.  Is it  possibly a
problem with the operating system? Does setlock make any guarantees when
the operating system dies (or power fails)?

It may also be useful to look at the man page for flock/lockf on your OS
to see what it does. I suspect at  this point only the OS can answer the
question as to why it still considers that file locked...

Andy
-- 
[-----------[system uptime]--------------------------------------------]
 10:22pm  up  1:32,  2 users,  load average: 1.25, 1.20, 1.16