supervisor进程管理工具

supervisor是Linux/Unix系统下的一个进程管理工具。

  supervisor模块管理项目:

    1.物理环境中下载supervisor模块

      pip3 install supervisor

    2.手动创建supervisor的配置文件

      echo_supervisord_conf > /etc/supervisor.conf

    3.编辑配置文件/etc/supervisor.conf,写入管理crm01的任务参数

      [program:crm01]

      command=/root/Envs/crm_env3/bin/uwsgi --ini /opt/djangoprojects/crm01/uwsgi.ini

      stopasgroup=true ;默认为false,进程被杀死时,是否向这个进程组发送stop信号,包括子进程

      killasgroup=true ;默认为false,向进程组发送kill信号,包括子进程 

    4.启动supervisor,去管理uwsgi

    注意注释掉uwsgi.conf中的daemonize = uwsgi.log日志配置,uwsgi不运行

    supervisord -c /etc/supervisor.conf #指定配置文件,启动这个服务

    5.通过supervisorctl管理命令,管理uwsgi

      supervisorctl -c /etc/supervisor.conf 

        status all 

        start s20nbcrm

        stop s20nbcrm

        stop all

  

 

原文地址:https://www.cnblogs.com/open-yang/p/11256158.html