【问题标题】:supervisord can't find command in virtualenv foldersupervisord 在 vi​​rtualenv 文件夹中找不到命令
【发布时间】:2013-04-23 13:59:45
【问题描述】:

我的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 进入目录并运行相同的命令时,它按预期工作。

【问题讨论】:

  • 你能提供 venv/bin 的绝对路径吗? supervisor conf 提供directory 指令supervisord.org/configuration.html
  • 是的,我已经设置了directory 选项。刚刚尝试在命令中使用完整路径,它正在工作。很奇怪。
  • 我可以看到相同的行为 - 有时即使设置了目录,主管也无法找到具有相对路径的命令,您可以手动从该目录运行命令。

标签: python virtualenv supervisord


【解决方案1】:

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

所以使用:

[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

【讨论】:

    猜你喜欢
    • 2016-04-03
    • 1970-01-01
    • 1970-01-01
    • 2021-02-21
    • 1970-01-01
    • 1970-01-01
    • 2013-09-13
    • 1970-01-01
    • 2018-11-08
    相关资源
    最近更新 更多