Pidfile generated by /usr/sbin/daemon not usable by rc.d script

RW rwmaillists at
Wed May 25 19:27:16 UTC 2016

On Wed, 25 May 2016 17:12:36 +0200
Adam Lindberg wrote:

> Hi,
> I don’t 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.

More information about the freebsd-questions mailing list