How to stop another bitcoind service?

2

2

I created two bitcoind service in my server. First using default configuration, and second use new configuration. I am able to stop first bitcoind using bitcoin-cli stop, but the second bitcoind still running. How to safely stop the second bitcoind without forcing to kill it ?

Billy Adelphia

Posted 2018-05-07T03:18:36.453

Reputation: 165

2Not an answer, but a SIGTERM or SiGINT will cause a graceful shutdown of bitcoind.Pieter Wuille 2018-05-07T04:18:19.403

Answers

0

bitcoin-cli accepts a -conf parameter. Use that to point to the config of the second bitcoind client (which would contain the rpc details), and then shut it down as normal.

You can also use -rpcpassword, -rpcport, and -rpcuser to supply the details manually.

Raghav Sood

Posted 2018-05-07T03:18:36.453

Reputation: 10 897

0

bitcoin-cli has a -datadir option so you can specify the data directory of your other bitcoind instance. It will use that parameter to read the bitcoin.conf and .cookie files in the other data directory so that it can connect to the other bitcoind instance. With that parameter, you can send RPC commands to it, including the stop command.

Alternatively, you can stop bitcoind by finding its PID (using ps) and the kill command. kill be default uses SIGTERM so bitcoind will actually safely shutdown by going through its shutdown process.

Andrew Chow

Posted 2018-05-07T03:18:36.453

Reputation: 40 910