Reputation: 1
I have installed the redis in centos stream 8,
my requirement was to change default directory to custom directory default directory is "/var/lib/redis" i have changed it to "/root/data" and changed the directory owner/group to redis and permission to 755
changed the custom data directory path in "/etc/redis.conf" file and restarted the redis service..
it is getting failed and checked in the "/var/log/redis/redis.log" file the error is Can't chdir to '/root/data': Permission denied
Can anyone help me out on this issue.. Thanks in advance..
Upvotes: 0
Views: 1872
Reputation: 96
This permission denied issue has nothing to do with file/dir perms as one should think, but rather with a safety measure that Redis implements at service level.
We will be changing the Db from the standard /var/lib/redis path to new /dirA/dirB path
Ready to go with a new DB!
WARNING
This, on my test machine, caused the stopjobs to stuck so reboots took a lot of time. To solve it you can set TimeoutStopSec to a number different from 0 on /etc/systemd/system/redis.service
5s or 10s are rather used values.
Upvotes: 0