From owner-freebsd-questions@freebsd.org Wed May 25 13:27:30 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 238A0B49A99 for ; Wed, 25 May 2016 13:27:30 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF99F1D05 for ; Wed, 25 May 2016 13:27:29 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x232.google.com with SMTP id n129so182085597wmn.1 for ; Wed, 25 May 2016 06:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MCTZ0ioc3we7RIszv+Go8rV3Gh4d04fHnDXHPd9G2aA=; b=XW9S5vblNiIvR971GL7rBPbb0uBgKYFStfX0fzvCG2VHk5Jy8l+S/3qrVokMqMh3Gj uus/y/9T55jjouPWyRJzS66ykOL20eJxzScNSYg0l0A9BV3M19D7iO5r8HDtkKqsSgAT USezFnOSIw39BYkLTxt3G55UOnQICAwPsyEnH6KGBlBm3t/ZtH7GGt8o+vH6qT5oHQqH SwvHcPyJl6jmdQkpNpZhwojQemRg0b+dwCWUzmWZdDz2bMaojy/3003WetMeC1BV6fSa OFtU0dZaxo1DZOcpzwdh6U0K/epzdd10TCFVlbwVsECKQLx6uGsbgRGDWHo7Vz8RgE21 JXpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MCTZ0ioc3we7RIszv+Go8rV3Gh4d04fHnDXHPd9G2aA=; b=I+GXWg6n4UQ4b3nc/j/38wU1Atga1hvQfxgPv1rxpPYnfGQT/Axa16/FInyL+IP2rN +LXzrFxctRydSXkvZ+U3LtWI6iNpjDY/X3tWWkNsOTbnNwM1zG+MkMp63+UaG1D5k53h qZCYSrPe/53vivMXrewHhw3Mn9BlXpGh1MDksVHfD/SG8QXT1yAGFfHcLnz//phhk/UJ 24fTiLmyK/AHRKWFt765W3l+h0pIZ0Y6qx9dyL92td/YLRQylZNWgQbdvodcQgOT0hb4 U/ZQG6kX8IHgh+xCxJY54MS6/0kOG/08hkdurk84NGd4oTB188XoUhoukOX4y0qkvrx2 esOA== X-Gm-Message-State: ALyK8tLLLzQENtj0AOipQSFgVu/YitCgU0wBwcKmW7weSDtxqvnY+iwulNyB3vtyaLK83A== X-Received: by 10.195.11.106 with SMTP id eh10mr4503810wjd.130.1464182848264; Wed, 25 May 2016 06:27:28 -0700 (PDT) Received: from gumby.homeunix.com ([2.221.17.115]) by smtp.gmail.com with ESMTPSA id y6sm24868900wmy.8.2016.05.25.06.27.26 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 06:27:27 -0700 (PDT) Date: Wed, 25 May 2016 14:27:24 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script Message-ID: <20160525142724.7ccadc4e@gumby.homeunix.com> In-Reply-To: <20160525141347.7e82622e@gumby.homeunix.com> References: <1249E74D-FB34-4FF3-B670-38D80B1B07AF@wooga.net> <20160525141347.7e82622e@gumby.homeunix.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 25 May 2016 13:27:30 -0000 On Wed, 25 May 2016 14:13:47 +0100 RW wrote: > On Wed, 25 May 2016 11:51:31 +0200 > Adam Lindberg wrote: >=20 > > Hi! > >=20 > > I=E2=80=99m trying to create a minimal rc.d script for a service, and > > discovered that using /usr/sbin/daemon with the -p flag creates a > > pidfile which is not readable by /etc/rc.subr. The pidfile is > > created without a newline, in which case all the service commands > > stop working. That means, running =E2=80=9Cstop=E2=80=9D or =E2=80=9Cst= atus=E2=80=9D prints > > nothing. If I add a newline to the file after the fact, they all > > start working again. Running the service script with debug output, > > shows the =E2=80=98read=E2=80=99 builtin halting the execution of the s= cript when > > trying to read the pidfile. =20 >=20 >=20 >=20 > This is strange because powerd.pid works without a newline.=20 Actually on closer inspection it appears that rc.d/powerd doesn't define a pidfile - it's getting shutdown based on the command name. I think you should submit a PR. =20