[CalendarServer-changes] [1281]
CalendarServer/trunk/twistedcaldav/tap.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Feb 27 15:19:06 PST 2007
Revision: 1281
http://trac.macosforge.org/projects/calendarserver/changeset/1281
Author: tfitz at apple.com
Date: 2007-02-27 15:19:06 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
Added SIGHUP handler to temporarily workaround twistd issue.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/tap.py
Modified: CalendarServer/trunk/twistedcaldav/tap.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/tap.py 2007-02-27 20:34:16 UTC (rev 1280)
+++ CalendarServer/trunk/twistedcaldav/tap.py 2007-02-27 23:19:06 UTC (rev 1281)
@@ -481,4 +481,21 @@
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
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070227/c1c67a68/attachment.html
More information about the calendarserver-changes
mailing list