Utils: Fix launchctl not being able to stop bitcoind #11419

pull OmeGak wants to merge 1 commits into bitcoin:master from OmeGak:fix-macos-init changing 1 files +0 −1
  1. OmeGak commented at 9:16 AM on September 29, 2017: contributor

    bitcoind should not be launched as daemon from the Launch Agent. Otherwise, the process cannot be stopped from launchctl stop/launchctl unload.

    To reproduce the issue:

    $ launchctl load ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist
    $ pgrep -fla bitcoin
    60225 /usr/local/opt/bitcoin/bin/bitcoind
    $ launchctl unload ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist
    

    Wait a few seconds and then run pgrep again:

    $ pgrep -fla bitcoin
    60225 /usr/local/opt/bitcoin/bin/bitcoind
    

    The node is still running. This happens because Launch Agent is not supposed to run programs as daemons, since the agent makes sure they run in the background. Running them as daemons makes the Launch Agent lose control of the process and, so, it cannot be stopped.

  2. Fix launchctl not being able to stop bitcoind
    bitcoind should not be launched as daemon from launchctl. Otherwise, the
    process cannot be stopped from launchctl.
    ab5bba7783
  3. MarcoFalke added the label Scripts and tools on Sep 29, 2017
  4. promag commented at 9:54 PM on October 1, 2017: member

    utACK ab5bba7.

  5. fanquake commented at 2:16 AM on October 2, 2017: member

    @OmeGak Do these instructions need updating after this change?

  6. promag commented at 6:57 AM on October 2, 2017: member

    @fanquake I did verified that and it LGTM, unless you want to add the how to stop the service example (IIRC others don't have).

  7. fanquake commented at 7:01 AM on October 2, 2017: member

    @promag No that's fine. Just wanted to make sure that the docs were still correct.

    utACK ab5bba7

  8. jonasschnelli approved
  9. jonasschnelli commented at 3:12 AM on October 4, 2017: contributor

    ACK ab5bba7783d2927e513af91e6c89c41bdfa47964

  10. jonasschnelli added the label MacOSX on Oct 4, 2017
  11. jonasschnelli merged this on Oct 4, 2017
  12. jonasschnelli closed this on Oct 4, 2017

  13. jonasschnelli referenced this in commit 093074b843 on Oct 4, 2017
  14. quiquee commented at 5:17 PM on October 4, 2017: none

    Cool ! These small things matter

  15. PastaPastaPasta referenced this in commit 8ee5ca95a7 on Jan 31, 2020
  16. PastaPastaPasta referenced this in commit 5d636bc6ab on Jan 31, 2020
  17. PastaPastaPasta referenced this in commit 15d2c0d8ce on Feb 4, 2020
  18. PastaPastaPasta referenced this in commit 1017bbb84e on Feb 9, 2020
  19. deadalnix referenced this in commit a99a884db8 on Oct 29, 2020
  20. ckti referenced this in commit 697ac10fda on Mar 28, 2021
  21. DrahtBot locked this on Sep 8, 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-04-21 18:15 UTC

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