From f707d970ae28c76420761575e3e0d428be0f9a37 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Fri, 12 Jul 2019 15:32:34 +0000 Subject: [PATCH] Always chown bitcoin/liquid data directories --- modules/bitcoind.nix | 4 +--- modules/liquid.nix | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index 38f4f7c..04d5aee 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -207,15 +207,13 @@ in { preStart = '' if ! test -e ${cfg.dataDir}; then mkdir -m 0770 -p '${cfg.dataDir}' - chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}' fi if ! test -e ${cfg.dataDir}/blocks; then mkdir -m 0770 -p '${cfg.dataDir}/blocks' - chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}/blocks' fi cp '${cfg.configFileOption}' '${cfg.dataDir}/bitcoin.conf' chmod o-rw '${cfg.dataDir}/bitcoin.conf' - chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}/bitcoin.conf' + chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}' echo "rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/bitcoin.conf' chmod -R g+rX '${cfg.dataDir}/blocks' ''; diff --git a/modules/liquid.nix b/modules/liquid.nix index acff282..c308321 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -180,11 +180,10 @@ in { preStart = '' if ! test -e ${cfg.dataDir}; then mkdir -m 0770 -p '${cfg.dataDir}' - chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}' fi cp '${configFile}' '${cfg.dataDir}/liquid.conf' chmod o-rw '${cfg.dataDir}/liquid.conf' - chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}/liquid.conf' + chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}' echo "rpcpassword=$(cat /secrets/liquid-rpcpassword)" >> '${cfg.dataDir}/liquid.conf' echo "mainchainrpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/liquid.conf' '';