Gunicorn reload Systemd

Creado: Septiembre 18, 2022

Recargar la configuración o cambios de Gunicorn mediante Systemd.

Se agregan estas las lineas ExecReload y ExecStop al "unit" de systemd.

El siguiente articulo describe la utilización y otros temas:

[alberto@barrahome barrahome-flask]$ cat /etc/systemd/system/barrahome.service
[Unit]
Description=Barrahome web application
After=network.target

[Service]
User=alberto
Group=alberto
WorkingDirectory=/home/alberto/barrahome-flask
ExecStart=/usr/bin/python3 /usr/bin/gunicorn  --bind 127.0.0.1:8000 website:app --pid=barrahome.pid
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target
[alberto@barrahome barrahome-flask]$

Luego ejecutamos:

[alberto@barrahome barrahome-flask]$ sudo systemctl daemon-reload
[alberto@barrahome barrahome-flask]$ sudo systemctl reload barrahome
Leer artículo...

Gunicorn Flask Systemd

Creado: Noviembre 5, 2020

Instalación rápida de Gunicorn utilizando Systemd

Introducción

Creamos un servicio, en este caso se llamara como mi blog.

[alberto@barrahome barrahome-flask]$ sudo nano /etc/systemd/system/barrahome.service

Agregamos el siguiente contenido:

[Unit]
Description=Barrahome web application
After=network.target

[Service]
User=alberto
Group=alberto
WorkingDirectory=/home/alberto/barrahome-flask
ExecStart=/usr/bin/python3 /usr/bin/gunicorn --bind 0.0.0.0:8000 boot:app

[Install]
WantedBy=multi-user.target
Leer artículo...