From e289b94fbe771ad9afdd43750087108330745b53 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Thu, 27 Apr 2017 11:33:42 -0400 Subject: [PATCH] graphite service: no recursive chown when starting (#24442) Fixes #24444 --- nixos/modules/services/monitoring/graphite.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index 98931e65bb56..6b24ac2c7c62 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -400,7 +400,8 @@ in { mkdir -p ${cfg.dataDir}/whisper chmod 0700 ${cfg.dataDir}/whisper - chown -R graphite:graphite ${cfg.dataDir} + chown graphite:graphite ${cfg.dataDir} + chown graphite:graphite ${cfg.dataDir}/whisper ''; }; }) @@ -487,9 +488,11 @@ in { # create index ${pkgs.python27Packages.graphite_web}/bin/build-index.sh - touch ${dataDir}/db-created + chown graphite:graphite ${cfg.dataDir} + chown graphite:graphite ${cfg.dataDir}/whisper + chown -R graphite:graphite ${cfg.dataDir}/log - chown -R graphite:graphite ${cfg.dataDir} + touch ${dataDir}/db-created fi ''; }; @@ -526,9 +529,10 @@ in { mkdir -p ${dataDir}/cache/ chmod 0700 ${dataDir}/cache/ - touch ${dataDir}/db-created + chown graphite:graphite ${cfg.dataDir} + chown -R graphite:graphite ${cfg.dataDir}/cache - chown -R graphite:graphite ${cfg.dataDir} + touch ${dataDir}/db-created fi ''; }; @@ -549,7 +553,7 @@ in { preStart = '' if ! test -e ${dataDir}/db-created; then mkdir -p ${dataDir} - chown -R graphite:graphite ${dataDir} + chown graphite:graphite ${dataDir} fi ''; };