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

Posted by Liu Haifeng (Guest)
on 2013-01-23 04:30
(Received via mailing list)
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>
mv access.log access.20130122.log

My goal is make the "current" log file named with the date pattern 
immediately, not after one day. Well, my script seams OK, but for a 
production script, I still worry about that is there any "unexpected" 
trigger can make nginx reopen the log file (I mean inside nginx, core 
and other modules)? Will there be any inside reopen action in the 
future?
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.