Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added SIGHUP handler to temporarily workaround twistd issue.

  • Loading branch information
Timothy Fitz
Timothy Fitz committed Feb 27, 2007
1 parent eab0f35 commit 8b183d5d4cdbc68ad34c9007eb69aced636cf166
Showing with 18 additions and 1 deletion.
  1. +18 −1 twistedcaldav/tap.py
@@ -481,4 +481,21 @@ def makeService(self, options):
raise UsageError("Unknown server type %s. Please choose: Master, Slave or Combined"
% (serverType,))
else:
return serviceMethod(options)
service = serviceMethod(options)

# Temporary hack to work around SIGHUP problem
# If there is a stopped process in the same session as the calendar server
# and the calendar server is the group leader then when twistd forks to drop
# privelages a SIGHUP may be sent by the kernel. This SIGHUP should be ignored.
# Note that this handler is not unset, so any further SIGHUPs are also ignored.
import signal
def sighup_handler(num, frame):
if frame is None:
location = "Unknown"
else:
location = str(frame.f_code.co_name) + ": " + str(frame.f_lineno)
log.msg("SIGHUP recieved at " + location)
signal.signal(signal.SIGHUP, sighup_handler)

return service

0 comments on commit 8b183d5

Please sign in to comment.
You can’t perform that action at this time.