Repository navigation
feat(operations.bsdinit): Use the service command to enable/disable services on FreeBSD - #2012
Merged
Merged
Conversation
abergeron
force-pushed
the
freebsd_service
branch
from
October 13, 2026 14:39
a0a7f7c to
b720266
Compare
wowi42
approved these changes
Oct 14, 2026
wowi42
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this one, the avahi-daemon rcvar mismatch is a nice catch and service <name> enable is clearly the right tool for it.
I went through the FreeBSD paths in detail: the new ServiceEnabled fact does its job, the service name is properly quoted everywhere, and I like that the two old JSON fixtures now use NetBSD so the rc.conf.local fallback keeps its coverage instead of silently losing it. Also good that existing rc.conf.local entries keep working, so nobody gets a surprise on upgrade.
Ran the bsdinit fixtures against your branch locally, all 18 pass, and CI is green too.
Two tiny nits, neither blocking:
- The prefix strip in
ServiceEnabled.processonly handles the two standard locations, so a service living in a customlocal_startupdir would keep its full path as key and trigger a spurious re-enable. Harmless in practice sinceservice enableis idempotent anyway. - The new fact is a plain
FactBasewithout a type parameter, same as its neighbours in the file, so consistent as-is.
Contributor
Author
|
I should have fixed the two nits. |
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.
This fixes a problem I had with avahi (service script is avahi-daemon but the variable is avahi_daemon) which led to the code trying to add a
avahi-daemon_enabled="YES"line in /etc/rc.conf.local which is a syntax error.Rather than trying to guess what the correct variable name is, I just use service enable/disable to make the edits, similar to what is done for OpenBSD.
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)conventional commits format