From 26f65ae8607a496856f28488c90e08c880ac908b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 28 Aug 2016 10:05:14 +0200 Subject: [PATCH] nixos/redis: enforce owner/perms on /var/lib/redis (#18046) Previously it was only set once, now it is enforced on each start-up of redis.service. Also set _ownership_ recursively, so that the /var/lib/redis/dump.rdb file is guaranteed to be accessible by the currently configured redis user. Fixes issue #9687, where redis wouldn't start because /var/lib/redis had wrong owner. --- nixos/modules/services/databases/redis.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/databases/redis.nix b/nixos/modules/services/databases/redis.nix index 480e1184ffa3..a039ad138f6f 100644 --- a/nixos/modules/services/databases/redis.nix +++ b/nixos/modules/services/databases/redis.nix @@ -234,9 +234,8 @@ in serviceConfig.Type = "oneshot"; script = '' - if ! test -e ${cfg.dbpath}; then - install -d -m0700 -o ${cfg.user} ${cfg.dbpath} - fi + install -d -m0700 -o ${cfg.user} ${cfg.dbpath} + chown -R ${cfg.user} ${cfg.dbpath} ''; };