iT邦幫忙

0

supervisor 管理 虛擬環境下套件遇到的問題

之前已經成功過用supervisor調用 虛擬環境下的uwsgi和 celery
但是換一台電腦後卻不知問題出在哪裡
一直抓不到虛擬環境
以下是原本電腦成功的配置

; supervisor config file
[inet_http_server]
port=127.0.0.1:9001
username=user
password=123

[supervisorctl]
[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0777                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

[include]
files = /etc/supervisor/conf.d/*.conf



[program:uwsgi-savemoney]
environment=PATH="/home/ivankao/Django/owner/savemoneyenv2/bin",VIRTUAL_ENV="/home/ivankao/Django/owner/savemoneyenv2/savemoney/",PYTHONPATH="/home/ivankao/Django/owner/savemoneyenv2/lib/python:/home/ivankao/Django/owner/savemoneyenv2/lib/python3.6/site-packages"

directory=/home/ivankao/Django/owner/savemoneyenv2/savemoney
command=uwsgi --ini uwsgi.ini
numprocs=1          
autostart=true       
autorestart=true    
stopsignal=INT
stdout_logfile=/home/ivankao/Django/owner/savemoneyenv2/savemoney/site_out.log
stderr_logfile=/home/ivankao/Django/owner/savemoneyenv2/savemoney/site_err.log
stopsignal=QUIT
killasgroup=true

uwsgi裝在 savemoneyenv2 中
我可以這樣子調用

environment=PATH="/home/ivankao/Django/owner/savemoneyenv2/bin",VIRTUAL_ENV="/home/ivankao/Django/owner/savemoneyenv2/savemoney/",PYTHONPATH="/home/ivankao/Django/owner/savemoneyenv2/lib/python:/home/ivankao/Django/owner/savemoneyenv2/lib/python3.6/site-packages"
directory=/home/ivankao/Django/owner/savemoneyenv2/savemoney
command=uwsgi --ini uwsgi.ini

但是裝在另一台
一樣的配置,路徑也沒什麼問題都照著原本的做修改
卻一直出現錯誤
command 會找不到 uwsgi

froce iT邦大師 1 級 ‧ 2018-09-10 09:52:04 檢舉
把兩台裡面的幾個你自設的環境變數,ls出來比對看看吧。

尚未有邦友回答

立即登入回答