From owner-freebsd-questions@freebsd.org Wed May 25 15:12:40 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 BE81BB4A760 for ; Wed, 25 May 2016 15:12:40 +0000 (UTC) (envelope-from adam.lindberg@wooga.net) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 5C74F1BEF for ; Wed, 25 May 2016 15:12:40 +0000 (UTC) (envelope-from adam.lindberg@wooga.net) Received: by mail-wm0-x22e.google.com with SMTP id z87so19665177wmh.1 for ; Wed, 25 May 2016 08:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wooga-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=r/Frrel0E2g4/6OU3PVB6/rhHvYBv5rX0tdA//J6FYQ=; b=xETqzQhLWGUvBiHtsndyCAaJO9ECQeTFtsY5Vr6SO848CGqPjQkJod5qGt8ib6Q1ZS 1lei8RhhTY30yrjt4TRrTOnzFO2B9QVUhAUfXBQZkoY3m2qTmkwnocrkHzVnGmfM0Vaf V440aG9dCEKXT2L0X9d72NnvG8STF9U8wskJv8CqE9NZ8bYGIRU5XRkrezgAlrMalczx pltT+mYUAqqJW5X879iKJ8Ny/cffjoGOFETS8ElQ9lg3c6JcP0Tl8SPUDmTTscNIQZp7 yEtPP8jUyHDR2++NI2NnA7PcptpKVAQ9gO2HRTBmAB7QnytNFhK0Sgt2Ds+cBo9833n0 68pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=r/Frrel0E2g4/6OU3PVB6/rhHvYBv5rX0tdA//J6FYQ=; b=N9cg3QIoAu3d8vgO39W3qFWU+DndQrmES3bzp4qj8qYMeY2pFDqQXvIUnmJ5KXSSKu FNYDYqaY1xFr6/O0zrTuPLdLHS9EJWvFoILHjSaO5rUJOjwTMwAfuMyaqUm4/QOMtaiK rsTQQ/qYbuECnVcdKhIb0CPlFrB0VJ1f6qZcNrtwgUfWzNUhUPxQSFPfXHsaXJHm7e3H 25VzBGjel5B36GtYz4IiebQdUQ/Ns7JbBpIi6K5yuflWJARm0Svw1ELYgrJMklGbdQdW nFcJjezAZ8KlOB6L4OZYzI3o4DNk+wBMaiuDDz+iHX8ZDW6nFqhDZPYloobuCravJH8+ WL0A== X-Gm-Message-State: ALyK8tIuJ5o7voHkKOKPDMajKtBGTVlV1dx/aMKYMeUn9Kt5b/p7bn+CfO4pRjRxRE7KhQ7z X-Received: by 10.28.157.23 with SMTP id g23mr2352505wme.34.1464189158434; Wed, 25 May 2016 08:12:38 -0700 (PDT) Received: from [185.74.12.147] ([185.74.12.147]) by smtp.googlemail.com with ESMTPSA id f12sm22548617wme.13.2016.05.25.08.12.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 08:12:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script From: Adam Lindberg In-Reply-To: <20160525142724.7ccadc4e@gumby.homeunix.com> Date: Wed, 25 May 2016 17:12:36 +0200 Cc: freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1249E74D-FB34-4FF3-B670-38D80B1B07AF@wooga.net> <20160525141347.7e82622e@gumby.homeunix.com> <20160525142724.7ccadc4e@gumby.homeunix.com> To: RW X-Mailer: Apple Mail (2.3124) 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 15:12:40 -0000 Hi, I don=E2=80=99t know what powerd is and how it factors into this. :-) We=E2=80=99re trying to create a service script for our own program (an = Erlang VM) and hit this =E2=80=9Cweird behavior=E2=80=9D. We were using = command=3Dyes as a way to get some program running in the background = with daemon wrapped around it. We were able to reproduce the problem = with just this minor rc.d script and running =E2=80=98yes=E2=80=99 (the = executable) as our service. This problem happens no matter what the = command is, as far as we can tell. Cheers, Adam -- Adam Lindberg | Backend Engineer Wooga GmbH | Saarbr=C3=BCcker Str. 38 | D-10405 Berlin Place of business: Berlin Registered at the local court Berlin-Charlottenburg, HRB 117846 B Managing Directors: Jens Begemann, Philipp M=C3=B6ser, Jan Miczaika > On 25 May 2016, at 15:27 , RW via freebsd-questions = wrote: >=20 > On Wed, 25 May 2016 14:13:47 +0100 > RW wrote: >=20 >> 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=9Cstatus=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 script when >>> trying to read the pidfile. =20 >>=20 >>=20 >>=20 >> This is strange because powerd.pid works without a newline.=20 >=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 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"