[Twisted-web] Different behavior of twistd with and without -n

Terry Jones terry at jon.es
Thu May 24 12:04:57 EDT 2007

>>>>> "JP" == Jean-Paul Calderone <exarkun at divmod.com> writes:
JP> A completely wild guess is that forking is confusing PyLucene in a
JP> fatal way.  Are you importing PyLucene in the .tac file itself?  If so,
JP> it may help to avoid doing this, so that no code from PyLucene even
JP> gets a chance to run until after the process has already daemonized.

Hi JP. Thanks for the suggestion.

Yes, the PyLucene import does happen as a result of an import in the .tac
file. I just made some changes to delay the import until PyLucene is
actually needed. That didn't work, and nor did further hiding the import by
using __import__.

Is it right that all the -n switch to twistd does is prevent the fork?


More information about the Twisted-web mailing list