Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid conflicting signal registrations when run under mod_wsgi. Allow…

…s the use of `WSGIRestrictSignal Off` (LP #681853).

svn path=/Zope/trunk/; revision=123220
  • Loading branch information...
commit 55e046f6e140fa8fa73377412645d9d18e17cef9 1 parent 145c5d6
@hannosch hannosch authored
Showing with 16 additions and 4 deletions.
  1. +3 −0  doc/CHANGES.rst
  2. +13 −4 src/Signals/Signals.py
View
3  doc/CHANGES.rst
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
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.
View
17 src/Signals/Signals.py
@@ -108,11 +108,20 @@ def registerZopeSignals(loggers):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.