contrib: Make systemd invoke dependencies only when ready #21418

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2021-03-systemd-daemonwait changing 1 files +2 −1
  1. laanwj commented at 2:34 pm on March 11, 2021: member

    Make systemd invoke dependencies only when ready by using -daemonwait in the service file instead of -daemon.

    Closes #21322 by making bitcoind conform to behavior specified for type=forking.

    This may need some tuning of timeouts.

  2. laanwj added the label Scripts and tools on Mar 11, 2021
  3. darosior approved
  4. darosior commented at 2:37 pm on March 11, 2021: member
    ACK 8f249cba4101787d9f7389bdf3bbe1ed0b50a16d
  5. hebasto approved
  6. hebasto commented at 6:01 pm on March 11, 2021: member
    ACK 8f249cba4101787d9f7389bdf3bbe1ed0b50a16d
  7. laanwj commented at 7:22 am on March 16, 2021: member

    This may need some tuning of timeouts.

    Just to be sure I checked this. However we don’t have a timeout configured for startup phase at all; this is

    TimeoutStartSec= Configures the time to wait for start-up. If a daemon service does not signal start-up completion within the configured time, the service will be considered failed and will be shut down again. Takes a unit-less value in seconds, or a time span value such as “5min 20s”. Pass “infinity” to disable the timeout logic. Defaults to DefaultTimeoutStartSec= from the manager configuration file, except when Type=oneshot is used, in which case the timeout is disabled by default (see systemd-system.conf(5)).

    We might want to set this to infinity—the startup phase (including the 6-deep block database integrity check) can take a lot of time it is hard to put an upper bound on it. In any case I expect the service default to be too low.

  8. darosior commented at 10:36 am on March 20, 2021: member

    Agree

    In any case I expect the service default to be too low.

    man systemd-system.conf says that DefaultTimeoutStartSec defaults to 90s

  9. contrib: Use -daemonwait in systemd init script
    Closes #21322 by making bitcoind conform to behavior specified for
    `type=forking`.
    663f6cd9dd
  10. laanwj force-pushed on Mar 22, 2021
  11. laanwj commented at 12:42 pm on March 22, 2021: member

    man systemd-system.conf says that DefaultTimeoutStartSec defaults to 90s

    Thank you for checking. I have set TimeoutStartSec=infinity for now. I don’t think there is a need for a timeout here. Startup timeout is meant for things like network and remote filesystem bringup which hold up the entire boot, eventually one would want to continue and be able to fix whatever the issue is. I would hope no one configures bitcoind as part of that chain, so it can always be manually shut down when necessary.

  12. darosior approved
  13. darosior commented at 12:59 pm on March 22, 2021: member
    ACK 663f6cd
  14. hebasto approved
  15. hebasto commented at 1:50 pm on March 22, 2021: member
    re-ACK 663f6cd9ddadeec30b27ec12f0f5ed49f3146cc9
  16. laanwj merged this on Mar 22, 2021
  17. laanwj closed this on Mar 22, 2021

  18. sidhujag referenced this in commit f6e1e1d105 on Mar 22, 2021
  19. DrahtBot locked this on Aug 16, 2022

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-22 03:12 UTC

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