【问题标题】:UWSGI log rotation gets error: “parent directory has insecure permissions”UWSGI 日志轮换出现错误:“父目录具有不安全的权限”
【发布时间】:2018-10-10 15:04:27
【问题描述】:

我想轮换 UWSGI 的日志,这是我的配置文件:

/var/log/uwsgi.log {
        size 100M
        missingok
        rotate 400
        dateext
        dateformat .%Y%m%d-%s
        compress
        notifempty
        create
        sharedscripts
        postrotate
           stop uwsgi
           start uwsgi
        endscript
}

但是当我尝试旋转它时出现以下错误:

error: skipping "/var/log/uwsgi.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

文件的权限如下:

-rw-r----- 1 root root 33201346 Oct 10 10:32 /var/log/uwsgi.log
-rw-r--r-- 1 root root 281 Oct 10 10:20 /etc/logrotate.d/uwsgi

所以我看不出有任何理由使用“su”指令。谁能告诉我这里有什么问题?我也不确定每次轮换日志时是否需要重新启动它(我从here借来的)。我的配置文件看起来和这些例子一样(1除了创建权限,我不确定它是否重要),23(除了 postrotate),5(我不知道使用复制截断,因为日志文件很大),6 这些解决方案都没有权限问题。

【问题讨论】:

  • 你的问题解决了吗?

标签: permissions uwsgi logrotate


【解决方案1】:

尝试确保父目录具有正确的权限

chmod 755 /var/log/ && chown root:root /var/log/
chmod 755 /var && chown root:root /var

您可能应该尝试将配置文件中的创建权限设置为类似

create 777 root root

如果以上都不起作用,请在配置中使用su root syslog

【讨论】:

    猜你喜欢
    • 2014-11-20
    • 2015-08-31
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 2016-03-24
    • 1970-01-01
    • 2018-11-20
    • 1970-01-01
    相关资源
    最近更新 更多