I have a simple web server written in Twisted, and I\'m trying to start it up daemonized with twistd. Everything works fine with reactor.run()
General UNIX wisdom is that searching the working directory for things to execute when root is a bad idea. The argument goes that it opens the door to trojans. In not going out of its way to add the working directory to the Python module import search path when running as root, twistd is basically trying to follow this wisdom.
As another commenter said, you can explicitly set PYTHONPATH yourself to include the directories which contain the code your app needs.
You can also skip running as root entirely and use authbind
to bind low-numbered ports without having superuser privileges. This is how all of my servers are deployed.