On Thu, Sep 26, 2019 at 07:25:45AM -0400, krishna wrote: Hi there,
> logrotate has been used to archive the nginx log files on daily basis from > the machine and below is the configuration. > postrotate > /usr/bin/kill -USR1 `cat /var/pid/nginx.pid 2>/dev/null` 2>/dev/null || > true #PID file for nginx > endscript That looks like it should work; although the "2>/dev/null" parts will possibly throw away any useful status message. http://nginx.org/en/docs/control.html describes what should happen, on the nginx side. When I test here, I don't see anything obvious in the error_log that indicates that USR1 was received. So from here, it looks to me that if you can describe a repeatable recipe that causes this unwanted behaviour to happen, then there may be something within nginx that needs fixing. (If I do a straightforward mv logs/access.log logs/access.log.$(date +%s) then my next request is written to the moved file; and after kill -USR1 `cat logs/nginx.pid` then the next request is written to the new access.log. So a "simple" test here does not fail.) Cheers, f -- Francis Daly [email protected] _______________________________________________ nginx mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx
