[systemd-devel] GuessMainPID=no required to make daemon reload work
Kirill Elagin
kirelagin at gmail.com
Sun May 4 23:26:33 PDT 2014
OK, I've just re-read your message and it looks like all you need is add
`PIDFile` to your unit.
systemd will behave as expected: once your main process terminates it will
re-read PID
from this file (assuming that before dying your old process writes its
child's PID) and
set it as MAINPID for your service.
`GuessMainPID` becomes useless, and will actually be ignored, as the man
says.
But again, if your daemon is not writing a pidfile now, this way is not
“without changing the daemon itself first”. I'm not sure you can make it
work
reliably otherwise.
--
Кирилл Елагин
On Mon, May 5, 2014 at 2:03 AM, Gerd v. Egidy <lists at egidy.de> wrote:
> Hi Кирилл,
>
> > Have you looked into using sd_notify to update MAINPID?
>
> No, not yet. I have sd_notify on my list of things to look at in the
> future,
> but I wanted to make the service work without changing the daemon itself
> first.
>
> Thanks for the hint about this possibility.
>
> Kind regards,
>
> Gerd
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140505/0b784a75/attachment-0001.html>
More information about the systemd-devel
mailing list