Ubuntu下启动 Redis时, 提示 "Can't open the log file: Permission denied failed"

前端之家收集整理的这篇文章主要介绍了Ubuntu下启动 Redis时, 提示 "Can't open the log file: Permission denied failed"前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

问题来源:在删除var目录下的log文件时,将redis文件删除了。然后在重启时:/etc/init.d/redis-server start,提示

Starting redis-server:

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file,at line 94
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: No such file or directory
Failed。好吧,于是 touch/var/log/redis/redis-server.log后,再重启时,提示
Starting redis-server:
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file,at line 94
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: Permission denied
Failed
查了一下,最终发现有可能是权限不够的问题,于是,ls -l /var/log/redis/redis-server.log
提示:-rw-r--r-- 1 root root 0 6月 2 10:05 /var/log/redis/redis-server.log。如下图所示:

解决办法:
chmod 777 /var/log/redis/redis-server.log
再重启,显示成功。问题得到解决
原文链接:https://www.f2er.com/ubuntu/352775.html

猜你在找的Ubuntu相关文章