Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2005 17:45:40 +0400
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>, Hajimu UMEMOTO <ume@FreeBSD.org>, FreeBSD-arch <freebsd-arch@FreeBSD.org>
Subject:   Re: New library: libpidfile.
Message-ID:  <20050824134540.GA94265@comp.chem.msu.su>
In-Reply-To: <20050823202656.GB30465@funkthat.com>
References:  <20050822213028.GB4812@garage.freebsd.pl> <ygek6id48nn.wl%ume@mahoroba.org> <20050823080754.GA47261@garage.freebsd.pl> <20050823202656.GB30465@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 23, 2005 at 01:26:56PM -0700, John-Mark Gurney wrote:
> Pawel Jakub Dawidek wrote this message on Tue, Aug 23, 2005 at 10:07 +0200:
> > On Tue, Aug 23, 2005 at 12:46:52PM +0900, Hajimu UMEMOTO wrote:
> > +> Hi,
> > +> 
> > +> >>>>> On Mon, 22 Aug 2005 23:30:28 +0200
> > +> >>>>> Pawel Jakub Dawidek <pjd@FreeBSD.org> said:
> > +> 
> > +> pjd> I'd like to commit a small library for handling "pidfiles".
> > +> 
> > +> NetBSD and OpenBSD has similar functions already in libutil.  I think
> > +> we alone have a different API is bad idea.  So, it is good to bring
> > +> them into FreeBSD from NetBSD or OpenBSD, IMHO.
> > 
> > I assume you're talking about NetBSD's pidlock(3).
> > 
> > This is exactly an example of a bad way of doing it, as I understand the
> > code.
> 
> /me just checked NetBSD and OpenBSD's code at:
> http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libutil/pidfile.c?rev=1.7&content-type=text/x-cvsweb-markup
> http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/pidfile.c?rev=1.7&content-type=text/x-cvsweb-markup
> 
> Neither, of these are safe to prevent multiple daemons from starting
> up at the same time...  Both NetBSD and OpenBSD doesn't even check if
> a daemon is running.. it just blindly splats the pid into the file..

Of course, giving advices is much easier than doing the real work,
but I dare suggest cooperation with NetBSD and OpenBSD on this issue
so that eventually we have a good and compatible implementation of
the pidfile API in *BSD.  I believe that the NetBSD and OpenBSD
folks won't take offence if approached with a well-grounded explanation
of why their current pidfile functions suck.

-- 
Yar



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050824134540.GA94265>