pid file locks

Chip Salzenberg chip at tct.uucp
Wed Nov 28 04:55:44 AEST 1990


According to brnstnd at kramden.acf.nyu.edu (Dan Bernstein):
>In article <274975C4.21C at tct.uucp> chip at tct.uucp (Chip Salzenberg) writes:
>> According to rwhite at nusdecs.uucp (0257014-Robert White(140)):
>> >Do the "put process number in lock file" thing as in uucp.
>>
>> This approach cannot be used reliably without either (1) having a lock
>> held forever by a dead process, which I find unacceptable, or (2)
>> using a kernel locking call, which renders the pid file redundant.
>
>It can be used reliably if you put information like pid and date into
>the name of the lock file.

While Dan is obviously correct in stating that pid file locking can be
used reliably, he perhaps did not notice all the implications of Mr.
White's suggestion of using pif files -- "as in uucp".  At least in
the V7, BSD and HDB variants of UUCP, locking is done with a pid in a
fixed-name lock file.

I was correct in stating that this approach -- "as in uucp" -- cannot
be made to work reliably without the use of kernel locking primitives.
-- 
Chip Salzenberg at Teltronics/TCT     <chip at tct.uucp>, <uunet!pdn!tct!chip>
    "I've been cranky ever since my comp.unix.wizards was removed
         by that evil Chip Salzenberg."   -- John F. Haugh II



More information about the Comp.unix.programmer mailing list