Question

Currenty I install supervisord system-wide on Ubuntu with apt-get install supervisor. All my projects are inside virtualenvs, so system-wide Python is not really used for anything.

Is it possible to install supervisor inside my virtualenvs? Can I run multiple instances?

Was it helpful?

Solution

Yes. You can first setup a virtualenv and then install supervisor use pip.

virtualenv env
cd env
./bin/pip install supervisor

create configuration file:

echo_supervisord_conf > /path_to_configuration_file/supervisord.conf

You can run multiple instances, just use different port supervisord listen on in configuration file:

port=127.0.0.1:9001

OTHER TIPS

Yes you can, even when supervisor is not installed system-wide.

Go to your virtualenv directory and activate your env. Then install supervisor using pip:

pip install supervisor

After its successfull installation, run:

which supervisord

Here you can see the path of supervisord command which will be inside your virtualenv only.

Now the most important part. When you run 'supervisord' command it will look for config file whose default location is: /etc/supervisord.conf

But in case supervisor is installed only in virtualenv it will throw an error like this :

Error: No config file found at default paths.

Now to run supervisor you need to create your own config file for supervisor and specify its path when running it. To do that, first run:

echo_supervisord_conf > supervisord.conf

This will create a default supervisor config file in your current working directory. Configure your supervisord.conf file (see http://supervisord.org/configuration.html), and then run supervisor using '-c' option:

supervisord -c supervisord.conf

Source: http://supervisord.org/installing.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top