0
  1. When running bitcoind from a systemd service, as in https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service, what is the role of the -daemon flag?

Basically I'm asking what does -daemon do in a situation where bitcoind is run as service, and not as a wallet. And what happens if -daemon is not used -> in a systemd service file.

  1. If one sets daemon=1 in bitcoin.conf, is it redundant to also use the -daemon flag when starting
0

When running bitcoind from a systemd service, as in https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service, what is the role of the -daemon flag?

-daemon starts bitcoind in the background as a daemon. So if you run bitcoind -daemon in the terminal, the program will exit immediately but bitcoind is still running in the background. Without -daemon, you will see that bitcoind appears to hang in the terminal, but that just means it is running. If you stop the command, then bitcoind will stop as well.

If one sets daemon=1 in bitcoin.conf, is it redundant to also use the -daemon flag when starting

Yes. This applies for all command line options.

  • Yes, I see that the terminal seems 'occupied' or 'hanging' when the daemon setting is turned off. But my question was not about starting the daemon in terminal, but in a systemd service. In this case what is the consequence of running with the daemon setting turned on, or going instead Type=simple and no daemon does the job correctly also? – user2066480 Apr 18 '18 at 21:48
  • As I explained in your other question about this, you cannot use Type=simple without -daemon. Systemd will not work with that. – Andrew Chow Apr 18 '18 at 22:18
  • In the other question about forking vs simple, you made a case against using Type=simple together with daemon=1. In my comment above I was asking for Type=simple together with daemon=0. – user2066480 Apr 18 '18 at 22:37
  • I see. There is no difference between using Type=simple and daemon=0 and using Type=forking and daemon=1. – Andrew Chow Apr 18 '18 at 23:01
  • From my experience Type=simple and daemon=1 in btc conf file, makes daemon shotdown just after start with systemctl start – Pawel Cioch Dec 20 '18 at 23:12

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.