From b48748d95760cc8ad6cf7a3e55305dbf2f665b52 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Fri, 31 Jan 2014 19:23:37 -0500 Subject: [PATCH] Have gunicorn publish its pid and have logrotate bounce it so that the file handle migrates. --- conf/logrotate/quay-logrotate | 4 ++++ gunicorn_config.py | 1 + 2 files changed, 5 insertions(+) diff --git a/conf/logrotate/quay-logrotate b/conf/logrotate/quay-logrotate index 3e5728111..313cdea13 100644 --- a/conf/logrotate/quay-logrotate +++ b/conf/logrotate/quay-logrotate @@ -26,4 +26,8 @@ missingok notifempty create 644 root root + + postrotate + kill -USR1 `cat /mnt/logs/gunicorn.pid` + endscript } \ No newline at end of file diff --git a/gunicorn_config.py b/gunicorn_config.py index 59141b06d..88055c1fa 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -3,3 +3,4 @@ workers = 8 worker_class = 'gevent' timeout = 2000 daemon = True +pidfile = '/mnt/logs/gunicorn.pid' \ No newline at end of file