[5049] in bugtraq
Re: request-route
daemon@ATHENA.MIT.EDU (Eric Bennett)
Tue Jul 29 17:36:15 1997
Date: Tue, 29 Jul 1997 15:36:55 -0400
Reply-To: Eric Bennett <bennett@HPL.UMCES.EDU>
From: Eric Bennett <bennett@HPL.UMCES.EDU>
X-To: Zoltan Hidvegi <hzoli@FRONTIERNET.NET>
To: BUGTRAQ@NETSPACE.ORG
In-Reply-To: <199707290516.BAA01581@hzoli.home>
On Tue, 29 Jul 1997, Zoltan Hidvegi wrote:
> As far as I know, there is no portable way to safely create
> lock files in a world-writable directory from a bourne-shell script.
I have done this by creating directories instead of files: only one mkdir
will complete. You can also create a pid-specific file and then ln it to the
common lockfile - only one ln will complete (without the -f flag).
I'm not sure if ln is save over NFS, but I beleive that mkdir is.
Eric B.