Welcome! Log In Create A New Profile

Advanced

Re: error_log cannot be reopened when kill a USR1 signal

All files from this thread

File Name File Size   Posted by Date  
patch.builin.log.txt 539 bytes open | download Igor Sysoev 10/09/2009 Read message
October 09, 2009 10:10AM
On Fri, Oct 09, 2009 at 11:12:12AM +0800, 任晓磊 wrote:

> [root@tupian_web logs]# ls -l /proc/`cat nginx.pid `/fd
> total 15
> lrwx------ 1 root root 64 Oct 9 11:08 0 -> /dev/null
> lrwx------ 1 root root 64 Oct 9 11:08 1 -> /dev/null
> 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 2 -> /usr/local/nginx/logs/error.log
> l-wx------ 1 root root 64 Oct 9 11:08 3 -> /usr/local/nginx/logs/error.log
> l-wx------ 1 root root 64 Oct 9 11:08 4 ->
> /usr/local/nginx/logs/host.access.log
> l-wx------ 1 root root 64 Oct 9 11:08 5 -> /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@tupian_web logs]# mv error.log error.log.1
> [root@tupian_web logs]# mv host.access.log host.access.log.1
> [root@tupian_web logs]# kill -USR1 `cat nginx.pid `
> [root@tupian_web logs]# ls -l
> total 648
> -rw-r--r-- 1 nobody root 0 Oct 9 11:08 error.log
> -rw-r--r-- 1 root root 941 Oct 9 11:07 error.log.1
> -rw-r--r-- 1 nobody root 14521 Oct 9 11:08 host.access.log
> -rw-r--r-- 1 root root 633729 Oct 9 11:08 host.access.log.1
> -rw-r--r-- 1 root root 6 Oct 9 11:07 nginx.pid
> [root@tupian_web logs]# ls -l /proc/`cat nginx.pid `/fd
> total 15
> lrwx------ 1 root root 64 Oct 9 11:08 0 -> /dev/null
> lrwx------ 1 root root 64 Oct 9 11:08 1 -> /dev/null
> 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@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?

The attached patch fixes the bug. The bug had appeared somewhere in 0.7.x,
probably in 0.7.53, however, I'm not sure.


--
Igor Sysoev
http://sysoev.ru/en/
Attachments:
open | download - patch.builin.log.txt (539 bytes)
Subject Author Posted

error_log cannot be reopened when kill a USR1 signal

任晓磊 October 08, 2009 11:16PM

Re: error_log cannot be reopened when kill a USR1 signal

Maxim Dounin October 09, 2009 07:02AM

Re: error_log cannot be reopened when kill a USR1 signal

Igor Sysoev October 09, 2009 08:52AM

Re: error_log cannot be reopened when kill a USR1 signal Attachments

Igor Sysoev October 09, 2009 10:10AM

Re: error_log cannot be reopened when kill a USR1 signal

任晓磊 October 09, 2009 02:14PM

Re: error_log cannot be reopened when kill a USR1 signal

任晓磊 October 09, 2009 09:48PM

Re: error_log cannot be reopened when kill a USR1 signal

任晓磊 October 09, 2009 09:48PM

Re: error_log cannot be reopened when kill a USR1 signal

Igor Sysoev October 10, 2009 02:30AM

Re: error_log cannot be reopened when kill a USR1 signal

任晓磊 October 10, 2009 02:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready