joh*_*n2x 6 python virtualenv supervisord
我supervisord.conf包含了一堆这样的程序:
[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true
[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
Run Code Online (Sandbox Code Playgroud)
但有时当我重新启动supervisord时,我得到了
can't find command venv/bin/gtaskqueue_puller
Run Code Online (Sandbox Code Playgroud)
但是当我cd进入目录并运行相同的命令时,它按预期工作.
有时,即使设置了目录,管理员也无法找到具有相对路径的命令.
所以使用:
[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true
[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
Run Code Online (Sandbox Code Playgroud)
而不是:
[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true
[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4435 次 |
| 最近记录: |