<div dir="ltr"><div><div>Hi Maxim,<br><br></div>We came across a case where kill -USR1 doesn't cause nginx reopen the access.log. And we need to run nginx with "daemon off" and "master-process off". Is that a known issue and is there any workaround?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 20, 2014 at 4:33 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<span class=""><br>
On Mon, May 19, 2014 at 03:06:06PM -0400, samingrassia wrote:<br>
<br>
</span><span class="">> Thanks to everyone in advance!<br>
><br>
> I have a cron that runs the following:<br>
><br>
> mv $NGINX_ACCESS_LOG $ACCESS_LOG_DROPBOX/$LOG_<wbr>FILENAME<br>
> kill -USR1 `cat $NGINX_PID`<br>
><br>
> My questions is during time between the mv and the kill, is there any log<br>
> writes that are being discarded or are they being stacked in memory and<br>
> dumped into the new access.log after it is recreated?<br>
<br>
</span>Unless you are trying to move logs to a different filesystem,<br>
logging will continue to the old file till USR1 is processed.<br>
<br>
>From nginx point of view, the "mv" command does nothing - as nginx<br>
has open file descriptor, it will continue to write to it, and log<br>
lines will appear in the (old) file - the file which is now have a<br>
new name.  After USR1 nginx will reopen the log, and will continue<br>
further logging to a new file.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" rel="noreferrer" target="_blank">http://nginx.org/</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>