From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 10:00:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D7A106566C; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 53DE38FC14; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id D0751635; Sun, 5 Feb 2012 11:00:36 +0100 (CET) Date: Sun, 5 Feb 2012 10:59:22 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120205095922.GD30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:00:38 -0000 --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 10:32:56AM -0600, Guy Helmer wrote: >=20 > On Feb 4, 2012, at 1:42 AM, Pawel Jakub Dawidek wrote: >=20 > > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: > >> Author: ghelmer > >> Date: Wed Feb 1 16:40:59 2012 > >> New Revision: 230869 > >> URL: http://svn.freebsd.org/changeset/base/230869 > >>=20 > >> Log: > >> Change the notes about the pidfile to include Doug's preference > >> for pre-creating the pidfile with appropriate owner and permissions. > >>=20 > >> Requested by dougb > >=20 > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > > eg. /var/run/.pid into /var/run//pid where directory > > has appropriate permissions. Pre-creating pidfiles is simply wrong, > > because applications create pidfile on start and unlink it on exit. > > If application has no permission to remove files from /var/run/ it will > > leave pidfile with stale PID in it, which is bad. Changing application > > to truncate pidfile on exit instead of unlinking it also is a bad idea > > especially because there is working solution - pid directory. >=20 > I prefer this approach, but dougb prefers the other approach. Each has po= sitives and negatives. I tried to accommodate both approaches. I seem to miss positives of the other approach. Leaving stale PIDs in pidfile is something we should avoid at all costs, so recommending that in the manual page is not the best recommendation. I for one would prefer to recommend against it. Even if pidfile is truncated on exit it still leave a mess in /var/run/. But currently it is not truncated on exit (pidfile(3) just unlinks the file, without truncating it first), so we end up with stale PIDs. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uUvoACgkQForvXbEpPzQgKwCfSTpBlcqXLjv04P0OEz3ylK8q Us4AoPG0JMJ/P88IbMb39P+d4Q/wj06z =aepb -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V--