gentoo /var/log/redis # ls -al
total 8
drwxrwxr-x 2 root redis 4096 12月 3 16:05 .
drw-rw-r-- 5 root root 4096 12月 3 15:57 ..
-rwxrwxrwx 1 redis redis 0 12月 3 16:05 redis.log
gentoo /var/log/redis # sudo -u redis redis-server /etc/redis.conf
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 175
>>> 'logfile /var/log/redis/redis.log'
Can't open the log file: Permission denied
我可以使用根用户运行redis-server
,但我需要使用redis用户运行它。然后打印这个错误日志。
OS & redis版本:
Linux gentoo 4.12.12-gentoo #1 SMP Wed Oct 4 09:05:50 CST 2017 x86_64 Virtual CPU a7769a6388d5 GenuineIntel GNU/Linux
Redis server v=4.0.2 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=4504b17bcfd3837e
发布于 2017-12-03 08:56:18
我将x
权限添加到/var/log
中,问题是solved.It似乎redis
应该在父dir上拥有x
权限。
现在我的/var/log
是701
。
发布于 2021-04-09 04:48:47
在centos 7上,由于SELinux处于执行模式,我也面临着同样的问题。我通过在许可模式semanage permissive -a redis_t
中设置redis服务来解决这个问题。
https://unix.stackexchange.com/questions/408506
复制相似问题