Is there any other way to trigger log reopen beside kill -USR1?
Liu Haifeng
haifeng.813 at gmail.com
Thu Jan 24 12:28:06 UTC 2013
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?
More information about the nginx
mailing list