安装
go get -v -u github.com/ochinchina/supervisord
go build github.com/ochinchina/supervisord
配置
[supervisord]
logfile=/var/log/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=debug
pidfile=/tmp/supervisord.pid
[inet_http_server]
port=127.0.0.1:9001
[program:test]
command=/root/test
autostart=true
autorestart=true
startsecs=2
startretries=3
stopwaitsecs=5
;stopsignal=KILL
stdout_logfile=/root/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
redirect_stderr=true
管理:
supervisord -d -c supervisord.conf
supervisord ctl status
supervisord ctl start test
supervisord ctl shutdown
标签:none