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
 再重啓,顯示成功。問題獲得解決
相關文章
相關標籤/搜索