Bitcoin Forum
September 07, 2025, 04:46:26 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind.service  (Read 114 times)
glid092 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
August 20, 2025, 03:47:04 AM
 #1

What do you think about this?

https://gist.github.com/oakwhiz/0312f1d6f94b519875773c1eb22ab523


Systemd escaping example (pay attention to shell vs elsewhere):
Code:
$ systemd-escape -p --suffix=mount "/var/lib/bitcoind-testnet"
var-lib-bitcoind\x2dtestnet.mount
$ sudo cat /etc/systemd/system/var-lib-bitcoind\\x2dtestnet.mount
...
Where=/var/lib/bitcoind-testnet
...
$ sudo cat /etc/systemd/system/bitcoind-testnet.service
...
After=network-online.target var-lib-bitcoind\x2dtestnet.mount
Wants=network-online.target var-lib-bitcoind\x2dtestnet.mount

and

Code:
# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
After=network-online.target var-lib-bitcoind.mount
Wants=network-online.target var-lib-bitcoind.mount
ABCbits
Legendary
*
Offline Offline

Activity: 3360
Merit: 9112



View Profile
August 24, 2025, 08:33:25 AM
Last edit: August 24, 2025, 08:45:30 AM by ABCbits
 #2

OP, it seems you fall into XY problem[1]. So it would be great if you ask how to achieve your goal rather than getting people's thought about that systemd service file.


For many parts, the service file is similar with example on Bitcoin Core repository[2]. And while i may be wrong, i don't see benefit of bind mount with systemd rather than plain /etc/fstab.

[1] https://xyproblem.info/
[2] https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service

NotATether
Legendary
*
Offline Offline

Activity: 2086
Merit: 8901


Search? Try talksearch.io


View Profile WWW
August 24, 2025, 11:29:34 AM
 #3

Bitcoin nodes are usually only auto-started like this when they are parts of a larger application that uses Bitcoin data, like BTCPayServer - it doesn't create unit files for Bitcoin Core but you can do that easily though.

I don't know anyone who auto-starts testnet nodes though unless they are mining.

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!