Page MenuHomeFreeBSD

sysctl.conf(5): Add support for sysctl.conf.d
Needs ReviewPublic

Authored by agh_riseup.net on Sat, May 9, 7:24 AM.
Tags
None
Referenced Files
F158003043: D56898.id177521.diff
Wed, May 27, 9:27 AM
F158002422: D56898.id177521.diff
Wed, May 27, 9:18 AM
F157947707: D56898.id177491.diff
Tue, May 26, 7:33 PM
F157947320: D56898.id177491.diff
Tue, May 26, 7:24 PM
F157944241: D56898.id177519.diff
Tue, May 26, 6:23 PM
Unknown Object (File)
Tue, May 26, 6:15 PM
Unknown Object (File)
Tue, May 26, 4:44 AM
Unknown Object (File)
Sun, May 24, 8:14 PM

Details

Summary

Currently the sysctl(8) rc(8) service is limited to searching only
/etc/sysctl.conf, and /etc/sysctl.conf.local to configure kernel state
(Management Information Base (MIB)). The current limitation leads to
polluting /etc (for users' who prefer to leave /etc/ read-only), and
restricts users from codifying MIB namespace scope in sysctl.conf(5),
this prohibits a cleaner, and modular design to managing host MIB
information. Adding the ability to separate a machines MIB state across
any number of configuration files, under a user's chosen namespace
overcomes this limitation

  • Add /etc/sysctl.conf.d to the sysctl(8) rc(8) service
  • Add /etc/sysctl.conf.d to ${SRC}/etc/mtree/BSD.root.dist to tag the directory for the pkgbase FreeBSD-rc package
  • Update stock sysctl.conf referring to /etc/sysctl.conf.d
  • Update the sysctl.conf(5) man page to reflect the addition of /etc/sysctl.conf.d for modular MIB customizations, and complete the history

This patch is based on the original work (reviews.freebsd.org/D32128) by
Antranig Vartanian <antranigv@freebsd.am>

Relnotes: Yes

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72957
Build 69840: arc lint + arc unit

Event Timeline

agh_riseup.net updated this revision to Diff 177480.

Updated diff with D${num}

I am not sure on the sorting in the man page.

Can you please regenerate this with context, preferably using devel/freebsd-git-arc?

Sure I will give it a shot. Is this because my git formatted-patch was striped of the preamble?

No, it's because you uploaded a unidiff with only three lines of context.

Should the directory be tagged as rc, similar to https://reviews.freebsd.org/D56900?

Yes please, and remove the leading zero in the date.

Uploaded git-arc patch.

agh_riseup.net retitled this revision from Add support for sysctl.conf.d to sysctl.conf(5): Add support for sysctl.conf.d.
agh_riseup.net edited the summary of this revision. (Show Details)

👍 +1! I Approve! Thank you! directorize all the things!

Should we add a comment to the stock sysctl.conf?

Please add Relnotes: yes to the commit message.

In D56898#1303538, @des wrote:

Should we add a comment to the stock sysctl.conf?

Yes, I think that is a great idea.

Please add Relnotes: yes to the commit message.

Will do.

Please add Relnotes: yes to the commit message.

Please add Relnotes: yes to the commit message.

Will do.

Wait, that has to be done when/if the diff is merged to the Tree?

Please add Relnotes: yes to the commit message.

Please add Relnotes: yes to the commit message.

Will do.

Wait, that has to be done when/if the diff is merged to the Tree?

You can add it now

Just update the phabricator summary

agh_riseup.net edited the summary of this revision. (Show Details)
  • Update stock sysctl.conf
  • Update man page date

Correct typo in sbin/sysctl/sysctl.conf:
"to through to" becomes "through to"

👍 +1! I Approve! Thank you! directorize all the things!

And then UCL all the things?

I noticed that could I edit the Summary to correctly attribute the author, you.

sbin/sysctl/sysctl.conf
7

They're not “piped through” to sysctl(8), they're read directly by sysctl(8).

share/man/man5/sysctl.conf.5
36

I think we should add a sentence about /etc/sysctl.conf.d either here or before the paragraph about /etc/sysctl.kld.d.

sbin/sysctl/sysctl.conf
7

OK, this is easily rectified.

share/man/man5/sysctl.conf.5
36

What about a paragraph similar to the 2nd paragraph in sbin/sysctl/sysctl.conf above?

The files /etc/sysctl.conf, /etc/sysctl.conf.local and any .conf file(s) in the directory /etc/sysctl.conf.d are read when the system goes into multi-user mode to set default settings for the kernel. The structure of these configuration files is in the format of the sysctl(8) command, i.e.,

Then above sysctl.kld.d.,
The /etc/sysctl.conf.d exists to reduce management burden of kernel settings cluttering a single configuration file. Possible scenarios are for performance tuning or investigation, or separating out MIB node specific settings into separate files, or sharing common settings across a number of hosts.

Another solution, move /etc/sysctl.conf.d to EXAMPLES, and provide two or three examples there?

share/man/man5/sysctl.conf.5
36

These both seem fine to me.

I noticed that could I edit the Summary to correctly attribute the author, you.

There's very little of Antranig's work in this patch. Crediting him as inspiration in the commit message is fine, attributing the commit to him is not.

sysctl.conf(5): Add support for sysctl.conf.d

Update with new changes to man page and stock sysctl.conf

Differential Revision: https://reviews.freebsd.org/D56898

Man page was checked with mandoc -T lint, igor, and aspell check --lang=en --mode=nroff as per the Documentation Project Primer for New Contributors, the only issue was a lack of SYNPOSIS