I have just force restarted my unresponsive server with Bitcoind running on it, and because it wasn't running as a service automatically before, I have created a systemd service for it which I have enabled and activated, but for some reason, something is constantly shutting it down (cleanly), and restarting it in an infinite loop!
Bitcoin Core version: 22.0
OS: Ubuntu 20.04 LTS
My bitcoin.conf:
rpcuser=#erased
rpcpassword=#erased
daemon=1
rpcallowip=0.0.0.0
whitebind=127.0.0.1:8332
whitebind=127.0.0.1:8333
My Bitcoind unit file:
[Unit]
Description=Bitcoin Core service
After=network.target
StartLimitIntervalSec=0
[Service]
User=root # don't ask (the rest of BTCPayServer is also running as root)
Type=simple
Restart=always
RestartSec=1
ExecStart=/opt/bitcoin-22.0/bin/bitcoind
[Install]
WantedBy=multi-user.target
Debug.log entries:
2022-03-29T15:05:21Z Bitcoin Core version v22.0.0 (release build)
2022-03-29T15:05:21Z InitParameterInteraction: parameter interaction: -whitebind set -> setting -listen=1
2022-03-29T15:05:21Z Assuming ancestors of block 00000000000000000008a89e854d57e5667df88f1cdef6fde2fbca1de5b639ad have valid signatures.
2022-03-29T15:05:21Z Setting nMinimumChainWork=00000000000000000000000000000000000000001fa4663bbbe19f82de910280
2022-03-29T15:05:21Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
2022-03-29T15:05:21Z Default data directory /root/.bitcoin
2022-03-29T15:05:21Z Using data directory /root/.bitcoin
2022-03-29T15:05:21Z Config file: /root/.bitcoin/bitcoin.conf
2022-03-29T15:05:21Z Config file arg: daemon="1"
2022-03-29T15:05:21Z Config file arg: rpcallowip="0.0.0.0"
2022-03-29T15:05:21Z Config file arg: rpcpassword=****
2022-03-29T15:05:21Z Config file arg: rpcuser=****
2022-03-29T15:05:21Z Config file arg: whitebind="127.0.0.1:8332"
2022-03-29T15:05:21Z Config file arg: whitebind="127.0.0.1:8333"
2022-03-29T15:05:21Z Using at most 125 automatic connections (1024 file descriptors available)
2022-03-29T15:05:21Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2022-03-29T15:05:21Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2022-03-29T15:05:21Z Script verification uses 7 additional threads
2022-03-29T15:05:21Z scheduler thread start
2022-03-29T15:05:21Z WARNING: option -rpcallowip was specified without -rpcbind; this doesn't usually make sense
2022-03-29T15:05:21Z HTTP: creating work queue of depth 16
2022-03-29T15:05:21Z Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcauth for rpcauth auth generation.
2022-03-29T15:05:21Z HTTP: starting 4 worker threads
2022-03-29T15:05:21Z Using wallet directory /root/.bitcoin/wallets
2022-03-29T15:05:21Z init message: Verifying wallet(s)…
2022-03-29T15:05:21Z init message: Loading banlist…
2022-03-29T15:05:21Z SetNetworkActive: true
2022-03-29T15:05:21Z Using /16 prefix for IP bucketing
2022-03-29T15:05:21Z Cache configuration:
2022-03-29T15:05:21Z * Using 2.0 MiB for block index database
2022-03-29T15:05:21Z * Using 8.0 MiB for chain state database
2022-03-29T15:05:21Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2022-03-29T15:05:21Z Shutdown requested. Exiting.
2022-03-29T15:05:21Z Shutdown: In progress...
2022-03-29T15:05:21Z scheduler thread exit
2022-03-29T15:05:21Z Shutdown: done
The about log message occurs in a loop ever 1 second, presumably because systemd is trying to restart it again. There is no obvious error in the logs, but a strange request to shut down as soon as I type
systemctl start bitcoind.service.