I'm running Redis 4.0.9 on Ubuntu 18.04.1 LTS with a custom data dir for the RBD file.
To make this work, besides updating the dir
in redis.conf
to the new location, I also had to update /etc/systemd/system/redis.service
and set:
ReadWriteDirectories=-/my/custom/data/dir
(as described here: https://stackoverflow.com/questions/44814351/failed-opening-the-rdb-file-read-only-file-system)
Everything was working fine, until suddenly one day Redis started giving the Failed opening the RDB file backup.rdb (in server root dir /var/lib/redis) for saving: Read-only file system
error again, as if the ReadWriteDirectories
was not set to the new data dir.
I checked /etc/systemd/system/redis.service
and the ReadWriteDirectories
entry I added was indeed gone. I added it back and, after restarting, Redis works fine again and can sava data.
My question is: how could /etc/systemd/system/redis.service
change and my ReadWriteDirectories
line disappear? I am the only one with access to this machine. Is this file overwritten automatically in some cases? Can I disable that?