NAME
sysconf-targets – sysconf multi-file sourcing and write policy
SYNOPSIS
sysconf target [options] [name[[+|-]=value ...]]
DESCRIPTION
This page documents rules shared by every sysconf(8) target that is backed by more than one configuration file. Per-target file lists and syntax quirks are in sysconf-loader(8), sysconf-sysctl(8), sysconf-make(8), sysconf-src(8), sysconf-rc(8), sysconf-poudriere(8), and sysconf-generic(8). Shared options remain in sysconf(8).
Authoritative file
Most targets consult several files in the deterministic order the system sources them at boot. A directive in a later file overrides the same directive in an earlier one, so the last file listing a directive is the authoritative source of its value.
Reads report that authoritative value. Writes are applied to the authoritative file (so the change survives a reboot) or appended to the target's default write file (the first modifiable file listed) when the directive is set nowhere or only in the read-only defaults. Removals (-x) are applied to every file listing the directive, lest deleting the authoritative definition merely unmask an earlier one.
Defaults files
For a target with a defaults file( presently ‘loader’; see sysconf-loader(8)), the boot-time consumer sources the defaults before everything else, and so does sysconf: a directive no conf file mentions still reads back its default (the value that does, in fact, take effect at boot), with -F truthfully naming the defaults file as its source. The defaults file is nevertheless read-only bookkeeping: it is never chosen as a write target, never satisfies a removal, and is never listed by -l or -L (which enumerate only files sysconf may modify).
Those targets additionally support querying defaults: -d reports directive descriptions, -D consults the defaults alone, and -A widens dumps to include directives still at their system default( a named name read always reflects the defaults already; -A changes only -a scope, or dumps everything when given with no name arguments). Attempting any of these against a target with no defaults( make and src have neither a defaults file nor directive descriptions) is an error. The one exception is ‘sysctl -d’, whose descriptions come from the running kernel rather than any file (see sysconf-sysctl(8)).
Explicit file selection
An arbitrary configuration file may be selected with -f, which overrides which file is consulted and modified (the named file alone; multi-file processing is disabled) but never how: the format is always stated explicitly by the target keyword and is never inferred from the file. This composes freely, so a loader.conf(5)-formatted file may be staged anywhere (‘sysconf loader -f /tmp/loader.conf.new ...’) and, conversely, any format may be deliberately applied to any file.
How each built-in format discovers or lists its backing files is implemented by bsdconf_format(3).
LIMITATIONS
sysconf does not evaluate make(1) conditionals (‘.if, .elif, .else, .endif’) or other makefile control flow that may appear in make.conf, src.conf, or src-env.conf.
It also does not consult sys.mk, local.sys.mk, or other make(1) defaults under /usr/share/mk.
Effective values from sysconf therefore match make -V for straight-line assignment and ‘+=’ chains in those conf files, but may differ when the value depends on conditionals or mk defaults.
SEE ALSO
bsdconf_format(3), sysconf(8), sysconf-generic(8), sysconf-loader(8), sysconf-make(8), sysconf-poudriere(8), sysconf-rc(8), sysconf-src(8), sysconf-sysctl(8)
HISTORY
The sysconf utility first appeared in FreeBSD 16.0.
AUTHORS
Devin Teske ⟨[email protected]⟩ Faraz Vahedi ⟨[email protected]⟩