logrotate nginx 日志之后,nginx 不往 nginx_access.log 写新日志,而是继续往 nginx_access.log-20180906 写日志。只有 service nginx restart 之后才会重新写回 nginx_access.log 。。。
下面是我的 logrotate 的配置
/log/nginx/*.log {
daily
missingok
rotate 186
dateext
compress
delaycompress
ifempty
create 640 www-data www-data
sharedscripts
postrotate
[ -f /run/nginx.pid ] && /bin/kill -USR1 `cat /run/nginx.pid`
endscript
}
/run/nginx.pid 确实是 nginx 的 pid 文件,求教各位大佬!!!