标签:tin com red module roo 配置文件 etc mode super
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar -xf pip-9.0.1.tar.gz
cd pip-9.0.1
sudo python2 setup.py installpip2 -V
sudo pip2 install supervisor
echo_supervisord_conf > /etc/supervisord.conf
- root权限
root@iZ2zebwilv3xfcyr58ekbaZ:/home/txn/zgc/pip-9.0.1# sudo echo_supervisord_conf > /etc/supervisord.conf
Traceback (most recent call last):
File "/usr/local/bin/echo_supervisord_conf", line 7, in <module>
from supervisor.confecho import main
ImportError: No module named ‘supervisor‘
- sudo pip2 uninstall supervisor 卸载重新安装
- sudo pip2 install supervisor
root@iZ2zebwilv3xfcyr58ekbaZ:/home/txn/zgc/pip-9.0.1# sudo pip2 install supervisor
Collecting supervisor
Requirement already satisfied: meld3>=0.6.5 in /usr/local/lib/python2.7/dist-packages (from supervisor)
Installing collected packages: supervisor
Successfully installed supervisor-3.3.5
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.
root@iZ2zebwilv3xfcyr58ekbaZ:/home/txn/zgc/pip-9.0.1# echo_supervisord_conf > /etc/supervisord.conf
sudo vim /etc/supervisord.conf
[include]
files = /etc/supervisor/conf.d/*.conf
sudo mkdir -p /etc/supervisor/conf.d/
sudo vim /etc/supervisor/conf.d/mod_demo.conf
[program:mod_demo]
directory = /opt/model_for_demo
command = /usr/bin/python3 grpc_server.py
autostart = true
startsecs = 10
autorestart = true
startretries = 3
user = root
redirect_stderr = true
stdout_logfile_maxbytes = 20MB
stdout_logfile_backups = 5
stdout_logfile = /var/log/supervisor/mod_demo.log
environment=LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda-9.0/lib64:
注: 程序运行失败时,提示缺少环境变量,使用environment 配置
创建log路径
sudo mkdir -p /var/log/supervisor
sudo supervisord -c /etc/supervisord.conf
sudo supervisorctl reload
sudo supervisorctl status
查看运行进程
ps -ef | grep python
python2运行 supervisor
文献 http://www.koukousky.com/back/2091.html
标签:tin com red module roo 配置文件 etc mode super
原文地址:https://www.cnblogs.com/zgcblog/p/10192077.html