src.nth.io/

summaryrefslogtreecommitdiff
path: root/bitcoind/templates/bitcoind.service.j2
diff options
context:
space:
mode:
Diffstat (limited to 'bitcoind/templates/bitcoind.service.j2')
-rw-r--r--bitcoind/templates/bitcoind.service.j212
1 files changed, 11 insertions, 1 deletions
diff --git a/bitcoind/templates/bitcoind.service.j2 b/bitcoind/templates/bitcoind.service.j2
index 7c4525a..9106b41 100644
--- a/bitcoind/templates/bitcoind.service.j2
+++ b/bitcoind/templates/bitcoind.service.j2
@@ -1,12 +1,22 @@
[Unit]
Description=bitcoind
-After=network.target
+# network-online (not network): rpcbind to the host address fails with
+# getaddrinfo errors if bitcoind starts before addresses are configured
+Wants=network-online.target
+After=network-online.target
[Service]
ExecStart=/usr/local/bin/bitcoind{% if bitcoind_reindex %} -reindex{% endif %}
User={{bitcoind_user}}
+Restart=on-failure
+RestartSec=30
+
+# chainstate flush on shutdown can far exceed the 90s default; SIGKILL here
+# risks a slow replay or a reindex
+TimeoutStopSec=1800
+
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true