Running twistd as root, modules aren't found

别来无恙 提交于 2019-12-01 19:03:02

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!