remove pidFile
- service type "simple" is the default - pidFile is not needed for service type "simple"
This commit is contained in:
parent
1131c795dc
commit
64fc63cc40
@ -5,7 +5,6 @@ with lib;
|
|||||||
let
|
let
|
||||||
cfg = config.services.bitcoind;
|
cfg = config.services.bitcoind;
|
||||||
inherit (config) nix-bitcoin-services;
|
inherit (config) nix-bitcoin-services;
|
||||||
pidFile = "${cfg.dataDir}/bitcoind.pid";
|
|
||||||
configFile = pkgs.writeText "bitcoin.conf" ''
|
configFile = pkgs.writeText "bitcoin.conf" ''
|
||||||
${optionalString cfg.testnet "testnet=1"}
|
${optionalString cfg.testnet "testnet=1"}
|
||||||
${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"}
|
${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"}
|
||||||
@ -44,7 +43,6 @@ let
|
|||||||
'';
|
'';
|
||||||
cmdlineOptions = concatMapStringsSep " " (arg: "'${arg}'") [
|
cmdlineOptions = concatMapStringsSep " " (arg: "'${arg}'") [
|
||||||
"-datadir=${cfg.dataDir}"
|
"-datadir=${cfg.dataDir}"
|
||||||
"-pid=${pidFile}"
|
|
||||||
];
|
];
|
||||||
hexStr = types.strMatching "[0-9a-f]+";
|
hexStr = types.strMatching "[0-9a-f]+";
|
||||||
rpcUserOpts = { name, ... }: {
|
rpcUserOpts = { name, ... }: {
|
||||||
@ -282,11 +280,9 @@ in {
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
|
||||||
User = "${cfg.user}";
|
User = "${cfg.user}";
|
||||||
Group = "${cfg.group}";
|
Group = "${cfg.group}";
|
||||||
ExecStart = "${cfg.package}/bin/bitcoind ${cmdlineOptions}";
|
ExecStart = "${cfg.package}/bin/bitcoind ${cmdlineOptions}";
|
||||||
PIDFile = "${pidFile}";
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
||||||
# Hardening measures
|
# Hardening measures
|
||||||
|
Loading…
Reference in New Issue
Block a user