Получение ошибки при попытке запустить скрипт gunicorn через супервизора.
Скрипт gunicorn работает нормально при запуске напрямую.
Я на Ubuntu 16.04
версия супервизора:
Получение
pkg_resources.DistributionNotFound: The 'supervisor==3.2.0' distribution was not found and is required by the application
во время работы
sudo supervisorctl reread
мой скрипт gunicron для запуска приложения Django:
#!/bin/bash
NAME="applicant_screening" # Name of the application
DJANGODIR=/home/applicant-screening-system/screening_backend # Django project directory
#SOCKFILE=/home/track_ip/run/gunicorn.sock # we will communicte using this unix socket
USER=root # the user to run as
#GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=screening_backend.settings # which settings file should Django use
DJANGO_WSGI_MODULE=screening_backend.wsgi # WSGI module name
echo "Starting $NAME as `whoami`"
# Activate the virtual environment
cd $DJANGODIR
source /home/screen-env/bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR
# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER \
--bind=0.0.0.0:8000 \
--log-level=debug \
--log-file=-