From 19e5ca74ef0a663710e14a075d37df15d921d1b3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 10 Mar 2021 22:07:12 +0100 Subject: [PATCH] Fixing PID --- conf/gunicorn.py | 2 +- conf/systemd.service | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/gunicorn.py b/conf/gunicorn.py index 982a7d9..dc73fdb 100644 --- a/conf/gunicorn.py +++ b/conf/gunicorn.py @@ -3,7 +3,7 @@ pythonpath = '__FINALPATH__' workers = 4 user = '__APP__' bind = 'unix:__FINALPATH__/sock' -pid = '/run/gunicorn/__APP__-pid' +pid = '__FINALPATH__/__APP__-pid' errorlog = '/var/log/__APP__/error.log' accesslog = '/var/log/__APP__/access.log' access_log_format = '%({X-Real-IP}i)s %({X-Forwarded-For}i)s %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' diff --git a/conf/systemd.service b/conf/systemd.service index 29f9e3b..2ecd49c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,11 +3,11 @@ Description=__APP__ Daemon After=network.target [Service] -PIDFile=/run/gunicorn/__APP__-pid +PIDFile=__FINALPATH__/__APP__-pid User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=__PYTHON_PATH__/gunicorn -c __FINALPATH__/gunicorn.py wsgi:app +ExecStart=__PYTHON_PATH__/gunicorn -c __FINALPATH__/gunicorn.py wsgi:app --pid __FINALPATH__/__APP__-pid ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true