Man page - systemd(1)
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 fr zh_TW zh_CN deManual
| SYSTEMD(1) | systemd | SYSTEMD(1) |
NAME
systemd, init - systemd 系統與服務管理器
SYNOPSIS
systemd [OPTIONS...]
init [OPTIONS...] {COMMAND}
描述
systemd 是一個專用於 Linux 作業系統的系統與服務管理器。 當作為啟動程序(PID=1)執行時,它將作為初始化系統執行, 也就是啟動並維護各種使用者空間的服務。
為了與傳統的 SysV 相容,如果將 systemd 以 init 名稱啟動,並且"PID≠1",那麼它將執行 telinit 命令並將所有命令列引數原封不動的傳遞過去。 這樣對於普通的登陸會話來說,無論是呼叫 init 還是呼叫 telinit 都是等價的。 詳見 telinit(8) 手冊。
當作為系統例項執行時, systemd 將會按照 system.conf 配置檔案 以及 system.conf.d 配置目錄中的指令工作; 當作為使用者例項執行時,systemd 將會按照 user.conf 配置檔案 以及 user.conf.d 配置目錄中的指令工作。詳見 systemd-system.conf(5) 手冊。
選項
能夠識別的命令列選項如下:
--test
--dump-configuration-items
--unit=
--system, --user
--dump-core
--crash-vt=VT
--crash-shell
--crash-reboot
--confirm-spawn
--show-status=
--log-target=
--log-level=
--log-color=
--log-location=
--default-standard-output=, --default-standard-error=
--machine-id=
-h, --help
--version
概念
systemd 將各種系統啟動和執行相關的物件, 表示為各種不同型別的單元(unit), 並提供了處理不同單元之間依賴關係的能力。 大部分單元都靜態的定義在單元檔案中 (參見 systemd.unit(5) 手冊), 但是有少部分單元則是動態自動生成的: 其中一部分來自於其他傳統的配置檔案(為了相容性), 而另一部分則動態的來自於系統狀態或可程式設計的執行時狀態。 單元既可以處於活動(active)狀態也可以處於停止(inactive)狀態, 當然也可以處於啟動中(activating)或停止中(deactivating)的狀態。 還有一個特殊的失敗(failed)狀態, 意思是單元以某種方式失敗了 (程序崩潰了、或者觸碰啟動頻率限制、或者退出時返回了錯誤程式碼、或者遇到了操作超時之類的故障)。 當進入失敗(failed)狀態時, 導致故障的原因將被記錄到日誌中以方便日後排查。 需要注意的是, 不同的單元可能還會有各自不同的"子狀態", 但它們都被對映到上述五種狀態之一。
各種不同的單元型別如下:
單元的名稱由單元檔案的名稱決定, 某些特定的單元名稱具有特殊的含義,詳情參見 systemd.special(7) 手冊。
systemd 能夠處理各種型別的依賴關係, 包括依賴與衝突(也就是 Requires= 與 Conflicts= 指令), 以及先後順序(也就是 After= 與 Before= 指令)。 注意, 上述兩種型別的依賴關係(依賴與衝突、先後順序)之間是相互獨立的(無關的)。 舉例來說,假定 foo.service 依賴於(Requires) bar.service 但並未指定先後順序, 那麼這兩個服務將被同時並行啟動。 不過在兩個單元之間既存在依賴關係也存在先後順序的情形也很常見。 另外需要注意的是, 大多數依賴關係都是由 systemd 隱式建立和維護的, 因此沒有必要額外手動建立它們。
應用程式和單元(透過依賴關係)可能會查詢其他單元的狀態變化。 在 systemd 中, 這種查詢被包裝為"任務"(job)並被作為"任務佇列"進行管理。 任務的執行結果可能成功也可能失敗, 但是任務的執行順序是依照任務所屬單元之間的先後順序確定的。
在系統啟動時,systemd 預設啟動 default.target 單元, 該單元中應該包含所有你想在開機時預設啟動的單元。 但實際上,它通常只是一個指向 graphical.target (圖形介面) 或 multi-user.target (命令列介面,常用於嵌入式或伺服器環境, 一般是 graphical.target 的一個子集)的符號連線。 詳見 systemd.special(7) 手冊。
systemd 依賴於核心提供的 cgroups[1] 特性控制程序的派生, 從而確保可以追蹤到所有子程序。 cgroups 資訊由核心負責維護, 並且可以透過 /sys/fs/cgroup/systemd/ 介面進行訪問。此外,還可以透過 systemd-cgls(1) 或 ps(1) 之類的工具進行檢視 (ps xawf -eo pid,user,cgroup,args)
systemd 幾乎完全相容傳統的 SysV init 系統: SysV init 指令碼可以作為另一種配置檔案格式被識別; 提供與 SysV 相容的 /dev/initctl 介面; 提供各種 SysV 工具的相容實現; 依然相容例如 /etc/fstab 或者 utmp 之類傳統的 Unix 特性。
systemd 還有一個小型的事務系統: 如果要啟動或關閉一個單元, 那麼該單元所依賴的 所有其他單元都會被一起加入到同一個臨時事務中。 這樣,就可以校驗整個事務的一致性, 也就是檢查是否存在迴圈依賴。 如果存在迴圈依賴, 那麼 systemd 將會嘗試透過 去掉弱依賴(want)來解決這個問題, 如果最終實在無法解決迴圈依賴的問題, 那麼 systemd 將會報錯。
systemd 內建了許多系統啟動過程中必需的操作, 例如,設定 hostname 以及配置 loopback 網路裝置, 以及掛載 /sys 和 /proc 檔案系統。
在系統啟動或者執行 systemctl reload ... 時, systemd 可以根據其他配置檔案或者核心引導選項動態生成單元,參見 systemd.generator(7) 手冊。
如果要從容器中呼叫 systemd 那麼必須遵守 Container Interface[2] 規範。 如果要從 initrd 中呼叫 systemd 那麼必須遵守 initrd Interface[3] 規範。
目錄
系統單元目錄
使用者單元目錄
SysV啟動指令碼目錄(不同發行版之間差別可能很大)
SysV執行級目錄(不同發行版之間差別可能很大)
訊號
SIGTERM
systemd 使用者例項將會啟動 exit.target 單元。 基本上相當於執行 systemctl --user start exit.target 命令。
SIGINT
systemd 使用者例項處理此訊號的方式與 SIGTERM 相同。
SIGWINCH
systemd 使用者例項將會完全忽略此訊號。
SIGPWR
SIGUSR1
SIGUSR2
SIGHUP
SIGRTMIN+0
SIGRTMIN+1
SIGRTMIN+2
SIGRTMIN+3
SIGRTMIN+4
SIGRTMIN+5
SIGRTMIN+6
SIGRTMIN+13
SIGRTMIN+14
SIGRTMIN+15
SIGRTMIN+16
SIGRTMIN+20
SIGRTMIN+21
SIGRTMIN+22, SIGRTMIN+23
SIGRTMIN+24
SIGRTMIN+26, SIGRTMIN+27, SIGRTMIN+28
環境變數
$SYSTEMD_LOG_LEVEL
$SYSTEMD_LOG_TARGET
$SYSTEMD_LOG_COLOR
$SYSTEMD_LOG_LOCATION
$XDG_CONFIG_HOME, $XDG_DATA_HOME
$SYSTEMD_UNIT_PATH
$SYSTEMD_SYSVINIT_PATH
$SYSTEMD_SYSVRCND_PATH
$SYSTEMD_COLORS
$LISTEN_PID, $LISTEN_FDS, $LISTEN_FDNAMES
$NOTIFY_SOCKET
核心引導選項
當作為系統例項執行的時候, systemd 能夠接受下面列出的核心引導選項。[5]
systemd.unit=, rd.systemd.unit=
systemd.dump_core=
systemd.crash_chvt=
systemd.crash_shell=
systemd.crash_reboot=
systemd.confirm_spawn=
systemd.show_status=
systemd.log_target=, systemd.log_level=, systemd.log_color=, systemd.log_location=
systemd.default_standard_output=, systemd.default_standard_error=
systemd.setenv=
systemd.machine_id=
quiet
debug
emergency, rd.emergency, -b
rescue, rd.rescue, single, s, S, 1
2, 3, 4, 5
locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION=
更多核心引導選項的解釋, 參見 kernel-command-line(7) 手冊。
SOCKETS 與 FIFOS
/run/systemd/notify
/run/systemd/private
/dev/initctl
參見
systemd Homepage[6], systemd-system.conf(5), locale.conf(5), systemctl(1), journalctl(1), systemd-notify(1), daemon(7), sd-daemon(3), systemd.unit(5), systemd.special(5), pkg-config(1), kernel-command-line(7), bootup(7), systemd.directives(7)
NOTES
- 1.
- cgroups
- 2.
- Container Interface
- 3.
- initrd Interface
- 4.
- XDG Base Directory specification
- 5.
- 當 systemd 在 Linux 容器中執行的時候, 這些引數可以直接在 systemd 命令列上傳遞(放置在所有命令列選項之後), 當 systemd 不在 Linux 容器中執行的時候, 這些引數將從 /proc/cmdline 中獲取。
- 6.
- systemd Homepage
跋
本頁面中文版由中文 man 手冊頁計劃提供。
翻譯人員:金步國
金步國作品集:http://www.jinbuguo.com
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
| systemd 231 |