小编Car*_*arl的帖子

这个 logrotate nginx 配置有什么作用?

在我的/etc/logrotate.d/nginx我看到,

/var/log/nginx/*.log {
        daily
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 nginx adm
        sharedscripts
        postrotate
                [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
        endscript
}
Run Code Online (Sandbox Code Playgroud)

postrotate 脚本看起来像是杀死了 nginx 进程,这没有意义,所以我一定是错的。

它在做什么?

kill logrotate signals nginx daemon

5
推荐指数
1
解决办法
4545
查看次数

标签 统计

daemon ×1

kill ×1

logrotate ×1

nginx ×1

signals ×1