安装使用

在 Ubuntu 上可以使用apt-get install supervisor,在 CentOS 上可以使用yum install supervisor。但这些基于源的方式安装,可能版本比较老。所以推荐使用easy_install安装:@H_262_28@

easy_install supervisor

 @H_262_28@

生成配置文件:@H_262_28@

echo_supervisord_conf > /etc/supervisord.conf

 @H_262_28@

安装完后,主要有3个命令,分别是:@H_262_28@

修改/etc/supervisord.conf,引入程序配置文件:@H_262_28@

[include]
files = /etc/supervisord/*.conf

 @H_262_28@

程序配置示例

[program:demo]
directory = /opt/soft/demo/
command = /opt/soft/demo/demo
autostart = true
autorestart = true
startsecs = 5
user = upfor
redirect_stderr = true
stdout_logfile = /var/log/supervisord/stdout.demo.log
stdout_logfile_maxbytes = 1MB
stdout_logfile_BACkups = 10
stdout_capture_maxbytes = 1MB
stderr_logfile = /var/log/supervisord/stderr.demo.log
stderr_logfile_maxbytes = 1MB
stderr_logfile_BACkups = 10
stderr_capture_maxbytes = 1MB

 @H_262_28@