维护以前的系统, 上传了一个go二进制程序, 需要安装supervisor

下载安装

wget http://pypi.python.org/packages/source/s/supervisor/supervisor-3.0b1.tar.gz --no-check-certificate
tar -zxvf supervisor-3.0b1.tar.gz
cd supervisor-3.0b1
python setup.py install

# 最后显示:
# Using /usr/lib/python2.6/site-packages
# Finished processing dependencies for supervisor==3.0b1
# 表示成功

创建默认的配置文件

# 创建配置
echo_supervisord_conf > /etc/supervisord.conf
# 启动
supervisord -c /etc/supervisord.conf
# 查看状态 
supervisorctl status

开机启动

echo 'supervisord -c /etc/supervisord.conf' >> /etc/rc.local

进程模板

[program:abc]
command=/home/wwwroot/abc/main
directory=/home/wwwroot/abc
autostart=true
autorestart=true
startsecs=3
stderr_logfile=/home/wwwlogs/abc.log
stdout_logfile=/home/wwwlogs/abc.log