On Sat, May 30, 2009 at 06:17:54PM -0500, travis+ml-twis...@subspacefield.org wrote: > The problem I'm having is this; I upgraded my firewall from OpenBSD > 4.2 or so to OpenBSD 4.5, and now I'm working with newer versions of > all the software including Twisted. > > The program works fine normally, and can run in the background, but if I > invoke a daemonize() routine that turns it into a network daemon, it > refuses to serve incoming TCP connections. Actually the TCP connection > is made, but the software never responds to it. > > Specifically, my twisted.internet.protocol.Factory instance is created, > but buildProtocol is never called. > > Before I dive deeply into debugging the software, I thought I'd ask if > anyone knew off the top of their head any reason why Twisted might not > act the same if it was daemonized (no controlling terminal, no > stdin/out/err, forked as a background process).
I ran ktrace/kdump against the binary and it appears that python likes to open file handles to the script and certain modules for file descriptors 5-7 or so (depending on how much you import), and if you close those file descriptors, unusual things happen when python tries to access them. In the end I decided it was not important enough to close all the parent's file descriptors, and it runs fine as a deamon leaving them open. -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ If you are a spammer, please email j...@subspacefield.org to get blacklisted.
pgpnNEfNHEtwC.pgp
Description: PGP signature
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python