An option for a shell command that runs just before bitcoind completes shutting down. #27984

issue ZenulAbidin openend this issue on June 27, 2023
  1. ZenulAbidin commented at 11:43 am on June 27, 2023: contributor

    Please describe the feature you’d like to see added.

    It basically works similar to the blocknotify config option which runs a shell script when a block is mined, but the purpose of this new option is different.

    It can be called something like “shutdowncomplete” and a shell command is passed to it as an argument, which then runs just before the following message is printed in debug.log:

    02023-06-26T14:00:07Z Shutdown: done
    

    It can be ran utilizing a function such as runCommand.

    The reason such an option will be useful is to support automatic updates of Bitcoin Core to newer version. Some 3rd-party program used for detecting new Bitcoin Core releases on bitcoincore.org, downloading/verifying them, installing them to /usr/local or wherever the user-specified path is or alternatively running an installer, needs to be able to stop Bitcoin Core first and know when the process is about to quit so that it can proceed with installing (following which it simply runs the new version of Bitcoin daemon and exits).

    Currently this can be done by detecting the bitcoind process, but it’s not portable across multiple operating systems, which all have wildly different Process APIs.

    The problem is: How can Bitcoin Core make it easier to create external programs for automatically updating installations to the newest version?

    Describe the solution you’d like

    As specified above, a command-line & config option for running a shell script right before shutdown is the solution for facilitating automatic updates of bitcoin core (similar to stuff like Livepatch and k-splice for the linux kernel).

    Describe any alternatives you’ve considered

    As noted, the bitcoind process can be detected in the running process lists, but this can cause a deadlock inside applications if Bitcoin Core takes a long time to shut down (eg. a network thread takes too long to exit).

    Please leave any additional context

    None.

  2. ZenulAbidin added the label Feature on Jun 27, 2023
  3. fanquake commented at 11:48 am on June 27, 2023: member
    We already have shutdownnotify.
  4. maflcko closed this on Jun 28, 2023

  5. bitcoin locked this on Jun 27, 2024

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: 2024-12-21 15:12 UTC

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