#999345 redis-server: if "dir" is set in redis.conf redis won't work after update because the "redis.service" lacks write permission

Package:
redis-server
Source:
redis
Description:
Persistent key-value database with network interface
Submitter:
Oliver Korff +++ PPW Digitalagentur +++
Date:
2021-12-29 08:51:03 UTC
Severity:
normal
#999345#5
Date:
2021-11-10 08:43:10 UTC
From:
To:
Dear Chris,

we set the dir option in the redis.conf file to our fastest disc:

dir /srv/redis

Of couse we adjust the redis.service file to this setting:

ReadWriteDirectories=-/srv/redis

After any update of the package: redis stops working with this in the logs:

46060:C 08 Nov 2021 14:11:42.019 # Failed opening the RDB file dump.rdb
(in server root dir /srv/redis) for saving: Read-only file system

The ReadWriteDirectories=-/srv/redis is lost in the redis.service.

Is there any known workaround? Can we preserve the redis.service anyhow?
Would linking of /var/lib/redis to /srv do the job or do we run into
other problems then?

Best Regards, keep up the good work!

Oliver
---
Diese Mitteilung ist ausschließlich für den beabsichtigten Empfänger bestimmt. Sie kann vertrauliche Informationen
enthalten, die dem Schutz des Gesetzes unterliegen. Jede unberechtigte Weitergabe ist untersagt.

This message is intended exclusively for the intended recipient. It may contain confidential information which are subject to the protection of the law. Any unauthorized disclosure is prohibited.

pietzpluswild GmbH - Internetagentur Köln + Münster
Gesellschaft mit beschränkter Haftung (GmbH) / Company with limited liability
Geschäftsführer/CEOs: Michael Pietz und/and Michael Wild von Hohenborn
Sitz der Gesellschaft Köln und Münster/Registered offices Cologne and Münster, Germany
Registergericht/Registered at Amtsgericht Köln, Germany
Eintragungs-Nr./Registration no. HRB 63609
USt-IdNr./VAT ID no. DE 260 789 354

#999345#10
Date:
2021-11-12 02:21:02 UTC
From:
To:
Hi Oliver,

How exactly are you editing the Redis service file? I ask this because
as you yourself have identified, it looks like your local changes are
not being used, and the usual reason for this with systemd is not using
the special systemd incantation for doing that.


Regards,

#999345#15
Date:
2021-12-29 08:35:25 UTC
From:
To:
Hello Oliver,

I'd recommend adding the `ReadWriteDirectories=-/srv/redis` not
directly to the unit file distributed by Debian
(/usr/lib/systemd/system/redis.service or
/lib/systemd/system/redis.service), but instead into an override file
using `systemctl edit redis.service`.


Best Regards

Johannes Bülow

https://jmbfountain.de