nginx not rotating logs

Bug #1328821 reported by Samuele Giovanni Tonon on 2014-06-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Nginx
Undecided
Unassigned
nginx (Ubuntu)
Undecided
Unassigned
Trusty
Undecided
Unassigned

Bug Description

in nginx-common package there's the script to rotate nginx logs but it does not work as intended:
it does rename the log but nginx keeps writing on that one.

this is because -USR1 signal doesn't seem to work, you have to use -HUP and then nginx will close and reopen logs files (without resetting uptime which is nice for detecting if webserver is stable or not) .

so i had to change my /etc/logrotate.d/nginx script from:

postrotate
        [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
endscript

to

postrotate
    /etc/init.d/nginx reload
endscript

to make it properly rotate log files.

tags: added: trusty
no longer affects: ubuntu
Thomas Ward (teward) wrote :

Which version of the package were you seeing this on? Are you using the version in Ubuntu, or in the PPAs?

Changed in nginx:
status: New → Incomplete
Matt Lauer (thefork) wrote :

This bug affects the standard nginx package in Ubuntu:

nginx version: nginx/1.4.6 (Ubuntu)
on
14.04.1 LTS

Thomas Ward (teward) wrote :

Matt, can you please check the PPA and the version in Vivid and Utopic to see if those are also affected? We need to see where this was fixed and where is still affected.

Matt Lauer (thefork) wrote :

Looks like it's fixed in the nginx ppa (from http://wiki.nginx.org/Install#Ubuntu_PPA, right?) and in Utopic & Vivid.

Thomas Ward (teward) on 2014-12-29
Changed in nginx:
status: Incomplete → Fix Released
Changed in nginx (Ubuntu):
status: New → Fix Released
Changed in nginx (Ubuntu Trusty):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers