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

Ian Smith smithi at
Wed Jun 1 12:58:42 UTC 2016

On Wed, 1 Jun 2016 12:13:27 +0200, Adam Lindberg wrote:
 > Sorry for the late reply.
 > What we observed was that the `read _pid _junk < $_pidfile` line did 
 > indeed work on the command line, after sourcing /etc/rc.subr. For 
 > some strange reason it seems not to work from inside the service 
 > script for us.

I just had another look at your foo.rcscript attachment, and bounced 
through all in {/usr/local,}/etc/rc.d for examples.  As RW said earlier, 
'command=yes' appears unlike all the others, in that it does not provide 
the full pathname of the executable.  I don't know if that matters here.

Also, none of the others (here) need daemon(8) to run, in background or 
otherwise .. are you sure that you require its functionality for 'foo'?

For one thing, it seems that daemon keeps the -p pidfile locked during 
execution of the process; might that affect service status, stop, etc?

Otherwise I have no idea; a PR may indeed be worthwhile pursuing.

cheers, Ian

More information about the freebsd-questions mailing list