0

I've ran into a problem with my Redis 4.09 installation on Ubuntu 18.04. Each time I reboot the machine the /var/log/redis/redis-server.log ends up being owned by www-data:www-data:

# namei -l /var/log/redis/redis-server.log
f: /var/log/redis/redis-server.log
drwxr-xr-x root     root     /
drwxr-xr-x root     root     var
drwxrwxr-x root     syslog   log
drwxr-x--- redis    redis    redis
-rw-r----- www-data www-data redis-server.log


# stat /var/log/redis/redis-server.log

  File: /var/log/redis/redis-server.log
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: fc04h/64516d    Inode: 131151      Links: 1
Access: (0640/-rw-r-----)  Uid: (   33/www-data)   Gid: (   33/www-data)
Access: 2019-01-01 06:25:03.050853905 +0100
Modify: 2019-01-01 06:25:03.050853905 +0100
Change: 2019-01-01 06:25:03.050853905 +0100
 Birth: -

This results in the redis.service refusing to start. The same thing happens when I invoke redis-server directly:

# sudo -u redis redis-server /etc/redis/redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 171
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: Permission denied
New contributor
Alphakilo23 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

Eh. Solved it. Slightly embarrassing.
I botched an usermod and the redis-user ended up in the www-data group as the primary group:

# groups redis
redis : www-data

The fix was usermod -g redis redis.

New contributor
Alphakilo23 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Alphakilo23 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.