Article View: comp.unix.programmer
Article #1291Re: pid file locks
From: Chip Salzenberg
Date: Tue, 27 Nov 1990 17:55
Date: Tue, 27 Nov 1990 17:55
24 lines
1701 bytes
1701 bytes
According to brnstnd@kramden.acf.nyu.edu (Dan Bernstein):
>In article <274975C4.21C@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes:
>> According to rwhite@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@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
Technical Details
Message-ID:
<2752A8A0.5559@tct.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ames!vsi1!daver!tscs!tct!chipReferences:
<1990Nov16.200945.14468@nusdecs.uucp> <274975C4.21C@tct.uucp> <26251:Nov2119:42:1090@kramden.acf.nyu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ames!vsi1!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.unix.programmer Subject: Re: pid file locks Message-ID: <2752A8A0.5559@tct.uucp> Date: 27 Nov 90 17:55:44 GMT References: <1990Nov16.200945.14468@nusdecs.uucp> <274975C4.21C@tct.uucp> <26251:Nov2119:42:1090@kramden.acf.nyu.edu> Organization: Teltronics/TCT, Sarasota, FL Lines: 24