le_backups=10 ;
stderr_logfile=/home/www/go/wx-prj.stderr.log ;打印标准错误输出日志
stderr_logfile_maxbytes=20MB ;
stderr_logfile_backups=10 ;
log_stdout=true ; if true, log program stdout (default true)
log_stderr=true ; if true, log program stderr (def false)
四、启动supervisor服务
supervisord -c /etc/supervisord.conf
启动服务时可以跟踪日志输出观察
[root@10-23-67-69 go]# tail -f /var/log/supervisor/supervisord.log
2018-10-26 13:36:30,881 INFO Included extra file "/etc/./supervisor/conf.d/wx-prj.ini" during parsing
2018-10-26 13:36:30,902 INFO RPC interface 'supervisor' initialized
2018-10-26 13:36:30,902 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2018-10-26 13:36:31,203 INFO RPC interface 'supervisor' initialized
2018-10-26 13:36:31,203 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2018-10-26 13:36:31,206 INFO daemonizing the supervisord process
2018-10-26 13:36:31,207 INFO supervisord started with pid 17040
2018-10-26 13:36:32,209 INFO spawned: 'hello' with pid 17041
2018-10-26 13:36:32,213 INFO spawned: 'wx-prj' with pid 17042
2018-10-26 13:36:32,219 INFO spawned: 'world' with pid 17043
2018-10-26 13:36:33,279 INFO success: hello entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-10-26 13:36:33,279 INFO success: wx-prj entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-10-26 13:36:33,279 INFO success: world entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
也通过命令查看程序状态
[root@10-23-67-69 conf.d]# supervisorctl status
hello RUNNING pid 17041, uptime 0:00:19
world RUNNING pid 17043, uptime 0:00:19
wx-prj RUNNING pid 17042, uptime 0:00:19
五、重载supervisor修改过的配置
supervisorctl reload
六、停止/启动/重启supervisor管理的程序
[root@10-23-67-69 conf.d]# supervisorctl stop wx-prj
wx-prj: stopped
[root@10-23-67-69 conf.d]# supervisorctl start wx-prj
wx-prj: started
[root@10-23-67-69 conf.d]# supervisorctl restart wx-prj
wx-prj: stopped
wx-prj: started
[root@10-23-67-69 conf.d]# supervisorctl stop all
hello: stopped
wx-prj: stopped
world: stopped
[root@10-23-67-69 conf.d]# supervisorctl start all
hello: started
wx-prj: started
world: started