I started monerod as a background daemon with the --detach
flag.
Suppose I want to restart my computer, how do I gracefully stop the process?
Can I just kill it?
Thanks in advance.
Run monerod exit
. You can also just kill the process but you might lose the last batch of blocks that way.
monerod exit
, monerod status
, works great.
stop_daemon
and exit
-- why do the both exist?
Commented
Aug 27, 2018 at 11:56
When you've started monerod
with the --rpc-bind-ip
option (and --confirm-external-bind
), you should also reference that when sending commands, such as exit
(or status
). For example, the following wouldn't work anymore:
$ monerod exit
Creating the logger system
Error: Couldn't connect to daemon
You'd need to do it like this instead:
$ monerod exit --rpc-bind-ip ….….….…
Creating the logger system
Stop signal sent
As for Unix signals:
kill -TERM
Seems to also send the correct shutdown for a clean exit.
Tested on monerod 0.10.3.1 on macOS.
Bring monerod process that is running in the background into the foreground and then type exit.
As of version 0.10.3.1, dpzz's answer doesn't appear to work. Specifically, if you start the daemon with --rpc-bind-ip
, referencing that in the commands to send to the daemon doesn't successfully locate the daemon.
monerod --rpc-bind-ip ….….….… --confirm-external-bind --detach
followed by monerod --rpc-bind-ip ….….….… exit
. File an issue on GitHub please if the problem persists. Also, you should comment on an answer here, rather than post a comment as an answer.
I know my response is a little bit too late. But I would like to suggest something for those who had encounter the same problems. The following is applicable with monero gui version 18.3.1 monerod. ( I still don't have any idea if it is applicable for other versions...)
Step 1: In the Log Tab under settings of your monero gui, you will see a textbox just type "save" and wait for the confirmation that the blockchain has been saved.
Step 2: After the blockchain has been saved, just type next "stop_daemon" then wait for confirmation. Make sure to check on Task Manager under Processes if monerod isn't running.
After that you could close the monero gui knowing that the blockchain isn't corrupted and saved properly. You might also want to create a backup until the blockchain isn't fully syncronized.
Just copy data.mdb under C:\ProgramData\bitmonero\lmdb If you can not see ProgramData under C: under Organize>Folder and Search Options>View>Check "Show hidden files, folders and drives"...
I hope these would help... Noob!!!