Redémarrage gracieux du process master de gunicorn
continuous-integration/drone/push Build is passing Details

`pc -C gunicorn` only lists the processes with `gunicorn` command, i.e., workers and master process. Workers are children of master as can be seen using `ps -C gunicorn fc -o ppid,pid,cmd`. We only need the pid of the master, therefore h flag is used to remove the first line which is PID text. Note that, f flag assures that master is printed above workers.

The correct procedure is to send `HUP` signal only to the master. In this way `gunicorn` is gracefully restarted, only the workers, not master, are recreated.
This commit is contained in:
Fred 2020-12-28 12:46:42 +01:00
parent 157776b35d
commit 739c7e7dc0
1 changed files with 2 additions and 1 deletions

View File

@ -357,8 +357,9 @@ git checkout vX.Y.Z
pip install -U requirements/prod.txt
python manage.py migrate
python manage.py collectstatic
gunicorn reload -HUP
kill -HUP `ps -C gunicorn fch -o pid | head -n 1` <1>
----
<1> https://stackoverflow.com/questions/26902930/how-do-i-restart-gunicorn-hup-i-dont-know-masterpid-or-location-of-pid-file
==== Configuration des sauvegardes