[Zope-Checkins] SVN: Zope/trunk/ Avoid conflicting signal registrations when run under mod_wsgi. Allows the use of `WSGIRestrictSignal Off` (LP #681853).
Hanno Schlichting
hannosch at hannosch.eu
Mon Oct 31 22:44:54 UTC 2011
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.
More information about the Zope-Checkins
mailing list