<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">From what you explain, that problem most probably come from the way you actually do the log rotation.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I first suggest you read how nginx handle it on <a href="http://nginx.org/en/docs/control.html#logs">the nginx control docs</a>.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">It seems nginx is not able to find your old log file when you moved the old one.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">You will notice that nginx keeps the old file open until a new one is opened, and you will notice that the old file must be <b>renamed</b> (thus, from what I understood, moving the file within the same filesystem is OK, since the inode remains the same, due to the file descriptor being open).<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br>If you are unsure about the the internals of <i>mv</i>, either use <i>rename</i> or ensure you do not move the file out of the log directory previous to having switched to the new one.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">If you are running on another OS than GNU Linux, you will need to know what the file utilities you use actually do and seek for a way to rename the old log file without destroying the ability for nginx to keep the old file open, even with a new name.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Even if that part seems OK, ensure the 'reopen' command equals a USR1 signal and is sent to the master process.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Once the signal is issued, you can then move the old log file wherever you wish.<br></div><div class="gmail_extra"><div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div>
<br><div class="gmail_quote">On Thu, Oct 9, 2014 at 2:32 AM, Lorenzo Raffio <span dir="ltr"><<a href="mailto:multiformeingegno@gmail.com" target="_blank">multiformeingegno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<span>From time to time access logs (for which I don't have a logrotation and manually rotate them) just "hang" and no lines are written. Same file and folder. No change in Nginx config! And the fact seems totally random, it's not related to file size, it happens to files some kilobytes long, and other with nearly 100 Mb of lines. As soon as I run "nginx -s reopen", they start working again. Any idea?</span><div><br></div>
</div>
<br>_______________________________________________<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" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div></div>