Page MenuHomeFreeBSD

Add support for a /etc/defaults/vendor.conf override file
ClosedPublic

Authored by lidl on Jun 19 2016, 9:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 25, 2:47 PM
Unknown Object (File)
Jan 30 2024, 12:39 PM
Unknown Object (File)
Jan 30 2024, 12:39 PM
Unknown Object (File)
Dec 22 2023, 9:09 PM
Unknown Object (File)
Nov 27 2023, 2:03 AM
Unknown Object (File)
Nov 27 2023, 2:03 AM
Unknown Object (File)
Nov 12 2023, 8:36 PM
Unknown Object (File)
Oct 9 2023, 7:41 PM
Subscribers

Details

Summary

It would be really handy to have a place to hook in overrides for the system defaults
for daemons to be enabled, and their flags. Vendors who ship products based around
FreeBSD typically have to enable a bunch of product specific overrides to the daemons
that need to be run.

Rather than putting all these settings in /etc/rc.conf, which might also have a
bunch of per-machine settings. Standardize this by adding a /etc/defaults/vendor.conf settings file.

Test Plan

Tested on a virtual machine. Daemons enabled in /etc/defaults/vendor.conf are now started, without being references in /etc/rc.conf.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

lidl retitled this revision from to Add support for a /etc/rc.vendor override file.
lidl updated this object.
lidl edited the test plan for this revision. (Show Details)
lidl added reviewers: rpaulo, dteske, stas.
lidl set the repository for this revision to rS FreeBSD src repository - subversion.

This looks good, but I'm a little bit confused as to how it is different from rc.local? Does it provide anything which can't be achieved by using rc.local which seems to serve the same purpose?

The rc.local execution happens much later in the startup process, after daemons, etc have already started being executed.

This hook happens much earlier, so a vendor shipping a product based on FreeBSD can still ship a completely 'stock' /etc/defaults/rc.conf, yet still be able to have complete control over the start state for all the FreeBSD supplied daemons on the system, and their flags.

One could even use this to override to alter the set of directories that should be searched for for additional startup files for any services/daemons that a vendor might supply for their product.

stas edited edge metadata.

I see, thanks for the explanation. It would be perfect to add a short version of it to the commit message as well.

This revision is now accepted and ready to land.Jun 20 2016, 9:29 PM
lidl retitled this revision from Add support for a /etc/rc.vendor override file to Add support for a /etc/defaults/vendor.conf override file.
lidl updated this object.
lidl edited the test plan for this revision. (Show Details)
lidl edited edge metadata.

I found my email exchange with Devin from earlier this year, and reworked the patch to follow his suggestions. The net effect is the same, a vendor supplied defaults files is sourced at the same point in the execution, just now named "/etc/defaults/vendor.conf" to match the other files named /etc/defaults/*.conf

By hooking it in the /etc/defaults/rc.conf, it makes it easier to override the "source_rc_confs"
function as well, if that level of customization was wanted/needed too. Unlikely, but now possible.

This revision now requires review to proceed.Jun 20 2016, 10:45 PM
stas edited edge metadata.
This revision is now accepted and ready to land.Jun 21 2016, 6:34 PM
etc/defaults/rc.conf
745 ↗(On Diff #17717)

I'd suggest this comment instead:

\# Allow vendors to override normal FreeBSD defaults in /etc/default/rc.conf
\# without the need to carefully manage /etc/rc.conf.

imp added a reviewer: imp.
etc/defaults/rc.conf
745 ↗(On Diff #17717)

OK, I will change the comment to that text when/if this gets committed.

This revision was automatically updated to reflect the committed changes.