supervisord在virtualenv文件夹中找不到命令

时间:2013-04-23 13:59:45

标签: 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

但有时当我重新启动supervisord时,我会

can't find command venv/bin/gtaskqueue_puller

但当我cd进入目录并运行相同的命令时,它按预期工作。

1 个答案:

答案 0 :(得分:7)

即使设置了目录,有时主管也无法找到具有相对路径的命令。

所以使用:

[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

而不是:

[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