From owner-freebsd-questions@freebsd.org Wed May 25 19:27:16 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 6754AB4AB22 for ; Wed, 25 May 2016 19:27:16 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 03B061FF8 for ; Wed, 25 May 2016 19:27:15 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x233.google.com with SMTP id n129so197942729wmn.1 for ; Wed, 25 May 2016 12:27:15 -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=2pTbbAGGIYDWXjgZARJ+JGqQIiyFKEFWvyFcl/SxAcI=; b=IJOG9akkiIXsqdnELE+1KHMpYyL893rpvNxPsxdc9zYP+oMUJA9dFzvQrNo3Ry1xLh JWCUUJJwZ6rko4wZK0CQx+KQwfIonsTgZMi+89p/yuQfUBeX3kwxjJUDxpe8JjYFgMiO UmgYK6YYeRCIu1VVY99KoZNhg2++r2WkFyrKJ5DsltJKOHiHJOi77nxFXQdIqWP/z4Uo 5m9iBR5H5jUZShBXLDGAdWeQVP708bcfgazyerx0mTCnmJX+hUwK7V/PwIJSDtlzONqT SI7nGNlndI4aWtlOFv8X4rWeavpn3M+Mg2lzIyz4C88A5IolPZcVVq2XtciAH9nQaaMe 00TQ== 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=2pTbbAGGIYDWXjgZARJ+JGqQIiyFKEFWvyFcl/SxAcI=; b=O7/5q5MPYIBXqBXpsHY/qIr3yLjP17nZwCvlNaV9zJ1gUozBUW0B5b8rcU8tdlNiar rvSfXm19IOMopu5QUnQZ9HCHG6liOOWGGMzD0PXUoCGGedr4LwFXjj5dI6uttU4BQ3nM MiHsbVJmjOJ3W5/pZXm6UjcysUnmhSu9o7JGMvWiBJUf6BcCX6f37wawv6gYwpDG3uE/ H/6kuEqLRjfYvkJfcDbPsD5lo7exkUKBoMf1CPrX9A88ipt2vSN6Dhx11ttpZsfcUvyg UAEEqLPAM3UhsbrAYGd/taRyf6eMESljsedpo2Gw0viU0pFZReUzG8RDlfr/d/a1O/pd QGuQ== X-Gm-Message-State: ALyK8tLHSiqrsnvwuLiKkuZSXMVAh/Wr0kBHHb4TcGxa2B+w7xL3EkSxwfffswvKLfhw6g== X-Received: by 10.194.231.196 with SMTP id ti4mr6101520wjc.41.1464204418871; Wed, 25 May 2016 12:26:58 -0700 (PDT) Received: from gumby.homeunix.com ([2.221.17.115]) by smtp.gmail.com with ESMTPSA id q125sm10913639wmd.19.2016.05.25.12.26.57 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 12:26:57 -0700 (PDT) Date: Wed, 25 May 2016 20:26:56 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script Message-ID: <20160525202656.71f51c86@gumby.homeunix.com> In-Reply-To: References: <1249E74D-FB34-4FF3-B670-38D80B1B07AF@wooga.net> <20160525141347.7e82622e@gumby.homeunix.com> <20160525142724.7ccadc4e@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 19:27:16 -0000 On Wed, 25 May 2016 17:12:36 +0200 Adam Lindberg wrote: > Hi, >=20 > I don=E2=80=99t know what powerd is and how it factors into this. :-) It's an example of a daemon that generates a pid file without a newline, and yet "stop" and "status" work. It turns out that /etc/rc.d/powerd doesn't define pidfile, in which case rc.subr finds the pid from the output of ps. So it's not a counter-example and it does appear to be a bug that rc.subr can't cope with a pid file without a newline. You could use the same method, but using sed seems safer.