From owner-cvs-all@FreeBSD.ORG Fri Aug 26 09:57:34 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E194316A41F for ; Fri, 26 Aug 2005 09:57:34 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail1.fluidhosting.com (mail1.fluidhosting.com [204.14.90.61]) by mx1.FreeBSD.org (Postfix) with SMTP id 69F9243D4C for ; Fri, 26 Aug 2005 09:57:33 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 89120 invoked by uid 399); 26 Aug 2005 09:57:32 -0000 Received: from localhost (HELO ?192.168.1.100?) (dougb@dougbarton.net@127.0.0.1) by localhost with SMTP; 26 Aug 2005 09:57:32 -0000 Message-ID: <430EE78A.8060306@FreeBSD.org> Date: Fri, 26 Aug 2005 02:57:30 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050726) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Watson References: <200508241721.j7OHLcNP061118@repoman.freebsd.org> <20050825060448.Q11335@fledge.watson.org> <20050825154354.GE30465@funkthat.com> <20050825171046.X72462@fledge.watson.org> In-Reply-To: <20050825171046.X72462@fledge.watson.org> X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, John-Mark Gurney , src-committers@FreeBSD.org, Pawel Jakub Dawidek , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libutil Makefile libutil.h pidfile.3 pidfile.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2005 09:57:35 -0000 Robert Watson wrote: > > On Thu, 25 Aug 2005, John-Mark Gurney wrote: > >>> Something I'd very much like to see is for daemon pid files to start >>> being placed in /var/run//.pid, as opposed to >>> directly in /var/run. This will allow us to set specific ownership >>> on the parent directory for a pid file, so that privilege is not >>> required to write out a pid file in a safe place. >> >> >> why not add an rc.subr option to precreate the file with the correct >> user? I was running up conserver, and I decided to run it as a >> seperate user, and since I created it as owned by the conserver user, >> conserver just opened and wrote to the file.. > > > We already actually run bind with a pid file in /var/run/named. I'm not > sure we need a whole lot of magic, other than having mtree create the > directories for base system components, and packages/ports create them > for third party components. Frankly, the mtree stuff for BIND to do this is a hack, and I would much rather see this generalized in a useful way in rc.subr. That way all system stuff can just use it, and all ports can use it as they adopt rc.subr style startup scripts. This would not be particularly difficult, if there is wider interest in this, I can whip up a POC. Given that the rc scripts run as root there shouldn't be any permissions problems to overcome. My thought would be to simply default the name of the directory in /var/run to be whatever the name of the script is, and the file itself to be "pid" as named does it. My feeling is that we have way too many empty directories created by mtree as it is, especially for ports, and I would really hate to continue adding to that clutter. All that said, and not to throw cold water on Pawel's work here, but I really am not sure that encouraging the use of pid files in this day and age is a good idea. IMO it's a bit of an artifact from a different era, and I would love to see us eliminate the use of pid files altogether. But that's just me. 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 boot scenarios? hth, Doug -- This .signature sanitized for your protection