New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quit nicely with bitcoin-cli stop; use simple mode #14442
Conversation
I also had issues stopping/restarting with the prior version, so this is a welcome commit. Was on Debian as well (Raspbian Stretch Lite, Pi3). Working better - restarted successfully! |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
@fanquake It seems somewhat orthogonal to what I was doing in #12255, this commit seems to want to have |
Can't test ATM, what happens when you try to stop or restart if service is already stopped? |
@promag I believe since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colourful-land Upon re-looking at this PR, I'm not sure that we should be stopping the node with bitcoin-cli stop
.
If you look at the Shutdown
section of init.cpp
here:
Lines 102 to 104 in e77a225
// A clean exit happens when StartShutdown() or the SIGTERM | |
// signal handler sets ShutdownRequested(), which makes main thread's | |
// WaitForShutdown() interrupts the thread group. |
It seems that
SIGTERM
is sufficient, and that is the default KillSignal
according to systemd.kill
. I would specify it explicitly, but that's not entirely necessary.
Not running bitcoind
in daemon mode could be helpful, and I would explicitly add printtoconsole
so that logs are available from journald
.
It should be unnecessary if SIGTERM is currently used, as SIGTERM does exactly the same as |
For the "use simple mode" part of this PR, see here (#12255 (comment)) for why it's not a good idea. |
Closing for now, due to comments here as well as in #12255. |
stop bitcoind with
bitcoin-cli stop
(as I Googled around it seem to be the neater way to stop bitcoind)
Put bitcoind to the foreground - Supervision services like systemd usually prefer daemons to be running in the foreground.
Tested on my production server, Debian 9.5.