OpenRC: fix network deps and support both supervisors#484
Merged
Conversation
The OpenRC documentation covers this pretty well: https://github.com/OpenRC/openrc/blob/master/service-script-guide.md Network daemons almost never "need net": * If nsd listens on 0.0.0.0, it doesn't "need net" because 0.0.0.0 isn't provided by the net service. * If it listens on a specific interface, then "need net" is wrong because it will be satisfied whenever some OTHER interface comes up (too soon). And with set rc_depend_strict=YES, it will come up only when ALL interfaces are up (too late). In the second case, the user has to specify which interface he needs himself. But in either, the "need net" gets removed to make it do the right thing.
With supervisor=supervise-daemon defined in the service script, it is no longer possible for users to override the default supervisor, either in nsd's local conf file or globally in rc.conf. First, we move the setting to the conf file that is meant to be edited. Afterwards, the new default of supervise-daemon is kept, but only when the variable is not already set (say, globally).
Support both start-stop-daemon and supervise-daemon as the $supervisor with a case statement in reload(). The former is still the upstream default when $supervisor is not any of the other options, so we match "*" in that case.
Contributor
|
Nice, looks good to me
|
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.
need netfrom the service dependencies. it's almost always wrong, and is in this case (the commit message explains why).supervisor=line into the conf file. There are some things that s-s-d does that supervise-daemon still cannot do.cc @lanodan