在 ubuntu 11.04 上安装 Supervisord 时出错。有什么办法可以解决吗?

在 ubuntu 11.04 上安装 Supervisord 时出错。有什么办法可以解决吗?
# aptitude install supervisor
The following NEW packages will be installed:
  python-medusa{a} python-meld3{a} supervisor 
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/290 kB of archives. After unpacking 1,552 kB will be used.
Do you want to continue? [Y/n/?] Y
Selecting previously deselected package python-medusa.
(Reading database ... 35128 files and directories currently installed.)
Unpacking python-medusa (from .../python-medusa_0.5.4+clean-2ubuntu1_all.deb) ...
Selecting previously deselected package python-meld3.
Unpacking python-meld3 (from .../python-meld3_0.6.5-3build1_amd64.deb) ...
Selecting previously deselected package supervisor.
Unpacking supervisor (from .../supervisor_3.0a8-1_all.deb) ...
Processing triggers for ureadahead ...
Setting up python-medusa (0.5.4+clean-2ubuntu1) ...
Setting up python-meld3 (0.6.5-3build1) ...
Setting up supervisor (3.0a8-1) ...
Starting supervisor: /usr/bin/supervisord:5: UserWarning: Module supervisor was already     imported from None, but /usr/lib/pymodules/python2.7 is being added to sys.path
  from pkg_resources import load_entry_point
Error: No config file found at default paths (/usr/etc/supervisord.conf,     /usr/supervisord.conf, supervisord.conf, etc/supervisord.conf, /etc/supervisord.conf); use the     -c option to specify a config file at a different path
For help, use /usr/bin/supervisord -h
invoke-rc.d: initscript supervisor, action "start" failed.
dpkg: error processing supervisor (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Processing triggers for python-support ...
Errors were encountered while processing:
 supervisor
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up supervisor (3.0a8-1) ...
Starting supervisor: /usr/bin/supervisord:5: UserWarning: Module supervisor was already   imported from None, but /usr/lib/pymodules/python2.7 is being added to sys.path
  from pkg_resources import load_entry_point
Error: No config file found at default paths (/usr/etc/supervisord.conf,      /usr/supervisord.conf, supervisord.conf, etc/supervisord.conf, /etc/supervisord.conf); use the           -c option to specify a config file at a different path
For     help, use /usr/bin/supervisord -h
invoke-rc.d: initscript supervisor, action "start" failed.
dpkg: error processing supervisor (--configure):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for python-support ...
Errors were encountered while processing:
 supervisor

不确定为什么找不到supervisord配置文件或安装失败。我确实运行了aptitude update、aptitude upgrade,所以希望一切都是最新的:(

答案1

我刚刚遇到了同样的问题,所以我将说明发生此问题的原因。

我们使用 pip 将 Supervisor 安装到全局路径(而不是虚拟环境),这意味着我们运行的是最新版本。但是,从服务器维护的角度来看,这是不可取的,因此我们在 Apt 中切换了旧版本。

pip uninstall无法正确清理,在以下所有目录中留下脚本/日志:

  • /usr/本地/bin/
  • /usr/local/lib/python2.7/dist-packages/
  • /tmp/
  • /ETC/

我建议进行以下搜索并手动删除所有引用主管-3.0a12

sudo find / -iname "*supervisor*"

答案2

有趣。这是一个目前未知的错误。安装时,您应该会收到不同的错误,因为此版本的 Ubuntu 中的主管目前已损坏。请参阅错误报告:https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/777862

答案3

管理员可能之前安装过,然后删除了但没有清除(因此配置文件没有被删除)。后来有人手动删除了配置文件。现在,当您重新安装时,它不会默认替换配置文件,因为 dpkg 永远不会覆盖您所做的配置更改,而删除配置文件被视为配置更改。您可以像这样专门告诉 dpkg 替换丢失的配置文件:

aptitude -o DPkg::Options::='--force-confmiss' reinstall supervisor

或者,您可以在安装之前清除包,表示您不想保存配置文件。

相关内容