[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cvs
Subject:    [Zope-Checkins] SVN: Zope/trunk/ Avoid conflicting signal
From:       Hanno Schlichting <hannosch () hannosch ! eu>
Date:       2011-10-31 22:44:54
Message-ID: 20111031224454.73D18B0F66 () cvs ! zope ! org
[Download RAW message or body]

Log message for revision 123220:
  Avoid conflicting signal registrations when run under mod_wsgi. Allows the use of \
`WSGIRestrictSignal Off` (LP #681853).  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/Signals/Signals.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2011-10-31 22:07:55 UTC (rev 123219)
+++ Zope/trunk/doc/CHANGES.rst	2011-10-31 22:44:53 UTC (rev 123220)
@@ -11,6 +11,9 @@
 Bugs Fixed
 ++++++++++
 
+- Avoid conflicting signal registrations when run under mod_wsgi.
+  Allows the use of `WSGIRestrictSignal Off` (LP #681853).
+
 - Make it possible to use WSGI without repoze.who.
 
 - Fixed serious authentication vulnerability in stock configuration.

Modified: Zope/trunk/src/Signals/Signals.py
===================================================================
--- Zope/trunk/src/Signals/Signals.py	2011-10-31 22:07:55 UTC (rev 123219)
+++ Zope/trunk/src/Signals/Signals.py	2011-10-31 22:44:53 UTC (rev 123220)
@@ -108,11 +108,20 @@
 
     if not SignalHandler:
         return
-    SignalHandler.registerHandler(SIGTERM, shutdownFastHandler)
-    SignalHandler.registerHandler(SIGINT, shutdownHandler)
+
+    mod_wsgi = True
+    try:
+        from mod_wsgi import version
+    except ImportError:
+        mod_wsgi = False
+
+    if not mod_wsgi:
+        SignalHandler.registerHandler(SIGTERM, shutdownFastHandler)
+        SignalHandler.registerHandler(SIGINT, shutdownHandler)
     if os.name != 'nt':
-        SignalHandler.registerHandler(SIGHUP, restartHandler)
-        SignalHandler.registerHandler(SIGUSR1, showStacks)
+        if not mod_wsgi:
+            SignalHandler.registerHandler(SIGHUP, restartHandler)
+            SignalHandler.registerHandler(SIGUSR1, showStacks)
         SignalHandler.registerHandler(SIGUSR2, LogfileReopenHandler(loggers))
     else:
         # no restart handler on windows.

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic