On Mon, Oct 31, 2005 at 02:57:50AM -0800, Martin Knoblauch wrote:
> Hi Seth,
> 
>  the comments came from Brooks. Hi Brooks, care to elaborate what
> problems you see with the pidfile stuff from Seth?

The big one is that if you use pidfile existence as the measure of the
server being running, you can't start it reliably.  This code at least
partially avoids the issue by using getpgid() though it's still
susceptible to collisions with unrelated processes having the same pid
which is more of an issue then you might think during startup.

The FreeBSD pidfile code solves the problem by locking the file using
flock().  This has the nice effect that if you can obtain the lock, the
file is not the pidfile of a living process since the kernel drops the
lock when the process dies.

-- Brooks

Reply via email to