permissions - UWSGI 日志轮换出现错误:“父目录具有不安全的权限”
问题描述
我想轮换 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”指令。谁能告诉我这里有什么问题?我也不确定每次旋转日志时是否需要重新启动它(我从这里借用它)。并且我的配置文件看起来与这些示例相同(1除了创建权限,我不确定它是否重要)、2、3 (除了 postrotate)、5(我不使用复制截断,作为日志文件很大),6这些解决方案都没有权限问题。
解决方案
尝试确保父目录具有正确的权限
chmod 755 /var/log/ && chown root:root /var/log/
chmod 755 /var && chown root:root /var
您可能应该尝试将配置文件中的创建权限设置为类似
create 777 root root
如果以上都不起作用su root syslog
,请在配置中使用
推荐阅读
- sql - 基于最小时间差的 SQL 表连接
- spring - RestController @requestbody 总是在春天吃空的 pojo
- python - 按仅对应于其中一个组的值列对双重分组的 df 进行排序
- python-3.x - 我的乌龟屏幕一打开就关闭
- angular - Angular-8:p-confirm对话框没有在primeng的p-dialog之上打开
- python - 从另一个模块调用时QtWidget不更新
- android - 从凌空http响应android解析formdata
- javascript - .ejs 文件的 Atom 是否有特定的语法?
- python - 在 Pandas 中从数据透视表中删除空值和切片
- javascript - Vue - 如何覆盖包装器组件的道具?