Python3中使用circus守护进程

Python3中使用circus守护进程(Daemon,替代python2中supervisor的功能)

1、安装环境

    On CentOS systems: 

    $ sudo yum install libzmq-dev libevent-dev python-dev python-virtualenv

2、创建环境目录

    Create a virtualenv and install circuscircus-web and chaussette in it 

    $ virtualenv /tmp/circus

    $ cd /tmp/circus

    $ bin/pip install circus

    $ bin/pip install circus-web

    $ bin/pip install chaussette

3、进入/tmp/circus

4、创建circus.ini配置文件,并写入以下内容(本次运行的程序内容)

    [watcher:myprogram]

    cmd = python path/to/your/program

5、使用netstat -ano | grep 5000查看(当前pngserver.py开的是5000端口)

6、其他内容:

    使用 circusctl shell 命令查看运行状态:

    $ bin/circusctl

    circusctl 0.7.1

    circusd-stats: active

    (circusctl)

7、You get into an interactive shell. Type help to get all commands:

(circusctl) help


8、参考文档

初识Circus:http://hbin.me/blog/2015/05/22/circus-tutorial/

Installing Circus:https://circus.readthedocs.io/en/latest/installation/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容