nixos/grahite-service: mkdir -m => mkdir && chmod

mkdir -m will only set the permissions if it *creates* the directory.
Existing directories, with possibly wrong permissions, will not be
updated.

Use explicit chmod so permissions will always be correct.
This commit is contained in:
Bjørn Forsman 2014-04-17 15:49:46 +02:00
parent ffb593f880
commit 705dd70b32

View file

@ -194,7 +194,8 @@ in {
cfg.carbon.rewriteRules
];
preStart = ''
mkdir -m 0700 -p ${cfg.dataDir}/whisper
mkdir -p ${cfg.dataDir}/whisper
chmod 0700 ${cfg.dataDir}/whisper
chown -R graphite:graphite ${cfg.dataDir}
'';
};
@ -254,7 +255,8 @@ in {
};
preStart = ''
if ! test -e ${dataDir}/db-created; then
mkdir -m 0700 -p ${dataDir}/{whisper/,log/webapp/}
mkdir -p ${dataDir}/{whisper/,log/webapp/}
chmod 0700 ${dataDir}/{whisper/,log/webapp/}
# populate database
${pkgs.python27Packages.graphite_web}/bin/manage-graphite.py syncdb --noinput