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 ?
-
2Not an answer, but a SIGTERM or SiGINT will cause a graceful shutdown of bitcoind. – Pieter Wuille May 7 '18 at 4:18
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.
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.