From owner-freebsd-questions@freebsd.org Sun Jun 5 16:36:15 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 D74EAB6AAE9 for ; Sun, 5 Jun 2016 16:36:15 +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 62B5B1508 for ; Sun, 5 Jun 2016 16:36:14 +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 u55Ga4r9010241; Mon, 6 Jun 2016 02:36:04 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 6 Jun 2016 02:36:04 +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: <5C74A843-C2EB-424B-9254-0CD68A07E480@wooga.net> Message-ID: <20160606022421.T15883@sola.nimnet.asn.au> References: <20160602230511.W15883@sola.nimnet.asn.au> <5C74A843-C2EB-424B-9254-0CD68A07E480@wooga.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT 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: Sun, 05 Jun 2016 16:36:15 -0000 On Fri, 3 Jun 2016 10:18:53 +0200, Adam Lindberg wrote: > We are using FreeBSD 10.1 STABLE. We are trying to demonize an Erlang > program. Erlang itself has support for detaching but cannot write > pidfiles. That˙˙s why we˙˙re trying to use daemon to wrap it. > > My experience is also that read works in all cases without a newline, > except from inside the rc script. That I cannot explain. I'm mystified too. Sounds like raising a bug might be your best bet; it may be come across by someone who knows more or recognises something. Looking at your sh -ex runs, good and fail, the only thing I wonder about is whether running it without -e might make any difference .. although the sourced /etc/rc.subr certainly should be -e safe. cheers, Ian