Getting an error while installing supervisord on ubuntu 11.04. Any way to fix this?

# 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

Not sure why it isn't able to find the supervisord config file or why installation is failing. I did run aptitude update, aptitude upgrade, so hopefully everything is up to date :(


Solution 1:

I've just stumbled across the same issue, so I'll leave the reasons it happened to me.

We had supervisor installed into the global path (not a virtualenv) using pip, which meant we were running the latest version. However, this is undesirable from a server maintenance point of view, so we switched the older version in Apt.

pip uninstall doesn't clear up after itself properly, leaving scripts/logs in all the following directories:

  • /usr/local/bin/
  • /usr/local/lib/python2.7/dist-packages/
  • /tmp/
  • /etc/

I suggest doing the following search and manually removing all references to supervisor-3.0a12:

sudo find / -iname "*supervisor*"