【问题标题】:error: error creating output file /var/lib/logrotate.status.tmp: Permission denied错误:创建输出文件/var/lib/logrotate.status.tmp时出错:权限被拒绝
【发布时间】: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 的输出是什么?

标签: centos7 logrotate


【解决方案1】:

请检查目录“var/lib”是否为只读。

【讨论】:

猜你喜欢
  • 2021-06-03
  • 2019-08-15
  • 1970-01-01
  • 2019-06-27
  • 2021-02-17
  • 1970-01-01
  • 2016-08-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多