【发布时间】:2020-10-21 12:24:25
【问题描述】:
我正在尝试 logrotate 我的日志文件。这是我的配置文件:
/home/deploy/apps/production_app/current/log/*.log {
daily
missingok
rotate 52
compress
create 0644 deploy deploy
delaycompress
notifempty
sharedscripts
copytruncate
}
这是
的结果所有应用程序/production_app/current/log/
在我的日志文件上:
-rw-rw-r-- 1 deploy deploy 0 Jul 1 10:01 production.log
-rw-rw-r-- 1 deploy deploy 1124555 Jul 1 10:01 production.log.1
当我运行这个命令时
logrotate -v /etc/logrotate.d/production_app
我得到以下信息:
错误:创建输出文件 /var/lib/logrotate.status.tmp 时出错: 权限被拒绝
这是我的日志轮换配置文件的权限
lrwxrwxrwx 1 root root 67 Feb 25 2019 /etc/logrotate.d/production_app -> /home/deploy/apps/production_app/shared/config/log_rotation
【问题讨论】:
-
这很可能是 SELinux 拒绝的结果。
getenforce的输出是什么?