<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">James Y Knight <<a href="mailto:foom@fuhm.net">foom@fuhm.net</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">October 13, 2010 7:20:20 PM GMT+02:00<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: [Twisted-Python] _twistd_unix.py / daemonize() / OSX / USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Reply-To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br></span></div><br><div><br>On Oct 13, 2010, at 12:05 PM, Erik van Blokland wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Oct 13, 2010, at 5:52 PM, Phil Mayers wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Other info indicates this is Apple trying to be clever and "protect" <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">applications from some signal handling issues surrounding fork() with <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">libraries which aren't safe in that situation; presumably these are <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">MacOS-specific libraries?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">If this really is true, then MacOS X is no longer posix-compliant in <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">those circumstances, and Twisted is going to need some work :o(<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Can you share more details about the application; the context in which <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">it is started, and which system libraries it's likely to load?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Here's a compact version. The script uses OSX' Quartz to create and manipulate images. Twisted is used to wrap it as a webserver, images are served. More pointers on how to start and use it in the script itself.<br></blockquote><br>You need to avoid using or importing any OSX APIs until after the daemonization has occurred. Unfortunately, twisted executes the entire script file before daemonizing. [that's unfortunate for other reasons besides this, too]<br><br>Here's a corrected version of your script which works properly. It defers importing Quartz until the reactor is running, by moving it into a function called by reactor.callWhenRunning().<br><br></div></blockquote></div></body></html>