error_log cannot be reopened when kill a USR1 signal

Igor Sysoev is at rambler-co.ru
Fri Oct 9 16:46:09 MSD 2009


On Fri, Oct 09, 2009 at 02:56:38PM +0400, Maxim Dounin wrote:

> Hello!
> 
> On Fri, Oct 09, 2009 at 11:12:12AM +0800, 任晓磊 wrote:
> 
> [...]
> 
> > [root at tupian_web logs]# mv host.access.log host.access.log.1
> > [root at tupian_web logs]# kill -USR1 `cat nginx.pid `
> > lrwx------  1 root root 64 Oct  9 11:08 10 -> socket:[52975564]
> > lrwx------  1 root root 64 Oct  9 11:08 11 -> socket:[52975565]
> > lrwx------  1 root root 64 Oct  9 11:08 12 -> socket:[52975566]
> > lrwx------  1 root root 64 Oct  9 11:08 13 -> socket:[52975569]
> > lrwx------  1 root root 64 Oct  9 11:08 14 -> socket:[52975570]
> > l-wx------  1 root root 64 Oct  9 11:08 15 ->
> > /usr/local/nginx/logs/host.access.log
> > l-wx------  1 root root 64 Oct  9 11:08 2 -> /usr/local/nginx/logs/error.log
> > l-wx------  1 root root 64 Oct  9 11:08 3 -> /usr/local/nginx/logs/error.log.1
> > l-wx------  1 root root 64 Oct  9 11:08 4 -> /usr/local/nginx/logs/error.log
> > lrwx------  1 root root 64 Oct  9 11:08 6 -> socket:[52975557]
> > lrwx------  1 root root 64 Oct  9 11:08 7 -> socket:[52975560]
> > lrwx------  1 root root 64 Oct  9 11:08 8 -> socket:[52975561]
> > lrwx------  1 root root 64 Oct  9 11:08 9 -> socket:[52975563]
> > [root at tupian_web logs]# ../sbin/nginx -V
> > nginx version: nginx/0.7.62
> > built by gcc 3.4.6 20060404 (Red Hat 3.4.6-8)
> > configure arguments:
> > 
> > After kill a USR1 signal to nginx master process, it keeps opening
> > error.log file and error.log.1 file. Why?
> 
> Looks like a bug, thanks.  I'll take a look how to fix this 
> properly.

Yes, this is a bug, and it is due to nginx open several copies of error.log.
I'm resolving this now.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list