NAME
sysconf sysctl – configure boot-time sysctl.conf directives
SYNOPSIS
sysconf sysctl [-AcDeFinNqvVx] [-j jail | -R dir] [-f file | -k module] name[[+|-]=value] ...
sysconf sysctl [-ADeFnNqvV] [-f file | -k module] -a
sysconf sysctl [-AaDinNq] -d [name ...]
sysconf sysctl [-E] [-k module] -l | -L
DESCRIPTION
The sysctl target of sysconf(8) reads and modifies sysctl.conf(5) configuration. Shared assignment syntax and options are documented in sysconf(8); multi-file write policy in sysconf-targets(8).
The stock file list is /etc/sysctl.conf, /etc/sysctl.conf.local, then /etc/sysctl.kld.d/module.conf when -k module is given (applied by rc.subr(8) when the module loads).
Values are quoted on write only when the value requires it (embedded whitespace).
When writing to the running system, each name=value is validated against the kernel's sysctl tree first. An OID that cannot be set at run time (non-leaf, read-only, or loader-only tunable) is reported and skipped, while the remaining assignments are still applied. In particular, a loader-only tunable is reported as requiring the loader target instead (see sysconf-loader(8)). Numeric values are also checked against the OID's CTLTYPE( CTLTYPE_INT, CTLTYPE_U64, and the other integer widths) so an overflowing or non-numeric assignment cannot land in sysctl.conf(5) and fail (or apply truncated) when sysctl(8) loads the file at boot.
An unknown OID (often from a module that is not yet loaded) is reported with a warning but still written, matching how init(8) treats such lines in sysctl.conf(5); -i and -q suppress that warning. Validation is skipped entirely under -R, where the target system's kernel is not the running kernel.
-d descriptions for this target come from the running kernel (as with sysctl(8) -d), not from a defaults file.
FILES
- /etc/sysctl.conf
-
Write target for new directives.
- /etc/sysctl.conf.local
-
Site-local overrides.
- /etc/sysctl.kld.d/
-
Module-specific drop-ins (see -k).
EXAMPLES
sysconf sysctl kern.maxfiles=65536
sysconf sysctl -F vfs.usermount
sysconf sysctl -d kern.maxfiles
sysconf sysctl -L
sysconf sysctl -LE
sysconf sysctl -k ipfw net.inet.ip.fw.verbose=1
sysconf -x sysctl vfs.usermount
sysconf -j www sysctl kern.ipc.somaxconn=1024
An overflowing assignment is refused before the file is touched (here an integer OID given a value beyond INT_MAX):
sysconf sysctl security.bsd.see_other_uids=99999999999
SEE ALSO
sysctl.conf(5), sysconf(8), sysconf-loader(8), sysconf-targets(8), sysctl(8)
HISTORY
The sysconf utility first appeared in FreeBSD 16.0.
AUTHORS
Devin Teske ⟨[email protected]⟩ Faraz Vahedi ⟨[email protected]⟩