Author

Topic: Bitcoind immediately getting shutdown signal on systemd (Read 150 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
Apparently, Bitcoind hates running as root and that's what was causing the shutdown, as with the default systemd unit file settings, it can't even find its home folder. Kind of strange how no error is printed for it though.

I doubt you find actual reason since i tried running bitcoind as root user on virtual machine and didn't encounter any problem. Take note i simply run command ./bitcoind rather than creating systemd unit file.

Code:
2022-04-01T11:24:05Z Bitcoin Core version v22.0.0 (release build)
2022-04-01T11:24:05Z Assuming ancestors of block 00000000000000000008a89e854d57e5667df88f1cdef6fde2fbca1de5b639ad have valid signatures.
2022-04-01T11:24:05Z Setting nMinimumChainWork=00000000000000000000000000000000000000001fa4663bbbe19f82de910280
2022-04-01T11:24:05Z Using the 'shani(1way,2way)' SHA256 implementation
2022-04-01T11:24:05Z Using RdSeed as additional entropy source
2022-04-01T11:24:05Z Using RdRand as an additional entropy source
2022-04-01T11:24:05Z Default data directory /root/.bitcoin
2022-04-01T11:24:05Z Using data directory /root/.bitcoin
2022-04-01T11:24:05Z Config file: /root/.bitcoin/bitcoin.conf (not found, skipping)
2022-04-01T11:24:05Z Using at most 125 automatic connections (1024 file descriptors available)
2022-04-01T11:24:05Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2022-04-01T11:24:05Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2022-04-01T11:24:05Z Script verification uses 3 additional threads
2022-04-01T11:24:05Z scheduler thread start
2022-04-01T11:24:05Z HTTP: creating work queue of depth 16
2022-04-01T11:24:05Z Using random cookie authentication.
2022-04-01T11:24:05Z Generated RPC authentication cookie /root/.bitcoin/.cookie
2022-04-01T11:24:05Z HTTP: starting 4 worker threads
2022-04-01T11:24:05Z Using wallet directory /root/.bitcoin/wallets
2022-04-01T11:24:05Z init message: Verifying wallet(s)…
2022-04-01T11:24:05Z init message: Loading banlist…
2022-04-01T11:24:05Z SetNetworkActive: true
2022-04-01T11:24:05Z Using /16 prefix for IP bucketing
2022-04-01T11:24:05Z Cache configuration:
2022-04-01T11:24:05Z * Using 2.0 MiB for block index database
2022-04-01T11:24:05Z * Using 8.0 MiB for chain state database
2022-04-01T11:24:05Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2022-04-01T11:24:05Z init message: Loading block index…
2022-04-01T11:24:05Z Switching active chainstate to Chainstate [ibd] @ height -1 (null)
2022-04-01T11:24:05Z Opening LevelDB in /root/.bitcoin/blocks/index
2022-04-01T11:24:05Z Opened LevelDB successfully
2022-04-01T11:24:05Z Using obfuscation key for /root/.bitcoin/blocks/index: 0000000000000000
2022-04-01T11:24:05Z LoadBlockIndexDB: last block file = 0
2022-04-01T11:24:05Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=1, size=293, heights=0...0, time=2009-01-03...2009-01-03)
2022-04-01T11:24:05Z Checking all blk files are present...
2022-04-01T11:24:05Z Opening LevelDB in /root/.bitcoin/chainstate
2022-04-01T11:24:05Z Opened LevelDB successfully
2022-04-01T11:24:05Z Using obfuscation key for /root/.bitcoin/chainstate: 0edb143f72378209

Time to go hunting for bargain dedi servers - I blew too much money on VPSs to continue with those again.

Check https://lowendbox.com/, although there aren't many listing for dedicated server.
hero member
Activity: 1438
Merit: 513
Apparently, Bitcoind hates running as root and that's what was causing the shutdown, as with the default systemd unit file settings, it can't even find its home folder. Kind of strange how no error is printed for it though.

I could've ran it as an unprivileged user, which I did as well as c-lightning without problems, but then running BTCPayServer as unprivileged made stupid .NET path not found errors when trying to access the store, making it effectively useless.

Time to go hunting for bargain dedi servers - I blew too much money on VPSs to continue with those again.

Might I interest you in this?

Perfect node system for just about all use case scenarios.
i5-6440EQ @2.7GHZ Quadcore (505e3)
32gb DDR4L ram
wifi+bluetooth (worlwide)
sim slot
x2 oldschool pci slots
2x sata/power connectors
Nic1+Nic2
x4 com ports  IRQ3,4,5&7 (RS232,RS422,RS485)
GPIO 8 In and out with mapping in bios.
4x 2.0 usb, x4 3.0 usb
1x VGA, 2x DP, 1x HDMI (Intel HD)
No passwords, OROM,SGX
Fanless the whole unit is a heatsink.
Looks like this.
Make offers, open to trades?
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Apparently, Bitcoind hates running as root and that's what was causing the shutdown, as with the default systemd unit file settings, it can't even find its home folder. Kind of strange how no error is printed for it though.

I could've ran it as an unprivileged user, which I did as well as c-lightning without problems, but then running BTCPayServer as unprivileged made stupid .NET path not found errors when trying to access the store, making it effectively useless.

Time to go hunting for bargain dedi servers - I blew too much money on VPSs to continue with those again.
legendary
Activity: 1932
Merit: 1273
Have you tried to increase the restart and limit interval settings?

Or maybe it's likely because you set the Restart=always. Try to change it to other settings like on-failure.

EDIT:

I'm trying to replicate the config, systemd manpage shows

Code:
If set to always, the service will be restarted regardless of whether it exited cleanly or not, got terminated abnormally by a signal, or hit a timeout.

Read more at: https://www.commandlinux.com/man-page/man5/systemd.service.5.html

With the systemd config you used, the bitcoind run successfully but only if I've configured the PIDfile. If it doesn't exists, I could reproduce your issues. I'm not sure where it's wrong, but I believe there is something to do with it.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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:

Code:
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:

Code:
[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:

Code:
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.
Jump to: