xyx*_*yxc 7 django nginx supervisord django-supervisor
我使用 uwsgi?supervisor 和 nginx 部署我的 django 项目。但是我已经在/etc/supervisord.conf 中添加了我的程序,就像上面一样。
[program:JZAssist]
command=-E uwsgi --ini /home/work/xxxx/uwsgi.ini
directory=/home/work/xxxx
startsecs=0
stopwaitsecs=0
autostart=true
autorestart=true
Run Code Online (Sandbox Code Playgroud)
我的 uwsgi.ini 内容是:
[uwsgi]
socket = :8000
chdir = /home/work/xxxx
module = xxxx.wsgi
master = true
processes = 4
vacuum = true
Run Code Online (Sandbox Code Playgroud)
xxxx 是我的项目名称。
我supervisorctl -c /etc/supervisord.conf restart all在cmd中运行。它显示
xxxx: ERROR (no such file)
Run Code Online (Sandbox Code Playgroud)
/tmp/supervisord.log 部分内容:
2017-02-24 23:31:41,433 INFO gave up: JZAssist entered FATAL state, too many start retries too quickly
2017-02-24 23:52:29,940 WARN Failed to clean up '/tmp/JZAssist-stderr---supervisor-goPZyS.log'
2017-02-24 23:52:29,940 WARN Failed to clean up '/tmp/JZAssist-stdout---supervisor-WtfJcp.log'
2017-02-24 23:52:57,535 WARN Failed to clean up '/tmp/JZAssist-stderr---supervisor-goPZyS.log'
2017-02-24 23:52:57,535 WARN Failed to clean up '/tmp/JZAssist-stdout---supervisor-WtfJcp.log'
2017-02-24 23:52:57,541 INFO RPC interface 'supervisor' initialized
2017-02-24 23:52:57,541 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-02-24 23:52:57,542 INFO daemonizing the supervisord process
2017-02-24 23:52:57,543 CRIT could not write pidfile /tmp/supervisord.pid
2017-02-24 23:52:58,544 INFO spawnerr: can't find command '-E'
2017-02-24 23:52:59,546 INFO spawnerr: can't find command '-E'
2017-02-25 00:46:59,234 WARN Failed to clean up '/tmp/JZAssist-stderr---supervisor-goPZyS.log'
2017-02-25 00:46:59,234 WARN Failed to clean up '/tmp/JZAssist-stdout---supervisor-WtfJcp.log'
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它会报告这样的错误。我可以用runserver运行我的django项目。所以文件丢失了?
在您的command=线路上,您已指定要作为 运行的程序-E,主管找不到要执行的程序。
为作业创建文件时,命令行应该可以作为 shell 命令执行,并且不应该依赖给定 shell 的内部命令。例如,我遇到了一个以以下开头的问题:
source /path/to/python/virtual/environment/bin/activate && ...
但source它是内置的 bash。我需要将其更改为:
bash -c 'source /path/to/python/virtual/environment/bin/activate && ...
这样,supervisor 可以找到并运行的可执行文件是bash.
在您的情况下,似乎 uwsgi 应该是command=.
您提到您在-E运行时使用该标志来保留环境变量sudo,但主管不需要sudo
| 归档时间: |
|
| 查看次数: |
12828 次 |
| 最近记录: |