From owner-freebsd-questions@freebsd.org Wed Jun 1 12:58:42 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C8EB607AE for ; Wed, 1 Jun 2016 12:58:42 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5771DAA for ; Wed, 1 Jun 2016 12:58:40 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id u51CwSXx001430; Wed, 1 Jun 2016 22:58:29 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Wed, 1 Jun 2016 22:58:28 +1000 (EST) From: Ian Smith To: Adam Lindberg cc: RW , freebsd-questions@freebsd.org Subject: Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script In-Reply-To: <6ECB89F6-4410-47D2-AA9B-1EA63B334CF0@wooga.net> Message-ID: <20160601222416.Q15883@sola.nimnet.asn.au> References: <20160526193917.C15883@sola.nimnet.asn.au> <6ECB89F6-4410-47D2-AA9B-1EA63B334CF0@wooga.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 12:58:42 -0000 On Wed, 1 Jun 2016 12:13:27 +0200, Adam Lindberg wrote: > Sorry for the late reply. > > What we observed was that the `read _pid _junk < $_pidfile` line did > indeed work on the command line, after sourcing /etc/rc.subr. For > some strange reason it seems not to work from inside the service > script for us. I just had another look at your foo.rcscript attachment, and bounced through all in {/usr/local,}/etc/rc.d for examples. As RW said earlier, 'command=yes' appears unlike all the others, in that it does not provide the full pathname of the executable. I don't know if that matters here. Also, none of the others (here) need daemon(8) to run, in background or otherwise .. are you sure that you require its functionality for 'foo'? For one thing, it seems that daemon keeps the -p pidfile locked during execution of the process; might that affect service status, stop, etc? Otherwise I have no idea; a PR may indeed be worthwhile pursuing. cheers, Ian