At most 1 running copy

Paul Tomblin ptomblin at gmail.com
Sat Nov 27 02:50:28 UTC 2004


On Fri, 26 Nov 2004 21:34:11 -0500, Doug Stewart <dstewart at atl.lmco.com> wrote:
> Ed Wilts wrote:
> It might be a better idea to simply write out a "lockfile" and check for
> its presence before running.

One technique we used back in the days of C-News was to make a
lockfile.$PID.  You then tried to create a HARD link (not a symlink)
from lockfile.$PID to lockfile.  The link call was guaranteed to be
atomic, failing if lockfile already existed.


-- 
 "To announce that there must be no criticism of the president, or that we
are to stand by the president, right or wrong, is not only unpatriotic and
servile, but is morally treasonable to the American public." -- Teddy Roosevelt




More information about the users mailing list