Pidfile generated by /usr/sbin/daemon not usable by rc.d script
adam.lindberg at wooga.net
Wed May 25 15:12:40 UTC 2016
I don’t know what powerd is and how it factors into this. :-)
We’re trying to create a service script for our own program (an Erlang VM) and hit this “weird behavior”. We were using command=yes as a way to get some program running in the background with daemon wrapped around it. We were able to reproduce the problem with just this minor rc.d script and running ‘yes’ (the executable) as our service. This problem happens no matter what the command is, as far as we can tell.
Adam Lindberg | Backend Engineer
Wooga GmbH | Saarbrücker Str. 38 | D-10405 Berlin
Place of business: Berlin
Registered at the local court Berlin-Charlottenburg, HRB 117846 B
Managing Directors: Jens Begemann, Philipp Möser, Jan Miczaika
> On 25 May 2016, at 15:27 , RW via freebsd-questions <freebsd-questions at freebsd.org> wrote:
> On Wed, 25 May 2016 14:13:47 +0100
> RW wrote:
>> On Wed, 25 May 2016 11:51:31 +0200
>> Adam Lindberg wrote:
>>> 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.
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions