What is the de facto library for creating Python Daemons

流过昼夜 提交于 2019-12-02 20:23:56
Marcus Whybrow

I went with Sander Marechal's A simple unix/linux daemon in Python, it is simple, and you work with it by creating a subclass and overriding the run() method, which feels a very natural way to do things (rather than the with context: approach of the python-daemon module.

Twisted comes with twistd.

http://twistedmatrix.com/documents/current/core/howto/basics.html

You can wrap your application as a plugin for twistd.

For making a daemon program that will work correctly with the various runners in operating systems (e.g. init, systemd, launchd), the python-daemon library is the de facto way to write just the daemon part and let the operating system do the rest of the job correctly.

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