From: Leandro Lucarella Date: Tue, 13 Nov 2007 18:22:10 +0000 (-0300) Subject: Handle SIGCHLD in PyminDaemon. X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/22230ef4bb6dc80d2dca8d5a128f208fff72c181?ds=inline;hp=--cc Handle SIGCHLD in PyminDaemon. --- 22230ef4bb6dc80d2dca8d5a128f208fff72c181 diff --git a/pymin/pymindaemon.py b/pymin/pymindaemon.py index ccb943d..3881857 100644 --- a/pymin/pymindaemon.py +++ b/pymin/pymindaemon.py @@ -15,6 +15,7 @@ from pymin.dispatcher import handler from pymin import dispatcher from pymin import eventloop from pymin import serializer +from pymin import procman class PyminDaemon(eventloop.EventLoop): r"""PyminDaemon(root, bind_addr) -> PyminDaemon instance @@ -58,12 +59,15 @@ class PyminDaemon(eventloop.EventLoop): def timer(loop, signum): loop.handle_timer() signal.alarm(loop.timer) + def child(loop, signum): + procman.sigchild_handler(signum) # Create EventLoop eventloop.EventLoop.__init__(self, sock, signals={ signal.SIGINT: quit, signal.SIGTERM: quit, signal.SIGUSR1: reload_config, signal.SIGALRM: timer, + signal.SIGCHLD: child, }) # Create Dispatcher #TODO root.pymin = PyminHandler()