From owner-freebsd-questions@FreeBSD.ORG Mon Oct 8 23:36:43 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 2FD6C16A475 for ; Mon, 8 Oct 2007 23:36:43 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id D67A413C4A7 for ; Mon, 8 Oct 2007 23:36:42 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id l98NaG7X055038; Mon, 8 Oct 2007 18:36:17 -0500 (CDT) Message-Id: <6.0.0.22.2.20071008183414.025a1e88@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Mon, 08 Oct 2007 18:35:53 -0500 To: Stephen Allen , FreeBSD Questions From: Derek Ragona In-Reply-To: <470AB2FC.8070006@rowyerboat.com> References: <470AB2FC.8070006@rowyerboat.com> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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: Mon, 08 Oct 2007 23:36:43 -0000 At 05:45 PM 10/8/2007, Stephen Allen wrote: >Under normal circumstance, should the /etc/rc.subr functions handle the >creation of the pid at service start? > >The basic vendor-provided script (which I've had to adapt somewhat to >suit this installation) runs "echo $! > ${dbgw_pidfile}" as the last >line of the script. When you do a 'status' command though, it blanks >out the contents of the pid. That echo line isn't present in any of the >standard scripts - hence my initial question. > >Apart from variable assignments, the script defines 'start_cmd' (which I >assume is used as the start command by rc.subr). Strange that I >couldn't find any reference to start_cmd in /etc/rc.subr though. > >So, my question is, why isn't the pidfile being automagically created? > >Many thanks, >Steve Not all scripts create a pid file is the simple answer. Your script should create the pid file on start, remove it on stop, and simply cat that file on a status. If you want help with your script, post it, and I'm sure one of us will give you a hand. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.