I have redis 6.0.9 installed on my server. I am unable to save ACLs and config rewrite. I have included ACL file in my redis.conf to save acl in that file.
My redis.service file
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
ReadWriteDirectories=-/var/lib/redis
[Install]
WantedBy=multi-user.target
my redis logs
13583:M 07 Dec 2020 08:22:25.026 # systemd supervision requested, but NOTIFY_SOCKET not found
13583:M 07 Dec 2020 08:22:25.026 # systemd supervision requested, but NOTIFY_SOCKET not found
13583:M 07 Dec 2020 08:22:56.275 # Opening temp ACL file for ACL SAVE: Permission denied 13583:M 07 Dec 2020 08:24:38.908 # Opening temp ACL file for ACL SAVE: Permission denied
13583:M 07 Dec 2020 08:24:44.180 # Could not create tmp config file (Permission denied)
13583:M 07 Dec 2020 08:24:44.180 # CONFIG REWRITE failed: Permission denied
2
Answers
Solved it by creating redis directory in /var/run and gave ownership of directory to redis. Now it is saving ACL to defined path in redis.conf.
I was running into the same issue. It seems that
ACL SAVE
creates a temporary file in the same directory as theaclfile
being overwritten (source). Therefore, it’s not enough for the server to have permission to write to the file, it must also have permission to write to the file’s directory.CONFIG REWRITE
, on the other hand, creates a temporary file in/tmp
(source) so it needs write access to this directory as well as the config file’s directory in order to move the file. in my experience most systems configure/tmp
such that any user can access it by default so I’m a little surprised the command is failing at this point.