0

I have bitcoind installed on my VPS runing Ubuntu 18.04, and I want to configure it to launch bitcoind on startup.

What the best way to do so with my configuration ?

  • 1
    There’s a suitable systemd configuration for bitcoind in the contrib directory. – Anonymous Nov 23 '19 at 20:22
  • Wanted to close this question but finally posted an answer as i could not fine a decent motivation (aside from "there is a major troll as the only answer" :p). Will also edit for clarity. – darosior Aug 20 at 8:49
0

To start bitcoind at startup on a system using systemd, use the service configuration provided in contrib/init/ from the root of the bitcoin-core repository.

You can then manage bitcoind as any other systemd service (and possibly have some other rely on it, such as a Lightning Network implementation's service).

systemctl start bitcoind
systemctl stop bitcoind
# This enables launching the service at startup
systemctl enable bitcoind
| improve this answer | |
-1

You could add a cron program that runs on startup, creates a temp file to say it has already ran, and then execute. This makes it so that every time cron tries to run the program, it turns out empty.

Example:

touch /tmp/btc.true
[ ! -f /tmp/btc.true ] && sudo -u $USER sh -c 'HOME=~$USER; bitcoind -daemon'
exit 0
| improve this answer | |
  • 1
    That’s awful. There’s a @reboot flag for cron if you want to be hacky. – Anonymous Nov 24 '19 at 17:39
  • Ok, I'm noobie in this theme, I really dont understand so well... My main question is why not to use systemctl enable bitcoind? – Daveeee Nov 25 '19 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.