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

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

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
 再重启,显示成功。问题获得解决
相关文章
相关标签/搜索