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

RW rwmaillists at googlemail.com
Wed May 25 13:27:30 UTC 2016


On Wed, 25 May 2016 14:13:47 +0100
RW wrote:

> On Wed, 25 May 2016 11:51:31 +0200
> Adam Lindberg wrote:
> 
> > Hi!
> > 
> > I’m 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 “stop” or “status” 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 ‘read’ builtin halting the execution of the script when
> > trying to read the pidfile.  
> 
> 
> 
> This is strange because powerd.pid works without a newline. 

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.  


More information about the freebsd-questions mailing list