系統環境:redhat5.4/python
因爲須要安裝meld組件,因此須要至少python2.6以上版本,因而咱們先安裝python2.6,而後再安裝supervisorshell
下載supervisor安裝包(連接: https://pan.baidu.com/s/1nuTl95f 密碼: 9xd5)apache
#tar jxvf Python-2.6.6.tar.bz2 #cd Python-2.6.6. #./configure #make all #make install #make clean #make distclean #mv /usr/bin/python /usr/bin/python2.4 #ln -s /usr/local/bin/python2.6 /usr/bin/python #python -V
#unzip setuptools-36.4.0.zip #cd setuptools* #python setup.py install
#tar -xzvf elementtree-1.2.6-20050316.tar.gz #cd elem* #python setup.py install
# tar -xzvf meld3-1.0.2.tar.gz # cd meld* #python setup.py install
#tar -xzvf supervisor-3.0a12.tar.gz #cd supervisor* #python setup.py install
#mkdir -p /etc/supervisor/conf.d #echo_supervisord_conf > /etc/supervisord.conf
[include] files = /etc/supervisor/conf.d/*.conf
配置表示包括/etc/supervisor/conf.d/的全部conf文件tomcat
[program:tomcat] command=/opt/apache-tomcat-8.0.35/bin/catalina.sh run stdout_logfile=/opt/apache-tomcat-8.0.35/logs/catalina.out autostart=true autorestart=true user=app startsecs=5 priority=1 stopasgroup=true killasgroup=true
#supervisord -c /etc/supervisord.conf
殺死tomcat進程,查看是否進程自動重啓以及日誌狀況服務器
將安裝包中的supervisord文件拷到/etc/init.d/中app
cp supervisord /etc/init.d/
測試
加入開機啓動rest
chkconfig --add supervisord
日誌
查看開機啓動配置狀況code
chkconfig --list |grep supervisord
reboot