Docker, Supervisor and Executive Director

I am trying to centralize the output from supervisord and its processes using supervisor-stdout . But with this supervisor configuration:

 #supervisord.conf [supervisord] nodaemon = true [program:nginx] command = /usr/sbin/nginx stdout_events_enabled = true stderr_events_enabled = true [eventlistener:stdout] command = supervisor_stdout buffer_size = 100 events = PROCESS_LOG result_handler = supervisor_stdout:event_handler 

(Note that the configuration section of supervisor-stoud is exactly the same as in the example on supervisor-stoud ).

... and this Docker file:

 #Dockerfile FROM python:3-onbuild RUN apt-get update && apt-get install -y nginx supervisor # Setup supervisord RUN pip install supervisor-stdout RUN mkdir -p /var/log/supervisor COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY nginx.conf /etc/nginx/nginx.conf # restart nginx to load the config RUN service nginx stop # Start processes CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf -n 

I can create the image just fine, but running the container from it gives me:

Error: supervisor_stdout: event_handler could not be resolved in [eventlistener: stdout]

EDIT

The result of work:

supervisord -c / etc / supervisor / conf.d / supervisord.conf -n

is an:

 Error: supervisor_stdout:event_handler cannot be resolved within [eventlistener:stdout] For help, use /usr/bin/supervisord -h 
+6
source share
3 answers

I had the same problem and decided to use it with Ubuntu 14.04 as the base image instead of Debian Jessie (I used python:2.7 image based on Jessie).

You can refer to this full working implementation: https://github.com/rehabstudio/docker-gunicorn-nginx .

EDIT: as @ Vin-G pointed out in his comment, perhaps because the supervisor version shipped with Debian Jessie is too old. You can try to remove it from apt and install it with pip.

+1
source

I had the same problem, in short, you need to install the Python package which provides the supervisor_stdout:event_handler . You should be able to by running the following commands:

 apt-get install -y python-pip pip install supervisor-stdout 

If you have pip installed on this container, simply:

pip install supervisor-stdout should be enough, more information about this particular package can be found here:

https://pypi.python.org/pypi/supervisor-stdout

AFAIK, there is no debian package that the supervisor-stdout provides, so the easiest way to install it is through pip.

Hope this helps someone who comes here like me.

[Edit] As Vin-G suggested, if you still have a problem, even after going through these steps, the supervisor may be stuck in the old version. Try updating it.

Hooray!

+7
source

Very similar to the above, but I do not think there is a complete answer.

I had to remove from apt

 apt-get remove supervisor 

Then reinstall using pip, but with pip2 since the current version of the supervisor does not support python 3

 apt-get install -y python-pip pip2 install supervisor pip2 install supervisor-stdout 

It all worked.

Although the super-preservation path is now

 /usr/local/bin/supervisord 

Hope this helps.

+1
source

Source: https://habr.com/ru/post/985651/


All Articles