Create /var/lib/bitcoind/blocks

Otherwise:
Mar 25 13:33:22 nix-bitcoin systemd[1]: Starting Bitcoin daemon...
Mar 25 13:33:22 nix-bitcoin f3ickn20fqrz5gd0zm7hgm247b9ajdl8-unit-script-bitcoind-pre-start[1883]: chmod: cannot access '/var/lib/bitcoind/blocks': No such fi>
Mar 25 13:33:22 nix-bitcoin systemd[1]: bitcoind.service: Control process exited, code=exited status=1
Mar 25 13:33:22 nix-bitcoin systemd[1]: bitcoind.service: Failed with result 'exit-code'.
This commit is contained in:
Clemens Fruhwirth 2019-03-25 14:40:12 +01:00
parent 0115d612e1
commit 66d9650f48

View File

@ -205,7 +205,11 @@ in {
preStart = '' preStart = ''
if ! test -e ${cfg.dataDir}; then if ! test -e ${cfg.dataDir}; then
mkdir -m 0770 -p '${cfg.dataDir}' mkdir -m 0770 -p '${cfg.dataDir}'
chown '${cfg.user}:${cfg.group}' '${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 fi
cp '${cfg.configFileOption}' '${cfg.dataDir}/bitcoin.conf' cp '${cfg.configFileOption}' '${cfg.dataDir}/bitcoin.conf'
chmod o-rw '${cfg.dataDir}/bitcoin.conf' chmod o-rw '${cfg.dataDir}/bitcoin.conf'