nginx not rotating logs

Bug #1328821 reported by Samuele Giovanni Tonon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Nginx
Fix Released
Undecided
Unassigned
nginx (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Confirmed
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: trusty
tags: added: trusty
no longer affects: ubuntu
Revision history for this message
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
Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.