<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">On Mon, May 19, 2014 at 9:53 PM, Lord Nynex <span dir="ltr"><<a href="mailto:lordnynex@gmail.com" target="_blank">lordnynex@gmail.com</a>></span> wrote:<br>

</div><div class="gmail_extra"><font size="1"><span style="color:rgb(102,102,102)"></span></font><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr"><div><br></div><div>The name of the file is really sort of irrelevant. The file descriptor will still point at <span style="font-size:13px;font-family:arial,sans-serif">$ACCESS_LOG_DROPBOX/$LOG_</span><span style="font-size:13px;font-family:arial,sans-serif">FILENAME. Any log lines between MV and KILL *should* still be written there. </span><br>


</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Why not use logrotate?</span></div></div></blockquote><div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">

​Th​ere has been no precision on *why* the user wanted to mv the log file somewhere else. Stating that is for log rotation/storage purpose is speculation.<br></div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">Why not use nginx reload? Why not use HUP?</span></div></div></blockquote><div><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">

​You​</div> <div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">​are repeating yourself, as the first usually equals the second (the service 'reload' command is usually a wrap-up of the -HUP signal)​<br>

<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">As Francis suggested, there should be special care about what the moving command will do:<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">

<a href="http://nginx.org/en/docs/control.html#logs">The docs abut controlling nginx</a> say that the old log file will remain opened until the -USR1 signal closes file descriptors pointing to it.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">

- A local 'mv' will keep the same inode, thus only renaming the file and keeping opened file descriptors on it intact. You want that since all incoming log messages will continue to be sent to this file until the -USR1 signal switches to a new one.<br>

</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">- On the contrary, a remote 'mv' (ie moving file to network storage) will copy and *delete* the file, making the file descriptor opened by nginx invalid.<br>

<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">The docs do not say what happens to log messages trying to be sent to invalid fd, although as Francis suggest, it might be simply discarded. Maybe are there some buffers FIFO-like n front of the fd that would retain some of the messages? Pure speculation.<br>

</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">I have not had a look to the sources, if someone is around to provide us with that information (or better: put a wuick word on it in the docs), I would be glad. :o)<br>

<font size="1"><span style="color:rgb(102,102,102)"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">​</div>---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b></font>
</div></div></div></div></div>