Nginx does not re-open log files on SIGUSR1.
Piotr Karbowski
jabberuser at gmail.com
Mon Jan 3 15:49:18 MSK 2011
Hi Piotr,
On 01/03/2011 12:38 PM, Piotr Sikora wrote:
> Are you sure that logrotate sends SIGUSR1?
> Did you try sending this signal yourself?
> How did you verify that logs did not re-open?
Yes, I checked twice logrotate's nginx rules and I tried send USR1 by
myself. To check, after rotate I did wc -l on my_vhost.access_log and it
was empty, I was hitting it with wget but until I did restart or reload,
log was empty.
I was able to 'fix' it, which is more like workaround than a real fix,
by adding permissions for nginx user to /var/log/nginx.
Before I had 700 root:root on /var/log/nginx because I am a little
paranoid and I saw no real reason to add workers there since master
process, running as root, is writting there.
After changing owner to nginx, nginx is able re-open logs after SIGUSR1.
Looks like rotated empty logs have root:root 600 perms, maybe it is the
problem? But again, I think master write there, not workers.
-- Piotr.
More information about the nginx
mailing list