[SSSD] [PATCH] MONITOR: use sigchld handler for monitoring SSSD services

Stephen Gallagher sgallagh at redhat.com
Thu Dec 15 03:06:38 UTC 2011


This patch depends on the SIGCHLD patches currently under review. This
is the first consumer of those patches, and therefore can be used to
test them.

This changes the behavior of the monitor's child-monitoring code to use
the new sigchld handler. It also replaces some useless loop-checks that
we were doing to verify that the process was still up using waitpid().
It's less wasteful to simply rely on SIGCHLD.

I also revamped the restart logic so that now it will always restart
when the SIGCHLD handler is hit. To that end, I changed it so that the
ping timeout limit would kill the PID (thereby triggering the SIGCHLD
handler to take over).

Finally, I also added a 60s timer on monitor_kill_service() so that it
will send a SIGKILL to the process if it hasn't exited gracefully a
minute after receiving SIGTERM. This is probably the most controversial
piece of this patch. In theory, if we SIGKILL during an
ldb_transaction_commit(), we could end up with corrupted data in the LDB
cache. But I think that if we're still writing after 60s, we have bigger
issues to address. I'm certainly willing to entertain counter-arguments
here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-MONITOR-use-sigchld-handler-for-monitoring-SSSD-serv.patch
Type: text/x-patch
Size: 14123 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20111214/97fac1b8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20111214/97fac1b8/attachment.sig>


More information about the sssd-devel mailing list