Subject: Re: Simultaneous builds
To: None <tech-pkg@netbsd.org>
From: Amitai Schlair <schmonz@schmonz.com>
List: tech-pkg
Date: 01/11/2002 11:05:28
"Alistair Crooks" <agc@pkgsrc.org> wrote:

> PR 7590 is a good start, but it relies on shlock, which doesn't do too
> well on NFS-mounted partitions.
>
> I'm also not too sure of its availability on other platforms.

I don't use NFS. To lock reliably over NFS, is it sufficient to use PID
+ hostname? I searched Google for "reliable NFS locking" and found this
in a Linux man page:

"The solution for performing atomic file locking using a lockfile is to
create a unique file on the same fs (e.g., incorporating hostname and
pid), use link(2) to make a link to the lockfile and use stat(2) on the
unique file to check if its link count has increased to 2."

If so, we could make shlock(1) work this way, and then make it part of
the pkgsrc bootstrap on other systems and older NetBSD. Would this be a
good approach?

- Amitai