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 <[email protected]> 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
>
>
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to