-rpcwait on stop #3349

issue laanwj opened this issue on December 3, 2013
  1. laanwj commented at 10:36 AM on December 3, 2013: member

    There is now (#3283) an option to wait for the daemon to start. It would also be useful to be able to wait for the daemon to stop.

  2. laanwj commented at 6:22 PM on September 23, 2015: member

    Closing this, I don't think this can be achieved in bitcoin-cli, through RPC.

    I still think this functionality is seful; e.g. I have a deploy script for a few nodes that stops them, uploads a new version of bitcoind, and starts them again. But that needs to be sure that the daemon is no longer running. But as this is local-only I'm going to use an external script that just waits for the pid to die, e.g.:

        pid_t pid = ReadPidFile(); 
        while(kill(pid, 0) == 0)
            usleep(250000);
    
  3. laanwj closed this on Sep 23, 2015

  4. Bushstar referenced this in commit 4c01ca4573 on Apr 8, 2020
  5. laanwj reopened this on Mar 1, 2021

  6. laanwj removed the label Refactoring on Mar 1, 2021
  7. laanwj added the label RPC/REST/ZMQ on Mar 1, 2021
  8. laanwj added the label Utils/log/libs on Mar 1, 2021
  9. laanwj commented at 5:36 PM on March 1, 2021: member

    Reopening this. I still often would like this functionality.

    At least on UNIX it can be implemented by waiting for the PID in the PID file to exit. Alternatively, for the data directory lock file to be unlocked? (Neither of these work cross-host, but I am fine with that limitation if mentioned explicitly)

    (one case where it is useful is for restarting bitcoind when it's running in the backgound, need to be sure what it's quit entirely)

  10. laanwj added the label Feature on Mar 1, 2021
  11. laanwj closed this on Apr 14, 2022

  12. DrahtBot locked this on Apr 14, 2023

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-13 15:16 UTC

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