bitcoind ignores -printtoconsole flag #10132

issue UniversalBinary opened this issue on March 31, 2017
  1. UniversalBinary commented at 8:19 AM on March 31, 2017: none

    When bitcoind is started from a terminal with the -printtoconsole switch (e.g. bitcoind -daemon -server -printtconsole) it prints a few lines and then exits, the daemon continues to run and accept RPC commands but no debugging info is printed on the screen as it should be.

    bitcoin-qt behaves as it should, the problem is only with bitcoind. I have tested this with the official build of v0.14.0 (64-bit) on linux and the MacPorts build of the same version on macOS.

  2. laanwj commented at 10:00 AM on March 31, 2017: member

    Don't combine -daemon and -printtoconsole. They do opposite things. -daemon detaches the process from the terminal, -printtoconsole prints to the terminal. You just won't see it because the process has no controlling terminal anymore.

    The reason that it works for the GUI is because -daemon is ignored for that. Daemons are background processes, while GUIs are decidedly foreground processes.

  3. laanwj closed this on Mar 31, 2017

  4. UniversalBinary commented at 2:27 PM on March 31, 2017: none

    I have just tried the command with the -daemon switch removed and it is still failing. This also does not explain why this argument combination works with previous versions of bitcoind and with other altcoins such as litecoind.

  5. UniversalBinary commented at 2:43 PM on March 31, 2017: none

    Removing daemon=1 from the bitcoin.conf as well, does now make it behave as it should. However, it still does not explain why it works with other versions and coins. This must be a change to the 0.14 code which enforces the proper behaviour of the -daemon switch, were it was overlooked before. It should have been mentioned in the release notes.

  6. sipa commented at 6:22 PM on March 31, 2017: member

    @UniversalBinary Yes, Bitcoin Core properly daemonizes only since v0.14.0: https://github.com/bitcoin/bitcoin/pull/8813

  7. viertelb commented at 2:10 PM on September 4, 2019: none

    What happens if bitcoind is started with -printtoconsole (not a daemon) but then the terminal is closed (e.g. laptop hibernation). In my view the process keeps on running as daemon then.

  8. bitcoin 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-20 08:55 UTC

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