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.
This commit is contained in:
Bjørn Forsman 2016-08-28 10:05:14 +02:00 committed by Robin Gloster
parent b170bed1ff
commit 26f65ae860

View File

@ -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}
'';
};