Describe the bug

Am running redis on arm64 Ubuntu 22.04.3 LTS. Yesterday 18-Oct-2023 when the latest Ubuntu update for redis got applied it reverted the value of ReadWriteDirectories from /etc/systemd/system/redis.service.

redis_version:7.2.2 redis_build_id:6876a9c0c6ed6275 os:Linux 6.2.0-1013-aws aarch64

To reproduce

Steps to reproduce the behavior and/or a minimal code sample.

Instead of storing the data in root directory, I had modified the storage path of redis in /etc/redis/redis.conf (property dir) and /etc/systemd/system/redis.service (proeprty ReadWriteDirectories) from /var/lib/redis to /mnt/data_disk/redis.

When the latest patch got applied it retained the path in /etc/redis/redis.conf but it reverted the path from /etc/systemd/system/redis.service. This failed the redis service to start when machine got rebooted.

Expected behavior

A description of what you expected to happen.

Maintain the storage directory in only 1 config file instead of maintaining it in 2 places /etc/redis/redis.conf and /etc/systemd/system/redis.service. This will ensure that the patching does not impact the storage path.

Additional information

Kindly let me know if any additional information is required.

Comment From: yossigo

@abs2310 Redis's configuration is only stored in a single location - /etc/redis/redis.conf. The systemd configuration file serves a different purpose of defining the service and, in this case, its filesystem access restrictions. If you need to modify the systemd unit file in a way that persists upgrades, consider using systemctl edit to generate a separate override file with your changes.

Comment From: abs2310

@yossigo thanks for sharing the resolution. We reverted the ReadWriteDirectories settings and instead created synlink to the mount point to avoid the file getting reverted.