]> git.llucax.com Git - software/pymin.git/commitdiff
Handle SIGCHLD in PyminDaemon.
authorLeandro Lucarella <llucax@gmail.com>
Tue, 13 Nov 2007 18:22:10 +0000 (15:22 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Tue, 13 Nov 2007 18:22:10 +0000 (15:22 -0300)
pymin/pymindaemon.py

index ccb943dd48d4ebcd030c5a12aa94b9f3ebb853a1..3881857ea29c93d8276e5af33667900a08c1f510 100644 (file)
@@ -15,6 +15,7 @@ from pymin.dispatcher import handler
 from pymin import dispatcher
 from pymin import eventloop
 from pymin import serializer
 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
 
 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 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,
         # 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()
             })
         # Create Dispatcher
         #TODO root.pymin = PyminHandler()