[fpc-pascal] respawn a daemon in Linux
Michael Schnell
mschnell at lumino.de
Tue Jan 14 11:42:01 CET 2014
On 01/14/2014 11:26 AM, Mark Morgan Lloyd wrote:
>
> Does it exit in a sufficiently-controlled state
Yep. If nothing completely unexpected happens, it writes a message in a
log file and cleanly exits. Of course there _might_ be memory leaks, an
unexpected kill signal or other queer stuff that could kill the
application.
> that you could simply exec a new copy at the end of the finalization
> block?
Using SysUtils.ExecuteProcess ? Do you think that this will work
cleanly, even though the dying process would be the parent of the new
one ? AFAIR, Linux performs a "reparent" at this point and assign the
grand-parent. So it really might work.
Is the finalization block executed even when a "nasty" exception like
"kill signal", "nonexisting address", or "division by zero" happens ?
> The available parameters should be accessible in /proc.
>
Yep. In fact I would need a parameter that activates this feature, so
that the program also can be run normally. No problem here.
-Michael
More information about the fpc-pascal
mailing list