Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2005 12:35:30 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, John-Mark Gurney <gurney_j@resnet.uoregon.edu>, src-committers@FreeBSD.org, Robert Watson <rwatson@FreeBSD.org>, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libutil Makefile libutil.h pidfile.3 pidfile.c
Message-ID:  <20050826103530.GC43700@garage.freebsd.pl>
In-Reply-To: <430EE78A.8060306@FreeBSD.org>
References:  <200508241721.j7OHLcNP061118@repoman.freebsd.org> <20050825060448.Q11335@fledge.watson.org> <20050825154354.GE30465@funkthat.com> <20050825171046.X72462@fledge.watson.org> <430EE78A.8060306@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--bAmEntskrkuBymla
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 26, 2005 at 02:57:30AM -0700, Doug Barton wrote:
+> All that said, and not to throw cold water on Pawel's work here, but I=
=20
+> really am not sure that encouraging the use of pid files in this day and=
 age=20
+> is a good idea. IMO it's a bit of an artifact from a different era, and =
I=20
+> would love to see us eliminate the use of pid files altogether. But that=
's=20
+> just me.

Pidfiles are quite ok when you do it right.
Without them it is hard to use automats for sending signals to daemons and
be sure you don't hit some random process.
Of course I'll be glad to hear other solutions.

+> I have a specific concern with the way that I understand the library to =
work, has the use of FLOCK been tested on NFS mounted /var, and diskless bo=
ot scenarios?

Basically daemons on NFS mounted /var/ (without rpc.lockd) are going to
work still, ie. I advice in manual page (in example) to ignore errors
=66rom pidfile_open() other than EEXIST and this is what I did for most of
our daemons.
EEXIST means that daemon is already running, other errors mean that we
cannot create/lock/etc. pidfile for other reasons.

The exception here is cron(8), which used flock(2) before for pidfiles
and exits when it cannot lock pidfile, which means cron will not work
in such environment. I don't know the reason of such behaviour so I
leaved it as it was - any error from pidfile_open() is critical for
cron(8).

We could still add storing PID even if flock(2) fails, which is not
done now.

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--bAmEntskrkuBymla
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFDDvByForvXbEpPzQRAn/pAKDCKU4d4AnJ5Cu/GY5g3nVBoVcmAwCdEqWN
X8YpT4MNfj7LmMJx8ky5znk=
=doFB
-----END PGP SIGNATURE-----

--bAmEntskrkuBymla--



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