Man page - sysctl.d(5)
Packages contas this manual
- systemd-ask-password-wall.path(8)
- journald@.conf(5)
- systemd-rfkill.service(8)
- systemd-pcrlock-secureboot-authority.service(8)
- org.freedesktop.locale1(5)
- systemd-journald-audit.socket(8)
- bootup(7)
- systemd-hostnamed(8)
- system.conf.d(5)
- os-release(5)
- systemd.exec(5)
- networkd.conf(5)
- systemd-hibernate-resume-generator(8)
- systemd-timedated.service(8)
- networkctl(1)
- systemd-fsck@.service(8)
- systemd-tmpfiles(8)
- systemd-inhibit(1)
- systemd.net-naming-scheme(7)
- systemd-tmpfiles-clean.timer(8)
- systemd-ssh-proxy(1)
- systemd-user-sessions(8)
- logind.conf(5)
- org.freedesktop.network1(5)
- systemd-networkd-wait-online.service(8)
- systemd.kill(5)
- systemd.time(7)
- systemd-ask-password(1)
- systemd.journal-fields(7)
- systemd-socket-proxyd(8)
- pstore.conf.d(5)
- systemd-networkd.service(8)
- systemd-pcrlock-firmware-code.service(8)
- systemd-storagetm.service(8)
- systemd-growfs-root.service(8)
- systemd-ask-password-wall.service(8)
- systemd-creds(1)
- systemd-remount-fs.service(8)
- journald.conf(5)
- systemd-confext.service(8)
- systemd-tty-ask-password-agent(1)
- systemd-binfmt(8)
- systemd-pcrlock-make-policy.service(8)
- systemd-timedated(8)
- systemd-journald.service(8)
- systemd-pcrlock-file-system.service(8)
- pam_systemd_loadkey(8)
- systemd-gpt-auto-generator(8)
- daemon(7)
- systemd-tpm2-setup(8)
- hostnamectl(1)
- systemd-sleep(8)
- systemd-pcrmachine.service(8)
- systemd-bsod.service(8)
- systemd.unit(5)
- systemd-sysctl.service(8)
- systemd-pstore(8)
- binfmt.d(5)
- systemd-network-generator(8)
- systemd-poweroff.service(8)
- systemd-umount(1)
- systemd-tpm2-generator(8)
- systemd-rfkill.socket(8)
- systemd-localed.service(8)
- systemd.path(5)
- systemd-cgls(1)
- journald.conf.d(5)
- systemd-journald@.service(8)
- systemd-sysusers.service(8)
- systemd-user.conf(5)
- systemd-pcrfs@.service(8)
- systemd-measure(1)
- systemd.offline-updates(7)
- systemd-logind(8)
- systemd-machine-id-setup(1)
- systemd-volatile-root.service(8)
- systemd.service(5)
- user@.service(5)
- systemd.target(5)
- systemd-udev-settle.service(8)
- systemd-fsck(8)
- systemd-fsck-usr.service(8)
- user-runtime-dir@.service(5)
- systemd-user-runtime-dir(5)
- systemd-binfmt.service(8)
- systemd-initctl.socket(8)
- systemd-fsck-root.service(8)
- systemd-debug-generator(8)
- file-hierarchy(7)
- systemd-networkd-wait-online(8)
- systemd-volatile-root(8)
- systemd-reboot.service(8)
- systemd-hostnamed.service(8)
- networkd.conf.d(5)
- initrd-release(5)
- systemd.index(7)
- systemd-shutdown(8)
- systemd-update-done.service(8)
- systemd-system-update-generator(8)
- localectl(1)
- systemd.v(7)
- systemd-pcrfs-root.service(8)
- systemd.image-policy(7)
- systemd-backlight@.service(8)
- systemd-battery-check(8)
- systemd-rc-local-generator(8)
- systemd-sysctl(8)
- systemd-kexec.service(8)
- extension-release(5)
- systemd-journald.socket(8)
- systemd-random-seed.service(8)
- systemd-tmpfiles-setup-dev-early.service(8)
- systemd-modules-load(8)
- systemd.network(5)
- systemd-getty-generator(8)
- systemd-storagetm(8)
- systemd.generator(7)
- systemd.special(7)
- systemd-tmpfiles-setup-dev.service(8)
- systemd-notify(1)
- systemd-suspend.service(8)
- localtime(5)
- systemd-journald-varlink@.socket(8)
- systemd-pcrphase.service(8)
- systemd-quotacheck.service(8)
- systemd-pcrlock-firmware-config.service(8)
- systemd-journald@.socket(8)
- systemd-halt.service(8)
- systemd-sysext.service(8)
- systemd-delta(1)
- 30-systemd-environment-d-generator(8)
- systemd-ask-password-console.service(8)
- systemd-confext(8)
- systemd-initctl.service(8)
- iocost.conf(5)
- systemd-logind.service(8)
- systemd-mkswap@.service(8)
- hostname(5)
- busctl(1)
- org.freedesktop.portable1(5)
- systemd-localed(8)
- systemd-id128(1)
- systemd-sleep.conf(5)
- systemd.environment-generator(7)
- systemd-growfs(8)
- systemd(1)
- systemd.device(5)
- systemd-firstboot(1)
- systemd-hibernate-clear.service(8)
- systemd.swap(5)
- tmpfiles.d(5)
- systemd-cat(1)
- systemd-random-seed(8)
- locale.conf(5)
- systemd-detect-virt(1)
- systemd-sysext(8)
- systemd.scope(5)
- systemd-growfs@.service(8)
- systemd-fstab-generator(8)
- systemd-escape(1)
- systemd-network-generator.service(8)
- systemd-tmpfiles-setup.service(8)
- systemd-tmpfiles-clean.service(8)
- sleep.conf.d(5)
- systemd-boot-check-no-failures(8)
- org.freedesktop.systemd1(5)
- systemd-suspend-then-hibernate.service(8)
- run0(1)
- systemd-mount(1)
- systemd.slice(5)
- systemd-user-sessions.service(8)
- systemd-makefs@.service(8)
- journalctl(1)
- systemd-makefs(8)
- systemd-stdio-bridge(1)
- systemd-ssh-generator(8)
- systemd-update-done(8)
- systemd-xdg-autostart-generator(8)
- systemd-soft-reboot.service(8)
- systemctl(1)
- org.freedesktop.machine1(5)
- systemd.timer(5)
- systemd-journald(8)
- systemd-bsod(8)
- systemd-tpm2-setup-early.service(8)
- systemd-hybrid-sleep.service(8)
- systemd-analyze(1)
- smbios-type-11(7)
- systemd-environment-d-generator(8)
- systemd-networkd-wait-online@.service(8)
- org.freedesktop.login1(5)
- systemd-rfkill(8)
- timedatectl(1)
- systemd-hibernate-resume(8)
- systemd-sysv-generator(8)
- kernel-install(8)
- systemd-sysusers(8)
- systemd.netdev(5)
- systemd-journald-dev-log.socket(8)
- systemd-vpick(1)
- machine-id(5)
- systemd-pcrphase-initrd.service(8)
- systemd.mount(5)
- systemd-remount-fs(8)
- systemd.socket(5)
- sysusers.d(5)
- systemd.directives(7)
- rc-local.service(8)
- systemd-run-generator(8)
- systemd-battery-check.service(8)
- systemd-pstore.service(8)
- capsule@.service(5)
- logind.conf.d(5)
- systemd-pcrlock-secureboot-policy.service(8)
- environment.d(5)
- systemd-pcrphase-sysinit.service(8)
- org.freedesktop.hostname1(5)
- modules-load.d(5)
- systemd.automount(5)
- systemd-firstboot.service(1)
- systemd-boot-check-no-failures.service(8)
- loginctl(1)
- systemd.syntax(7)
- systemd-initctl(8)
- kernel-command-line(7)
- systemd.preset(5)
- systemd-pcrlock-machine-id.service(8)
- systemd-run(1)
- systemd-system.conf(5)
- systemd-machine-id-commit.service(8)
- user.conf.d(5)
- systemd.system-credentials(7)
- pstore.conf(5)
- systemd-cgtop(1)
- sysctl.d(5)
- systemd-tpm2-setup.service(8)
- systemd-pcrextend(8)
- systemd-modules-load.service(8)
- systemd.pcrlock.d(5)
- systemd-networkd(8)
- systemd-socket-activate(1)
- systemd-path(1)
- systemd-backlight(8)
- org.freedesktop.timedate1(5)
- systemd-quotacheck(8)
- systemd.resource-control(5)
- systemd-ask-password-console.path(8)
- varlinkctl(1)
- systemd-ac-power(1)
- systemd-hibernate-resume.service(8)
- systemd.pcrlock(5)
- machine-info(5)
- systemd-hibernate.service(8)
- systemd-pcrlock(8)
apt-get install systemd
Available languages:
en zh_TW zh_CN deManual
| SYSCTL.D(5) | sysctl.d | SYSCTL.D(5) |
NAME
sysctl.d - 在啟動時配置核心引數
SYNOPSIS
/etc/sysctl.d/*.conf
/run/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
描述
在系統啟動時, systemd-sysctl.service(8) 根據上面列出的配置檔案設定 sysctl(8)[1] 核心引數。
配置檔案格式
配置檔案的格式是 一系列"KEY=VALUE"行(每行一對)。 空行以及以 "#" 或 ";" 開頭的行都將被忽略。
注意,在KEY內部,可以使用 "/" 或 "." 作為分隔符。 如果第一個分隔符是 "/" , 那麼其餘的分隔符將保持原樣; 如果第一個分隔符是 "." ,那麼互換所有的 "/" 與 "." ; 例如,"kernel.domainname=foo" 等價於 "kernel/domainname=foo" ,都會將 "foo" 寫入 /proc/sys/kernel/domainname 引數中。 同樣的,"net.ipv4.conf.enp3s0/200.forwarding" 等價於 "net/ipv4/conf/enp3s0.200/forwarding" , 都是指 /proc/sys/net/ipv4/conf/enp3s0.200/forwarding 引數。
sysctl.d/ 中的設定將在系統啟動的早期被應用。 針對網路介面的配置, 則會在對應的網路接口出現的時候被應用, 具體說來就是 net.ipv4.conf.*, net.ipv6.conf.*, net.ipv4.neigh.*, net.ipv6.neigh.* 引數。
許多 sysctl 引數僅在載入相應的核心模組之後才可用。 因為核心模組是按需動態載入的 (例如在插入新硬體或啟動網路時), 所以在系統啟動早期執行的 systemd-sysctl.service(8) 無法設定那些依賴於特定核心模組的引數。 對於這些引數, 首選的方法是透過 udev(7) 規則來設定, 次選的方法是將這些模組新增到 modules-load.d(5) 中, 因為 modules-load.d(5) 中的模組會在執行 systemd-sysctl.service(8) 前被無條件的靜態載入(參見"例子"小節)。
配置目錄及其優先順序
配置檔案依次從 /etc/, /run/, /usr/lib/ 目錄中讀取。 配置檔案的名稱必須符合 filename.conf 格式。 對於不同目錄下的同名配置檔案,僅以優先順序最高的目錄中的那一個為準。 具體說來就是: /etc/ 的優先順序最高、 /run/ 的優先順序居中、 /usr/lib/ 的優先順序最低。
軟體包應該將自帶的配置檔案安裝在 /usr/lib/ 目錄中。 /etc/ 目錄僅供系統管理員使用。 所有的配置檔案(無論位於哪個目錄中),統一按照檔名的字典順序處理。 如果在多個配置檔案中設定了同一個選項, 那麼僅以檔名最靠後(字典順序)的那一個為準。 為了便於排序,建議給所有配置檔案 都加上兩位十進位制數字的檔名字首。
如果系統管理員想要遮蔽 /usr/lib/ 目錄中的某個配置檔案, 那麼最佳做法是在 /etc/ 目錄中 建立一個指向 /dev/null 的同名符號連結, 即可徹底遮蔽 /usr/lib/ 目錄中的同名檔案。 如果軟體包自帶的某個配置檔案位於 initrd 映象中, 那麼還必須重新生成 initrd 映象。
例子
Example 1. 設定核心YP域名
/etc/sysctl.d/domain-name.conf:
kernel.domainname=example.com
Example 2. 利用udev規則設定動態核心模組的引數(方法一)
/etc/udev/rules.d/99-bridge.rules:
ACTION=="add", SUBSYSTEM=="module", KERNEL=="br_netfilter", \
RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge"
/etc/sysctl.d/bridge.conf:
net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
因為此方法在載入模組的同時設定模組的引數, 所以僅在載入 br_netfilter 模組之後才能過濾橋接包, 若不想過濾橋接包, 只要不載入 br_netfilter 模組即可。
Example 3. 利用 modules-load.d 目錄設定動態核心模組的引數(方法二)
/etc/modules-load.d/bridge.conf:
br_netfilter
/etc/sysctl.d/bridge.conf:
net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
因為此方法總是無條件的載入 br_netfilter 模組, 並且總是無條件的設定模組的引數, 所以總是無條件的過濾橋接包,若不想過濾橋接包, 必須主動解除安裝 br_netfilter 模組。
參見
systemd(1), systemd-sysctl.service(8), systemd-delta(1), sysctl(8)[1], sysctl.conf(5), modprobe(8)
NOTES
- 1.
- sysctl(8)
跋
本頁面中文版由中文 man 手冊頁計劃提供。
翻譯人員:金步國
金步國作品集:http://www.jinbuguo.com
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
| systemd 231 |