[Zodb-checkins] CVS: Zope/lib/python/zdaemon - SignalPasser.py:1.3

Chris McDonough chrism@zope.com
Sat, 15 Jun 2002 00:16:49 -0400


Update of /cvs-repository/Zope/lib/python/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv1891

Modified Files:
	SignalPasser.py 
Log Message:
Remove pass_signals_to_process in favor of calling SignalPasser one-at-a-time in zdaemon.


=== Zope/lib/python/zdaemon/SignalPasser.py 1.2 => 1.3 ===
 """ A module used for passing signals to children """
 
+import os, sys, signal
+
 class SignalPasser:
     def __init__(self, pid):
         self.pid = pid
 
     def __call__(self, signum, frame):
-        import os, sys, signal
+        # send the signal to our child
         os.kill(self.pid, signum)
+        # we want to die ourselves if we're signaled with SIGTERM or SIGINT
         if signum in [signal.SIGTERM, signal.SIGINT]:
             sys.exit(0)
 
-def pass_signals_to_process(pid, signals):
-    import signal
-    for s in signals:
-        signal.signal(s, SignalPasser(pid))