2
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

I can run redis-server with root user, but I need run it with redis user. And then it print this error log.

OS & redis version:

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
Vonfry
  • 248

2 Answers2

4

I add x permission into /var/log, and the problem has been solved.It seems that redis should have a x permission at parent dir.

Now my /var/log is 701.

Vonfry
  • 248
2

On centos 7 I was also facing same issue due to SELinux was in enforcing mode. I solved it by setting redis service in permissive mode semanage permissive -a redis_t.

MJes
  • 21