Repository navigation
Keep the engine in a Type=notify service's cgroup - #117
Merged
Merged
Conversation
systemd accepts sd_notify only from the service's own cgroup, so since the cgroup scopes an engine that signals readiness from its new scope left the unit in "activating". Inside such a service (NOTIFY_SOCKET set) the run now starts the engine without a scope, as before. Measured with the built binary as the main command of a Type=notify user service: activating before, active after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the regression @Bacongineer found in #116: since #112, a
berth runthat is the main command of aType=notifyservice starts its engine in a separate scope. systemd accepts readiness only from the service's own cgroup, so the unit never leavesactivating, even withNotifyAccess=all.Inside such a service (
NOTIFY_SOCKETis set), the run now starts the engine without a scope, as before #112. Everywhere else the scope stays. The escaped-child window stays open only for engines run under a notify service.Proof:
Type=notifyuser service, the child callingsystemd-notify --ready:mainstaysactivating, this branch reachesactive. It ran unleased against a missing socket, so it never touched the live daemon or the card.TestScopeAllowedcovers the decision.go test ./..., Windows build and vet, golangci-lint (0 issues).None of Berth's shipped units are
Type=notify(gateway, berthd and the llama-swap unit aresimple), so the default paths are unchanged.