Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2016 17:12:36 +0200
From:      Adam Lindberg <adam.lindberg@wooga.net>
To:        RW <rwmaillists@googlemail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Pidfile generated by /usr/sbin/daemon not usable by rc.d script
Message-ID:  <E4F4D59F-1CA0-4A4C-9E76-4ADD988993CC@wooga.net>
In-Reply-To: <20160525142724.7ccadc4e@gumby.homeunix.com>
References:  <1249E74D-FB34-4FF3-B670-38D80B1B07AF@wooga.net> <20160525141347.7e82622e@gumby.homeunix.com> <20160525142724.7ccadc4e@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I don=E2=80=99t know what powerd is and how it factors into this. :-)

We=E2=80=99re trying to create a service script for our own program (an =
Erlang VM) and hit this =E2=80=9Cweird behavior=E2=80=9D. We were using =
command=3Dyes 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 =E2=80=98yes=E2=80=99 (the =
executable) as our service. This problem happens no matter what the =
command is, as far as we can tell.

Cheers,
Adam

--
Adam Lindberg | Backend Engineer
Wooga GmbH | Saarbr=C3=BCcker 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=C3=B6ser, Jan Miczaika

> On 25 May 2016, at 15:27 , RW via freebsd-questions =
<freebsd-questions@freebsd.org> wrote:
>=20
> On Wed, 25 May 2016 14:13:47 +0100
> RW wrote:
>=20
>> 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=9Cstatus=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 script when
>>> trying to read the pidfile. =20
>>=20
>>=20
>>=20
>> This is strange because powerd.pid works without a newline.=20
>=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
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to =
"freebsd-questions-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E4F4D59F-1CA0-4A4C-9E76-4ADD988993CC>