【发布时间】: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除了创建权限,我不确定它是否重要),2,3(除了 postrotate),5(我不知道使用复制截断,因为日志文件很大),6 这些解决方案都没有权限问题。
【问题讨论】:
-
你的问题解决了吗?
标签: permissions uwsgi logrotate