Repository navigation
PORTW-17: Keep cgroup-based systemd matching and say what a stop affects - #31
Merged
Merged
Conversation
Matching stays cgroup-based: workers of nginx-style services hold the port too, and signalling them is undone by the master. The explanation now says whether the holder is the main process and that systemctl stop ends the whole unit.
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.
Issue: https://youtrack.xn--wrm-hoa.li/issue/PORTW-17
Decision: the systemd detector keeps matching every process inside a service's cgroup instead of restricting the match to the unit's MainPID. For services such as nginx the master and its workers all hold the port; a MainPID-only match would send the workers to the generic fallback, where a signal is undone when the master respawns them and the port stays busy. Stopping the unit is the action that frees the port, the prompt already shows the exact command, and confirmation stays mandatory. The own-unit protection is unchanged.
What changes:
systemctl [--user] show -p Restart -p MainPID <unit>, parsed as Key=Value lines so property order does not matter.Role: the holder is the main process or a child process of the unit. It is omitted when MainPID is missing or invalid; the match still happens.systemctl stopends the whole unit, including every process in it.Commits:
Review: independent review PASS on 1dd22b3.