systemd.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-systemd" role="wrap" revision="systemd">
  8. <?dbhtml filename="systemd.html"?>
  9. <sect1info condition="script">
  10. <productname>systemd</productname>
  11. <productnumber>&systemd-version;</productnumber>
  12. <address>&systemd-url;</address>
  13. </sect1info>
  14. <title>Systemd-&systemd-version;</title>
  15. <indexterm zone="ch-system-systemd">
  16. <primary sortas="a-systemd">systemd</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Systemd 软件包包含控制系统引导、运行和关闭的程序。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&systemd-ch6-sbu;</seg>
  26. <seg>&systemd-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 systemd</title>
  32. <para>首先,应用补丁,修复 systemd-networkd 在 Linux 5.2
  33. 或更新版本上的问题,以及 systemd 在 AMD Ryzen 系列 CPU 上的问题:</para>
  34. <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-networkd_and_rdrand_fixes-1.patch</userinput></screen>
  35. <para>创建一个符号链接,绕过不存在的 xsltproc:</para>
  36. <screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen>
  37. <para>由于还没有安装好最终的 Util-Linux,
  38. 需要在适当的位置创建一些库的符号链接:</para>
  39. <screen><userinput remap="pre">for file in /tools/lib/lib{blkid,mount,uuid}.so*; do
  40. ln -sf $file /usr/lib/
  41. done</userinput></screen>
  42. <para>设定好 man 页面:</para>
  43. <screen><userinput remap="pre">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz</userinput></screen>
  44. <para>删除在 chroot 环境中无法构建的测试:</para>
  45. <screen><userinput remap="pre">sed '177,$ d' -i src/resolve/meson.build</userinput></screen>
  46. <!--
  47. <para>应用一个补丁,以修正使用 glibc-2.28 时构建失败的问题:</para>
  48. <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-glibc_statx_fix-1.patch</userinput></screen>
  49. <para>应用一个补丁,修复使用 meson-0.48.0 构建时出现的错误:</para>
  50. <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-meson-0.48.0_fixes-1.patch</userinput></screen>
  51. -->
  52. <para>从默认的 udev 规则中删除不必要的组
  53. <systemitem class="groupname">render</systemitem>:</para>
  54. <screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in</userinput></screen>
  55. <!-- EDITORS NOTE: At the next systemd release, see if the CFLAGS can be removed. -->
  56. <para>准备安装 systemd:</para>
  57. <screen><userinput remap="configure">mkdir -p build
  58. cd build
  59. PKG_CONFIG_PATH="/usr/lib/pkgconfig:/tools/lib/pkgconfig" \
  60. LANG=en_US.UTF-8 \
  61. CFLAGS+="-Wno-format-overflow" \
  62. meson --prefix=/usr \
  63. --sysconfdir=/etc \
  64. --localstatedir=/var \
  65. -Dblkid=true \
  66. -Dbuildtype=release \
  67. -Ddefault-dnssec=no \
  68. -Dfirstboot=false \
  69. -Dinstall-tests=false \
  70. -Dkmod-path=/bin/kmod \
  71. -Dldconfig=false \
  72. -Dmount-path=/bin/mount \
  73. -Drootprefix= \
  74. -Drootlibdir=/lib \
  75. -Dsplit-usr=true \
  76. -Dsulogin-path=/sbin/sulogin \
  77. -Dsysusers=false \
  78. -Dumount-path=/bin/umount \
  79. -Db_lto=false \
  80. -Drpmmacrosdir=no \
  81. ..</userinput></screen>
  82. <variablelist>
  83. <title>meson 选项的含义:</title>
  84. <varlistentry>
  85. <term><parameter>-D*-path=*</parameter></term>
  86. <listitem>
  87. <para>这些开关提供了 systemd 在运行时需要的二进制程序的位置,
  88. 这些程序有些尚未安装,有些的 pkgconfig 文件还在
  89. <filename>/tools/lib/pkgconfig</filename> 目录中。</para>
  90. </listitem>
  91. </varlistentry>
  92. <varlistentry>
  93. <term><parameter>-Ddefault-dnssec=no</parameter></term>
  94. <listitem>
  95. <para>这个开关禁用实验性的 DNSSEC 支持。</para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term><parameter>-Dfirstboot=false</parameter></term>
  100. <listitem>
  101. <para>这个开关防止 systemd 安装用于初始化设定系统的服务。
  102. 在 LFS 中所有工作都会手工完成,因此不需要它们。</para>
  103. </listitem>
  104. </varlistentry>
  105. <varlistentry>
  106. <term><parameter>-Dinstall-tests=false</parameter></term>
  107. <listitem>
  108. <para>这个开关防止 systemd 安装编译好的测试文件。</para>
  109. </listitem>
  110. </varlistentry>
  111. <varlistentry>
  112. <term><parameter>-Dldconfig=false</parameter></term>
  113. <listitem>
  114. <para>这个开关防止一个 systemd 单元的安装,它在引导时运行
  115. <command>ldconfig</command>,
  116. 这对于 LFS 等源代码发行版来说没有意义,还会增加引导时间。
  117. 如果您需要这个功能,可以删除这个开关。</para>
  118. </listitem>
  119. </varlistentry>
  120. <varlistentry>
  121. <term><parameter>-Droot*</parameter></term>
  122. <listitem>
  123. <para>这个开关保证核心程序和共享库被安装到 root 分区下的子目录中。
  124. </para>
  125. </listitem>
  126. </varlistentry>
  127. <varlistentry>
  128. <term><parameter>-Dsplit-usr=true</parameter></term>
  129. <listitem>
  130. <para>这个开关确保 systemd 能够在 /bin、/lib 和 /sbin
  131. 目录不是指向 /usr 中对应目录的符号链接的情况下工作。</para>
  132. </listitem>
  133. </varlistentry>
  134. <varlistentry>
  135. <term><parameter>-Dsysusers=false</parameter></term>
  136. <listitem>
  137. <para>这个开关防止 systemd 安装负责设定
  138. <filename>/etc/group</filename> 和
  139. <filename>/etc/passwd</filename> 文件的服务。
  140. 我们在上一章已经创建了这两个文件。</para>
  141. </listitem>
  142. </varlistentry>
  143. <varlistentry>
  144. <term><parameter>-Drpmmacrosdir=no</parameter></term>
  145. <listitem>
  146. <para>该选项禁止安装用于 systemd 的 RPM 宏,
  147. 因为 LFS 并不支持 RPM。</para>
  148. </listitem>
  149. </varlistentry>
  150. </variablelist>
  151. <para>编译该软件包:</para>
  152. <screen><userinput remap="make">LANG=en_US.UTF-8 ninja</userinput></screen>
  153. <!--
  154. <para>To test the package, execute the following command:</para>
  155. <screen><userinput remap="test">LANG=en_US.UTF-8 ninja test</userinput></screen>
  156. -->
  157. <para>安装该软件包:</para>
  158. <screen><userinput remap="install">LANG=en_US.UTF-8 ninja install</userinput></screen>
  159. <para>删除一个不再必要的符号链接:</para>
  160. <screen><userinput remap="install">rm -f /usr/bin/xsltproc</userinput></screen>
  161. <para>创建 <command>systemd-journald</command> 需要的
  162. <filename>/etc/machine-id</filename> 文件:</para>
  163. <screen><userinput remap="adjust">systemd-machine-id-setup</userinput></screen>
  164. <para>删除指向 Util-Linux 库的符号链接:</para>
  165. <screen><userinput remap="adjust">rm -fv /usr/lib/lib{blkid,uuid,mount}.so*</userinput></screen>
  166. <para>阻止 systemd 创建 <filename>/run/nologin</filename>,
  167. 以允许非特权用户在没有
  168. <application>systemd-logind</application>的情况下登录:</para>
  169. <screen><userinput remap="adjust">rm -f /usr/lib/tmpfiles.d/systemd-nologin.conf</userinput></screen>
  170. </sect2>
  171. <sect2 id="contents-systemd" role="content">
  172. <title>systemd 的内容</title>
  173. <segmentedlist>
  174. <segtitle>安装的程序</segtitle>
  175. <segtitle>安装的库</segtitle>
  176. <segtitle>安装的目录</segtitle>
  177. <seglistitem>
  178. <seg>bootctl, busctl, coredumpctl, halt (到 systemctl 的符号链接),
  179. hostnamectl, init, journalctl, kernel-install, localectl, loginctl,
  180. machinectl, networkctl, portablectl, poweroff (到 systemctl
  181. 的符号链接), reboot (到 systemctl 的符号链接), resolvconf (到
  182. resolvectl 的符号链接), resolvectl, runlevel (到 systemctl 的符号链接), shutdown
  183. (到 systemctl 的符号链接), systemctl, systemd-analyze,
  184. systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop,
  185. systemd-delta, systemd-detect-virt, systemd-escape, systemd-hwdb,
  186. systemd-id128, systemd-inhibit, systemd-machine-id-setup,
  187. systemd-mount, systemd-notify, systemd-nspawn, systemd-path,
  188. systemd-resolve (到 resolvectl 的符号链接), systemd-run,
  189. systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles,
  190. systemd-tty-ask-password-agent, systemd-umount (到 systemd-mount
  191. 的符号链接), telinit (到 systemctl 的符号链接), timedatectl, 以及
  192. udevadm</seg>
  193. <seg>libnss_myhostname.so.2, libnss_mymachines.so.2,
  194. libnss_resolve.so.2, libnss_systemd.so.2,
  195. libsystemd.so, libsystemd-shared-&systemd-version;.so (在 /lib/systemd 中),
  196. 以及 libudev.so</seg>
  197. <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
  198. /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
  199. /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
  200. /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d,
  201. /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d,
  202. /usr/share/doc/systemd-&systemd-version;, /usr/share/factory,
  203. /usr/share/systemd, /var/lib/systemd, 以及 /var/log/journal</seg>
  204. </seglistitem>
  205. </segmentedlist>
  206. <variablelist>
  207. <bridgehead renderas="sect3">简要描述</bridgehead>
  208. <?dbfo list-presentation="list"?>
  209. <?dbhtml list-presentation="table"?>
  210. <varlistentry id="bootctl">
  211. <term><command>bootctl</command></term>
  212. <listitem>
  213. <para>用于查询固件和启动管理器设置</para>
  214. <indexterm zone="ch-system-systemd bootctl">
  215. <primary sortas="b-bootctl">bootctl</primary>
  216. </indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="busctl">
  220. <term><command>busctl</command></term>
  221. <listitem>
  222. <para>用于探查和监视 D-bus 总线</para>
  223. <indexterm zone="ch-system-systemd busctl">
  224. <primary sortas="b-busctl">busctl</primary>
  225. </indexterm>
  226. </listitem>
  227. </varlistentry>
  228. <varlistentry id="coredumpctl">
  229. <term><command>coredumpctl</command></term>
  230. <listitem>
  231. <para>用于从 systemd 日志获取核心转储</para>
  232. <indexterm zone="ch-system-systemd coredumpctl">
  233. <primary sortas="b-coredumpctl">coredumpctl</primary>
  234. </indexterm>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry id="halt">
  238. <term><command>halt</command></term>
  239. <listitem>
  240. <para>一般以 <parameter>-h</parameter> 参数调用
  241. <command>shutdown</command> 命令,除非在运行级别已经为 0
  242. 时,则通知内核停止系统;在系统停止运行时它在
  243. <filename>/var/log/wtmp</filename> 中进行记录</para>
  244. <indexterm zone="ch-system-systemd halt">
  245. <primary sortas="b-halt">halt</primary>
  246. </indexterm>
  247. </listitem>
  248. </varlistentry>
  249. <varlistentry id="hostnamectl">
  250. <term><command>hostnamectl</command></term>
  251. <listitem>
  252. <para>查询和修改系统机器名</para>
  253. <indexterm zone="ch-system-systemd hostnamectl">
  254. <primary sortas="b-hostnamectl">hostnamectl</primary>
  255. </indexterm>
  256. </listitem>
  257. </varlistentry>
  258. <varlistentry id="init">
  259. <term><command>init</command></term>
  260. <listitem>
  261. <para>在内核初始化硬件后第一个启动的进程,
  262. 它接管引导过程,并根据它的配置文件启动所有进程。</para>
  263. <indexterm zone="ch-system-systemd init">
  264. <primary sortas="b-init">init</primary>
  265. </indexterm>
  266. </listitem>
  267. </varlistentry>
  268. <varlistentry id="journalctl">
  269. <term><command>journalctl</command></term>
  270. <listitem>
  271. <para>用于查询 systemd 日志的内容</para>
  272. <indexterm zone="ch-system-systemd journalctl">
  273. <primary sortas="b-journalctl">journalctl</primary>
  274. </indexterm>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry id="kernel-install">
  278. <term><command>kernel-install</command></term>
  279. <listitem>
  280. <para>用于在 /boot 中添加或删除内核和 initramfs 映像文件</para>
  281. <indexterm zone="ch-system-systemd kernel-install">
  282. <primary sortas="b-kernel-install">kernel-install</primary>
  283. </indexterm>
  284. </listitem>
  285. </varlistentry>
  286. <varlistentry id="localectl">
  287. <term><command>localectl</command></term>
  288. <listitem>
  289. <para>用于查询和修改系统 locale 和键盘布局设置</para>
  290. <indexterm zone="ch-system-systemd localectl">
  291. <primary sortas="b-localectl">localectl</primary>
  292. </indexterm>
  293. </listitem>
  294. </varlistentry>
  295. <varlistentry id="loginctl">
  296. <term><command>loginctl</command></term>
  297. <listitem>
  298. <para>用于探查和控制 systemd 登录管理器的状态</para>
  299. <indexterm zone="ch-system-systemd loginctl">
  300. <primary sortas="b-loginctl">loginctl</primary>
  301. </indexterm>
  302. </listitem>
  303. </varlistentry>
  304. <varlistentry id="machinectl">
  305. <term><command>machinectl</command></term>
  306. <listitem>
  307. <para>用于探查和控制 systemd 虚拟机和容器注册管理器的状态</para>
  308. <indexterm zone="ch-system-systemd machinectl">
  309. <primary sortas="b-machinectl">machinectl</primary>
  310. </indexterm>
  311. </listitem>
  312. </varlistentry>
  313. <varlistentry id="networkctl">
  314. <term><command>networkctl</command></term>
  315. <listitem>
  316. <para>用于探查 systemd-networkd 管理的网络连接状态</para>
  317. <indexterm zone="ch-system-systemd networkctl">
  318. <primary sortas="b-networkctl">networkctl</primary>
  319. </indexterm>
  320. </listitem>
  321. </varlistentry>
  322. <varlistentry id="portablectl">
  323. <term><command>portablectl</command></term>
  324. <listitem>
  325. <para>用于在本地系统附加或移除可移植服务</para>
  326. <indexterm zone="ch-system-systemd portablectl">
  327. <primary sortas="b-portablectl">portablectl</primary>
  328. </indexterm>
  329. </listitem>
  330. </varlistentry>
  331. <varlistentry id="poweroff">
  332. <term><command>poweroff</command></term>
  333. <listitem>
  334. <para>告诉内核停止系统运行并关闭计算机
  335. (见 <command>halt</command>)</para>
  336. <indexterm zone="ch-system-systemd poweroff">
  337. <primary sortas="b-poweroff">poweroff</primary>
  338. </indexterm>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry id="reboot">
  342. <term><command>reboot</command></term>
  343. <listitem>
  344. <para>告诉内核重启系统 (见
  345. <command>halt</command>)</para>
  346. <indexterm zone="ch-system-systemd reboot">
  347. <primary sortas="b-reboot">reboot</primary>
  348. </indexterm>
  349. </listitem>
  350. </varlistentry>
  351. <varlistentry id="resolvconf">
  352. <term><command>resolvconf</command></term>
  353. <listitem>
  354. <para>为 <command>systemd-resolved</command>
  355. 注册 DNS 服务器和域设置</para>
  356. <indexterm zone="ch-system-systemd resolvconf">
  357. <primary sortas="b-resolvconf">resolvconf</primary>
  358. </indexterm>
  359. </listitem>
  360. </varlistentry>
  361. <varlistentry id="resolvectl">
  362. <term><command>resolvectl</command></term>
  363. <listitem>
  364. <para>向网络名称解析管理器发送控制命令,
  365. 或解析域名,IPv4 和 IPv6 地址,DNS 记录,以及服务。</para>
  366. <indexterm zone="ch-system-systemd resolvectl">
  367. <primary sortas="b-resolvectl">resolvectl</primary>
  368. </indexterm>
  369. </listitem>
  370. </varlistentry>
  371. <varlistentry id="runlevel">
  372. <term><command>runlevel</command></term>
  373. <listitem>
  374. <para>报告当前系统运行级别和上一个运行级别,
  375. 上一个运行级别被记录在 <filename>/var/run/utmp</filename>
  376. 中</para>
  377. <indexterm zone="ch-system-systemd runlevel">
  378. <primary sortas="b-runlevel">runlevel</primary>
  379. </indexterm>
  380. </listitem>
  381. </varlistentry>
  382. <varlistentry id="shutdown">
  383. <term><command>shutdown</command></term>
  384. <listitem>
  385. <para>安全地关闭系统,向所有进程发送信号,并通知所有登录用户
  386. </para>
  387. <indexterm zone="ch-system-systemd shutdown">
  388. <primary sortas="b-shutdown">shutdown</primary>
  389. </indexterm>
  390. </listitem>
  391. </varlistentry>
  392. <varlistentry id="systemctl">
  393. <term><command>systemctl</command></term>
  394. <listitem>
  395. <para>用于探查和控制 systemd 系统和服务管理器的状态</para>
  396. <indexterm zone="ch-system-systemd systemctl">
  397. <primary sortas="b-systemctl">systemctl</primary>
  398. </indexterm>
  399. </listitem>
  400. </varlistentry>
  401. <varlistentry id="systemd-analyze">
  402. <term><command>systemd-analyze</command></term>
  403. <listitem>
  404. <para>用于分析当前运行系统的引导性能</para>
  405. <indexterm zone="ch-system-systemd systemd-analyze">
  406. <primary sortas="b-systemd-analyze">systemd-analyze</primary>
  407. </indexterm>
  408. </listitem>
  409. </varlistentry>
  410. <varlistentry id="systemd-ask-password">
  411. <term><command>systemd-ask-password</command></term>
  412. <listitem>
  413. <para>用于以命令行指定的消息向用户询问系统密码</para>
  414. <indexterm zone="ch-system-systemd systemd-ask-password">
  415. <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
  416. </indexterm>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry id="systemd-cat">
  420. <term><command>systemd-cat</command></term>
  421. <listitem>
  422. <para>用于将进程的标准输出和错误输出重定向到系统日志
  423. </para>
  424. <indexterm zone="ch-system-systemd systemd-cat">
  425. <primary sortas="b-systemd-cat">systemd-cat</primary>
  426. </indexterm>
  427. </listitem>
  428. </varlistentry>
  429. <varlistentry id="systemd-cgls">
  430. <term><command>systemd-cgls</command></term>
  431. <listitem>
  432. <para>用树的形式递归地显示指定 Linux 控制组 (cgroup)
  433. 层次结构的内容</para>
  434. <indexterm zone="ch-system-systemd systemd-cgls">
  435. <primary sortas="b-systemd-cgls">systemd-cgls</primary>
  436. </indexterm>
  437. </listitem>
  438. </varlistentry>
  439. <varlistentry id="systemd-cgtop">
  440. <term><command>systemd-cgtop</command></term>
  441. <listitem>
  442. <para>显示本地 Linux 控制组层次结构中占用资源最多的,
  443. 可以按 CPU 、内存和磁盘 I/O 负载排序</para>
  444. <indexterm zone="ch-system-systemd systemd-cgtop">
  445. <primary sortas="b-systemd-cgtop">systemd-cgtop</primary>
  446. </indexterm>
  447. </listitem>
  448. </varlistentry>
  449. <varlistentry id="systemd-delta">
  450. <term><command>systemd-delta</command></term>
  451. <listitem>
  452. <para>用于确定并比较那些覆盖了
  453. <filename class="directory">/usr</filename> 中默认值的
  454. <filename class="directory">/etc</filename>
  455. 中的配置文件</para>
  456. <indexterm zone="ch-system-systemd systemd-delta">
  457. <primary sortas="b-systemd-delta">systemd-delta</primary>
  458. </indexterm>
  459. </listitem>
  460. </varlistentry>
  461. <varlistentry id="systemd-detect-virt">
  462. <term><command>systemd-detect-virt</command></term>
  463. <listitem>
  464. <para>检测系统是否在虚拟化环境下运行</para>
  465. <indexterm zone="ch-system-systemd systemd-detect-virt">
  466. <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary>
  467. </indexterm>
  468. </listitem>
  469. </varlistentry>
  470. <varlistentry id="systemd-escape">
  471. <term><command>systemd-escape</command></term>
  472. <listitem>
  473. <para>用于转义字符串,以便将其包含在 systemd 单元名中</para>
  474. <indexterm zone="ch-system-systemd systemd-escape">
  475. <primary sortas="b-systemd-escape">systemd-escape</primary>
  476. </indexterm>
  477. </listitem>
  478. </varlistentry>
  479. <varlistentry id="systemd-hwdb">
  480. <term><command>systemd-hwdb</command></term>
  481. <listitem>
  482. <para>用于管理硬件数据库 (hwdb)</para>
  483. <indexterm zone="ch-system-systemd systemd-hwdb">
  484. <primary sortas="b-systemd-hwdb">systemd-hwdb</primary>
  485. </indexterm>
  486. </listitem>
  487. </varlistentry>
  488. <varlistentry id="systemd-id128">
  489. <term><command>systemd-id128</command></term>
  490. <listitem>
  491. <para>生成和打印 id128 串</para>
  492. <indexterm zone="ch-system-systemd systemd-id128">
  493. <primary sortas="b-systemd-id128">systemd-id128</primary>
  494. </indexterm>
  495. </listitem>
  496. </varlistentry>
  497. <varlistentry id="systemd-inhibit">
  498. <term><command>systemd-inhibit</command></term>
  499. <listitem>
  500. <para>用于在关机、休眠或待机抑制锁被锁定的情况下运行程序</para>
  501. <indexterm zone="ch-system-systemd systemd-inhibit">
  502. <primary sortas="b-systemd-inhibit">systemd-inhibit</primary>
  503. </indexterm>
  504. </listitem>
  505. </varlistentry>
  506. <varlistentry id="systemd-machine-id-setup">
  507. <term><command>systemd-machine-id-setup</command></term>
  508. <listitem>
  509. <para>被系统安装工具用于在安装时以随机生成的 ID 初始化
  510. <filename>/etc/machine-id</filename> 中的机器 ID</para>
  511. <indexterm zone="ch-system-systemd systemd-machine-id-setup">
  512. <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary>
  513. </indexterm>
  514. </listitem>
  515. </varlistentry>
  516. <varlistentry id="systemd-mount">
  517. <term><command>systemd-mount</command></term>
  518. <listitem>
  519. <para>一个用于临时挂载或自动挂载驱动器的工具</para>
  520. <indexterm zone="ch-system-systemd systemd-mount">
  521. <primary sortas="b-systemd-mount">systemd-mount</primary>
  522. </indexterm>
  523. </listitem>
  524. </varlistentry>
  525. <varlistentry id="systemd-notify">
  526. <term><command>systemd-notify</command></term>
  527. <listitem>
  528. <para>被守护脚本用于通知 init 系统关于状态变化的信息</para>
  529. <indexterm zone="ch-system-systemd systemd-notify">
  530. <primary sortas="b-systemd-notify">systemd-notify</primary>
  531. </indexterm>
  532. </listitem>
  533. </varlistentry>
  534. <varlistentry id="systemd-nspawn">
  535. <term><command>systemd-nspawn</command></term>
  536. <listitem>
  537. <para>用于在轻量级命名空间容器中运行命令或操作系统</para>
  538. <indexterm zone="ch-system-systemd systemd-nspawn">
  539. <primary sortas="b-systemd-nspawn">systemd-nspawn</primary>
  540. </indexterm>
  541. </listitem>
  542. </varlistentry>
  543. <varlistentry id="systemd-path">
  544. <term><command>systemd-path</command></term>
  545. <listitem>
  546. <para>用于查询系统和用户路径</para>
  547. <indexterm zone="ch-system-systemd systemd-path">
  548. <primary sortas="b-systemd-path">systemd-path</primary>
  549. </indexterm>
  550. </listitem>
  551. </varlistentry>
  552. <varlistentry id="systemd-resolve">
  553. <term><command>systemd-resolve</command></term>
  554. <listitem>
  555. <para>用于解析域名、IPv4 和 IPv6 地址、DNS 资源记录
  556. 以及服务</para>
  557. <indexterm zone="ch-system-systemd systemd-resolve">
  558. <primary sortas="b-systemd-resolve">systemd-resolve</primary>
  559. </indexterm>
  560. </listitem>
  561. </varlistentry>
  562. <varlistentry id="systemd-run">
  563. <term><command>systemd-run</command></term>
  564. <listitem>
  565. <para>用于创建一个临时的 .service 或 .scope 单元,
  566. 并在其中运行指定命令</para>
  567. <indexterm zone="ch-system-systemd systemd-run">
  568. <primary sortas="b-systemd-run">systemd-run</primary>
  569. </indexterm>
  570. </listitem>
  571. </varlistentry>
  572. <!-- <varlistentry id="systemd-stdio-bridge">
  573. <term><command>systemd-stdio-bridge</command></term>
  574. <listitem>
  575. <para>To be completed</para>
  576. <indexterm zone="ch-system-systemd systemd-stdio-bridge">
  577. <primary sortas="b-systemd-stdio-bridge">systemd-stdio-bridge</primary>
  578. </indexterm>
  579. </listitem>
  580. </varlistentry> -->
  581. <varlistentry id="systemd-socket-activate">
  582. <term><command>systemd-socket-activate</command></term>
  583. <listitem>
  584. <para>用于监听 socket 服务,并在连接时启动进程</para>
  585. <indexterm zone="ch-system-systemd systemd-socket-activate">
  586. <primary sortas="b-systemd-socket-activate">systemd-socket-activate</primary>
  587. </indexterm>
  588. </listitem>
  589. </varlistentry>
  590. <varlistentry id="systemd-tmpfiles">
  591. <term><command>systemd-tmpfiles</command></term>
  592. <listitem>
  593. <para>根据
  594. <filename class="directory">tmpfiles.d</filename>
  595. 目录中的配置文件给定的文件格式和位置,
  596. 创建、修改和清理易失性、临时性文件和目录</para>
  597. <indexterm zone="ch-system-systemd systemd-tmpfiles">
  598. <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary>
  599. </indexterm>
  600. </listitem>
  601. </varlistentry>
  602. <varlistentry id="systemd-umount">
  603. <term><command>systemd-umount</command></term>
  604. <listitem>
  605. <para>卸载挂载点</para>
  606. <indexterm zone="ch-system-systemd systemd-umount">
  607. <primary sortas="b-systemd-umount">systemd-umount</primary>
  608. </indexterm>
  609. </listitem>
  610. </varlistentry>
  611. <varlistentry id="systemd-tty-ask-password-agent">
  612. <term><command>systemd-tty-ask-password-agent</command></term>
  613. <listitem>
  614. <para>列出或处理等待中的 systemd 密码请求</para>
  615. <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
  616. <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
  617. </indexterm>
  618. </listitem>
  619. </varlistentry>
  620. <varlistentry id="telinit">
  621. <term><command>telinit</command></term>
  622. <listitem>
  623. <para>告诉 <command>init</command> 切换到某个运行级别</para>
  624. <indexterm zone="ch-system-systemd telinit">
  625. <primary sortas="b-telinit">telinit</primary>
  626. </indexterm>
  627. </listitem>
  628. </varlistentry>
  629. <varlistentry id="timedatectl">
  630. <term><command>timedatectl</command></term>
  631. <listitem>
  632. <para>用于查询和修改系统时钟及其设置
  633. </para>
  634. <indexterm zone="ch-system-systemd timedatectl">
  635. <primary sortas="b-timedatectl">timedatectl</primary>
  636. </indexterm>
  637. </listitem>
  638. </varlistentry>
  639. <varlistentry id="udevadm">
  640. <term><command>udevadm</command></term>
  641. <listitem>
  642. <para>通用 udev 管理工具:控制 udevd 守护进程,
  643. 提供 udev 数据库的信息,监视 udev 事件 ,等待 udev 事件结束,
  644. 测试 udev 配置,或对于给定设备触发 udev 事件</para>
  645. <indexterm zone="ch-system-systemd udevadm">
  646. <primary sortas="b-udevadm">udevadm</primary>
  647. </indexterm>
  648. </listitem>
  649. </varlistentry>
  650. <varlistentry id="libsystemd">
  651. <term><filename class="libraryfile">libsystemd</filename></term>
  652. <listitem>
  653. <para>主要的 systemd 工具库</para>
  654. <indexterm zone="ch-system-systemd libsystemd">
  655. <primary sortas="c-libsystemd">libsystemd</primary>
  656. </indexterm>
  657. </listitem>
  658. </varlistentry>
  659. <varlistentry id="libudev">
  660. <term><filename class="libraryfile">libudev</filename></term>
  661. <listitem>
  662. <para>用于访问 udev 设备信息的库</para>
  663. <indexterm zone="ch-system-systemd libudev">
  664. <primary sortas="c-libudev">libudev</primary>
  665. </indexterm>
  666. </listitem>
  667. </varlistentry>
  668. </variablelist>
  669. </sect2>
  670. </sect1>