1.yum安装
# yum install epel-release
# yum install -y supervisor
# systemctl enable supervisord # 开机自启动
# systemctl start supervisord # 启动supervisord服务
# systemctl status supervisord # 查看supervisord服务状态
# ps -ef|grep supervisord # 查看是否存在supervisord进程
2.修改配置文件
/etc/supervisord.conf
在/etc/supervisord/添加配置*.ini文件
3.ini配置文件
[program:receive_cloud]
directory = /data/www/sync_queue
command= php receive_biz_cloud.php
process_name=%(program_name)s ; process_name expr (default %(program_name)s)
autostart=true
#startretries=10
exitcodes=0
#stopsignal=QUIT
stopwaitsecs=10
redirect_stderr=true
stderr_logfile=/var/log/php/receive_cloud.log
stdout_logfile=/var/log/php/receive_cloud.log域名
4.基本操作
supervisorctl reload 全部重启
supervisorctl update 新添加ini文件更新配置
supervisorctl reread 更新配置文件
supervisorctl start projectname 启动项目
supervisorctl restart projectname 重启项目
supervisorctl stop projectname 关闭项目
supervisorctl status 进程底下所有能应用的进程