nginx - Gunicorn + Supervisor not running new code on reload -


i've been trying apply changes flask app reloading both gunicorn , supervisor. i've followed several tutorials using scripts , packages rainbow-saddle. nothing seems work, not rebooting entire server.

the flask app being run in virtual environment , suspect may problem.

the following startup script gunicorn , flask app.

#!/bin/bash  name="simon"                                   flaskdir=/var/www/simon             sockfile=/var/www/simon/simon.sock   user=glen                                         group=glen                                     num_workers=3                                     flask_settings_module=config.py           flask_wsgi_module=simon_wsgi.wsgi                     echo "starting $name `whoami`"  # activate virtual environment cd $flaskdir source simon/bin/activate export flask_settings_module=$flask_settings_module export pythonpath=$flaskdir:$pythonpath  # create run directory if doesn't exist rundir=$(dirname $sockfile) test -d $rundir || mkdir -p $rundir  exec gunicorn simon:simon \   --name $name \   --workers $num_workers \   --user=$user --group=$group \   --bind=unix:$sockfile \   --log-level=debug \   --pid=$flaskdir/gunicorn.pid   --log-file=$flaskdir/logs/gunicorn.log   --chdir=/var/www/simon 

this snippet of output supervisor log.

2017-08-20 19:31:56,789 warn received sighup indicating restart request 2017-08-20 19:31:56,790 info waiting simon die 2017-08-20 19:31:56,886 info stopped: simon (exit status 0) 2017-08-20 19:31:56,890 info supervisord started pid 1438 2017-08-20 19:31:57,892 info spawned: 'simon' pid 2751 2017-08-20 19:31:59,308 info success: simon entered running state, process has stayed > 1 seconds (startsecs) 

i've tried using .pid both supervisor , gunicorn kill -hup them. nothing seems refresh code being used.

edit: conf @ /etc/supervisor/supervisord.conf

[supervisord] logfile=/var/www/simon/logs/supervisord.log loglevel=info   [program:simon] command= bash /var/www/simon/simon/bin/gunicorn_start.bash simon:simon --bind 0.0.0.0 directory=/var/www/simon user=glen autostart=true autorestart=true redirect_stderr=true priority=500 ;  [program:simonreload] autostart=true autorestart=false directory=/tmp command=watchmedo shell-command --patterns="*.py;*.html;*.css;*.js" --recursive -hup $(cat /var/www/simon/supervisord.pid)' 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -