[Freeipa-devel] [PATCH] Make child processes exit when parent dies

Dmitri Pal dpal at redhat.com
Wed Aug 5 22:25:48 UTC 2009


Jakub Hrozek wrote:
> The attached patch addresses ticket #84.
>
> The implementation is unfortunately Linux-specific as it uses the
> prctl(2) syscall. Ideas how to accomplish this in a cross-platform
> manner are welcome.
>
>     Jakub
How do we fork processes?
If we just fork and do not daemonize then children should just die
(system sends sigterm to children AFAIR) when the parent process exits.
At least that is what used to happen in old days on Solaris, HP and AIX.
If we fork and then make the process a new process group leader by using
setpgrp() then it terns into a service. It PPID becomes 1 (AFAIR - have
done it many years ago).
If our children are independent processes there is no good way other
than pass in the IP of the parent at the initialization and periodically
check if the process is still around and its start time is before child's.

If the problem we are trying to solve is to exit back ends when monitor
dies we should either keep the children as members of the same group or
use the periodic check approach.

-------------------------

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel at redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the Freeipa-devel mailing list