From owner-freebsd-questions@FreeBSD.ORG Wed Oct 10 00:16:34 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B84116A417 for ; Wed, 10 Oct 2007 00:16:34 +0000 (UTC) (envelope-from sdafreebsduk@rowyerboat.com) Received: from heisenberg.zen.co.uk (heisenberg.zen.co.uk [212.23.3.141]) by mx1.freebsd.org (Postfix) with ESMTP id 03BFC13C45A for ; Wed, 10 Oct 2007 00:16:33 +0000 (UTC) (envelope-from sdafreebsduk@rowyerboat.com) Received: from [82.70.166.86] (helo=[192.168.0.200]) by heisenberg.zen.co.uk with esmtp (Exim 4.50) id 1IfPFY-0001xm-5I; Wed, 10 Oct 2007 00:16:32 +0000 Message-ID: <470C19D5.1060101@rowyerboat.com> Date: Wed, 10 Oct 2007 01:16:21 +0100 From: sdafreebsduk@rowyerboat.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: "Philip M. Gollucci" References: <470AB2FC.8070006@rowyerboat.com> <6.0.0.22.2.20071008183414.025a1e88@mail.computinginnovations.com> <470AD44A.4070601@rowyerboat.com> <470AD780.30702@ridecharge.com> In-Reply-To: <470AD780.30702@ridecharge.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-Heisenberg-IP: [82.70.166.86] Cc: FreeBSD Questions Subject: Re: Question about rc-scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2007 00:16:34 -0000 Hi Philip, > Most binaries i.e. httpd, memcached, mysqld, etc... provide a config > file or cli option to provide the path to a pid file. Like you say - I can't find anything in rc.subr that would create a pid. So, I looked in /etc/rc.d/ntpd (for example), and I still can't find in there where it might create a pid. > Your particular problem is that run_rc_command actually exits so that > the script exits with the correct return code generally that of what > the application in question returns from trying to start or stop. > > Inless you have a reason, If you're running a daemon, you shouldn't need > to background the command. It /is/ a daemon > Also, rather then an echo try adding -x to the shebang line. Yeah, I did that whilst I was re-arranging it. I think my problem is, I don't understand properly what creates the pids for the standard scripts (like nptd), so I can't look at it to see how it's done. Many thanks, Steve