Skip to content

contrib: Make systemd invoke dependencies only when ready #21418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Mar 11, 2021

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.

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 8f249cb

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 8f249cb

@laanwj
Copy link
Member Author

laanwj commented Mar 16, 2021

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.

@darosior
Copy link
Member

Agree

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

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

Closes bitcoin#21322 by making bitcoind conform to behavior specified for
`type=forking`.
@laanwj laanwj force-pushed the 2021-03-systemd-daemonwait branch from 8f249cb to 663f6cd Compare March 22, 2021 12:42
@laanwj
Copy link
Member Author

laanwj commented Mar 22, 2021

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.

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 663f6cd

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK 663f6cd

@laanwj laanwj merged commit c46f1ce into bitcoin:master Mar 22, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 22, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

contrib: Current systemd usage doesn't allow for dependencies
4 participants