Skip to content
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

Use s6-notifyoncheck to check for services startup readiness #1665

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

yubiuser
Copy link

Having a fixed startup order of services is necessary in case services depend on each other. To manage startup, s6 is used and startup order is fixed by setting dependencies. However, there is a difference between starting a service and a service being ready. So far, the existence of a PIDis used to check for a complete startup - but this is error prone and the existence of a PID does not really guarantees readiness. Especially avahi needs a long time before it will signal complete startup. Setting arbitrary sleep times only mitigates the issue but does not solve it.

Init services use the concept of startup notifications where the started service signals the supervisor when it's ready. Unfortunately, dbus and avahi do not use the startup notification s6 uses (see here). But s6 offers s6-notifyoncheck to poll for service readiness.

Using a check script that polls the started service allows to signal s6 when the service is ready. Neither dbus nor avahi offer a good check by themselves (avahi-daemon --check only check if a daemon is running, but probably not if it's ready), so a workaround is used: as the services offer a dbus interface, this is used to check it the service is really ready.

DBus check inspired by mobinmob/void-66-services#52

Signed-off-by: Christian König <ckoenig@posteo.de>
@mikebrady mikebrady merged commit 6e7f40a into mikebrady:development Apr 22, 2023
@yubiuser yubiuser deleted the s6-notifyoncheck branch April 22, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants