From f2fef9fcde5fb6968a8345abc91c787edf28cf97 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Mon, 3 Feb 2014 11:57:29 -0500 Subject: [PATCH] Update the logrotate config to use the right permissions for the file, and to call USR1 on nginx after rotation. Update the readme to use the nginx pidfile. --- README.md | 2 +- conf/logrotate/quay-logrotate | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e082d4dda..ebeee06ad 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ STACK=prod python -m workers.webhookworker -D bouncing the servers: ``` -sudo kill -HUP +sudo kill -HUP `cat /mnt/logs/nginx.pid` kill -HUP `cat /mnt/logs/gunicorn.pid` kill diff --git a/conf/logrotate/quay-logrotate b/conf/logrotate/quay-logrotate index 313cdea13..79fdc377d 100644 --- a/conf/logrotate/quay-logrotate +++ b/conf/logrotate/quay-logrotate @@ -6,6 +6,10 @@ missingok notifempty create 644 root root + + postrotate + [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/nginx.pid` + endscript } /mnt/logs/nginx.error.log { @@ -16,6 +20,10 @@ missingok notifempty create 644 root root + + postrotate + [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/nginx.pid` + endscript } /mnt/logs/application.log { @@ -25,9 +33,9 @@ delaycompress missingok notifempty - create 644 root root + create 644 ubuntu ubuntu postrotate - kill -USR1 `cat /mnt/logs/gunicorn.pid` + [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /mnt/logs/gunicorn.pid` endscript } \ No newline at end of file