quit nicely with bitcoin-cli stop; use simple mode #14442

pull weiwu-zhang wants to merge 1 commits into bitcoin:master from weiwu-zhang:master changing 1 files +2 −2
  1. weiwu-zhang commented at 8:08 AM on October 9, 2018: none
    • 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.

  2. quit nicely with bitcoin-cli stop; use simple mode adc9af9a7b
  3. ch4ot1c commented at 2:27 PM on October 9, 2018: contributor

    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!

  4. DrahtBot commented at 2:50 PM on October 9, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #12255 (Update bitcoin.service to conform to init.md by dongcarl)

    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.

  5. fanquake added the label Scripts and tools on Oct 10, 2018
  6. fanquake commented at 2:15 AM on October 10, 2018: member

    @dongcarl can you comment on how this overlaps with #12255

  7. dongcarl commented at 2:37 AM on October 10, 2018: member

    @fanquake It seems somewhat orthogonal to what I was doing in #12255, this commit seems to want to have systemd handle the daemonizing of bitcoind, whereas my change explicitly configures the pid file location such that systemd has a way to reach bitcoind. I am fine with either approach, and will rebase my commit sometime.

  8. promag commented at 6:33 PM on November 4, 2018: member

    Can't test ATM, what happens when you try to stop or restart if service is already stopped?

  9. dongcarl commented at 6:37 PM on November 4, 2018: member

    @promag I believe since systemd handles the daemonizing of bitcoind, if bitcoind is stopped directly (through bitcoin-cli or via a kill signal), the systemd service will also be stopped.

  10. dongcarl commented at 2:52 AM on December 3, 2018: member

    @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: https://github.com/bitcoin/bitcoin/blob/e77a2258e4daff20202178bba6b9fb8c757823de/src/init.cpp#L102-L104 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.

  11. laanwj commented at 1:36 PM on January 2, 2019: member

    It should be unnecessary if SIGTERM is currently used, as SIGTERM does exactly the same as bitcoin-cli stop

  12. dongcarl commented at 7:22 AM on January 5, 2019: member

    For the "use simple mode" part of this PR, see here (https://github.com/bitcoin/bitcoin/pull/12255#discussion_r245387019) for why it's not a good idea.

  13. fanquake commented at 10:00 AM on January 5, 2019: member

    Closing for now, due to comments here as well as in #12255.

  14. fanquake closed this on Jan 5, 2019

  15. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me