Welcome! Log In Create A New Profile

Advanced

Is there any other way to trigger log reopen beside kill -USR1?

Liu Haifeng
January 24, 2013 07:30AM
Hi all,

In the common case, people rotate access log like this:

mv access.log access.XXX.log
kill -USR1 <nginx pid>

In my case, I have to do something like this:

if [ -f "access.log" ]; then
mv access.log access.20130121.log
fi

kill -USR1 <nginx pid>
{wait until access.log was generated}
mv access.log access.20130122.log

My goal is make the "current" log file renamed with the date pattern immediately, not after one day or other period. Well, my script seams OK, but for a production script, I still worry about that is there any "unexpected" trigger(other than send usr1 signal externally) can make nginx reopen the log file? Will there be any inside reopen action in the future?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is there any other way to trigger log reopen beside kill -USR1?

Liu Haifeng January 24, 2013 07:30AM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Andre Jaenisch January 24, 2013 08:02AM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Liu Haifeng January 24, 2013 09:44AM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Scott Ribe January 24, 2013 09:56AM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Andre Jaenisch January 24, 2013 12:50PM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Liu Haifeng January 25, 2013 05:26AM

Re: Is there any other way to trigger log reopen beside kill -USR1?

Jan-Philip Gehrcke January 24, 2013 09:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready