Bitcoind as a service (open at start)

0

regards.

I have bitcoind installed on my VPS using ubuntu 18.04 server, and I want to configure it to autostart when system starts, I know two options to make it happend, the first is this:

systemctl enable bitcoind

the second is this but substituting the program with your bitcoind binary

so which is better? what are the differences between those?

Thanks in advance.

Daveeee

Posted 2019-11-23T20:17:01.600

Reputation: 1

There’s a suitable systemd configuration for bitcoind in the contrib directory.Anonymous 2019-11-23T20:22:15.293

Answers

0

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

Sunflower

Posted 2019-11-23T20:17:01.600

Reputation: 31

That’s awful. There’s a @reboot flag for cron if you want to be hacky.Anonymous 2019-11-24T17:39:43.293

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 2019-11-25T18:11:49.763