Date: Wed, 25 May 2016 14:27:24 +0100 From: RW <rwmaillists@googlemail.com> To: freebsd-questions@freebsd.org Subject: Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script Message-ID: <20160525142724.7ccadc4e@gumby.homeunix.com> In-Reply-To: <20160525141347.7e82622e@gumby.homeunix.com> References: <1249E74D-FB34-4FF3-B670-38D80B1B07AF@wooga.net> <20160525141347.7e82622e@gumby.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 25 May 2016 14:13:47 +0100 RW wrote: > 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=9Cst= atus=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 s= cript when > > trying to read the pidfile. =20 >=20 >=20 >=20 > This is strange because powerd.pid works without a newline.=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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160525142724.7ccadc4e>