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.
Monero Stack Exchange is a question and answer site for developers and users of the secure, private and untraceable cryptocurrency Monero. It only takes a minute to sign up.
Sign up to join this communityRun 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?
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.