1
0

systemd-custom.po 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. msgid ""
  2. msgstr ""
  3. "Project-Id-Version: PACKAGE VERSION\n"
  4. "POT-Creation-Date: 2020-06-17 12:44+0800\n"
  5. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  6. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  7. "Language-Team: LANGUAGE <LL@li.org>\n"
  8. "Language: zh_CN\n"
  9. "MIME-Version: 1.0\n"
  10. "Content-Type: text/plain; charset=UTF-8\n"
  11. "Content-Transfer-Encoding: 8bit\n"
  12. "X-Generator: Translate Toolkit 2.2.5\n"
  13. #. type: Content of: <sect1><title>
  14. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:11
  15. msgid "Systemd Usage and Configuration"
  16. msgstr "Systemd 使用和配置"
  17. #. type: Content of: <sect1><indexterm><primary>
  18. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:14
  19. msgid "Systemd Customization"
  20. msgstr "Systemd 自定义设置"
  21. #. type: Content of: <sect1><sect2><title>
  22. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:18
  23. msgid "Basic Configuration"
  24. msgstr "基础设置"
  25. #. type: Content of: <sect1><sect2><para>
  26. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:20
  27. msgid ""
  28. "The <filename>/etc/systemd/system.conf</filename> file contains a set of "
  29. "options to control basic systemd operations. The default file has all "
  30. "entries commented out with the default settings indicated. This file is "
  31. "where the log level may be changed as well as some basic logging settings. "
  32. "See the <filename>systemd-system.conf(5)</filename> manual page for details "
  33. "on each configuration option."
  34. msgstr ""
  35. "<filename>/etc/systemd/system.conf</filename> 文件包含一组控制 systemd 基本功"
  36. "能的选项。默认文件中所有条目都被注释掉,并标明了默认值。可以在这里修改日志"
  37. "级别,以及其他一些基本日志设定。参阅 <filename>systemd-system.conf(5)</"
  38. "filename> man 手册页面了解每个选项的详细信息。"
  39. #. type: Content of: <sect1><sect2><title>
  40. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:30
  41. msgid "Disabling Screen Clearing at Boot Time"
  42. msgstr "禁用引导时自动清屏"
  43. #. type: Content of: <sect1><sect2><para>
  44. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:32
  45. msgid ""
  46. "The normal behavior for systemd is to clear the screen at the end of the "
  47. "boot sequence. If desired, this behavior may be changed by running the "
  48. "following command:"
  49. msgstr ""
  50. "Systemd 的默认行为是在引导过程结束时清除屏幕。如果希望的话,您可以运行以下命"
  51. "令,修改这一行为:"
  52. #. type: Content of: <sect1><sect2><screen>
  53. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:36
  54. #, no-wrap
  55. msgid ""
  56. "<userinput>mkdir -pv /etc/systemd/system/getty@tty1.service.d\n"
  57. "\n"
  58. "cat &gt; /etc/systemd/system/getty@tty1.service.d/noclear.conf &lt;&lt; EOF\n"
  59. "<literal>[Service]\n"
  60. "TTYVTDisallocate=no</literal>\n"
  61. "EOF</userinput>"
  62. msgstr ""
  63. "<userinput>mkdir -pv /etc/systemd/system/getty@tty1.service.d\n"
  64. "\n"
  65. "cat &gt; /etc/systemd/system/getty@tty1.service.d/noclear.conf &lt;&lt; EOF\n"
  66. "<literal>[Service]\n"
  67. "TTYVTDisallocate=no</literal>\n"
  68. "EOF</userinput>"
  69. #. type: Content of: <sect1><sect2><para>
  70. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:43
  71. msgid ""
  72. "The boot messages can always be reviewed by using the <userinput>journalctl -"
  73. "b</userinput> command as the root user."
  74. msgstr ""
  75. "您总是可以用 root 身份运行 <userinput>journalctl -b</userinput> 命令,查阅引"
  76. "导消息。"
  77. #. type: Content of: <sect1><sect2><title>
  78. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:49
  79. msgid "Disabling tmpfs for /tmp"
  80. msgstr "禁止将 tmpfs 挂载到 /tmp"
  81. #. type: Content of: <sect1><sect2><para>
  82. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:51
  83. msgid ""
  84. "By default, <filename class=\"directory\">/tmp</filename> is created as a "
  85. "tmpfs. If this is not desired, it can be overridden by executing the "
  86. "following command:"
  87. msgstr ""
  88. "默认情况下,<filename class=\"directory\">/tmp</filename> 将被挂载 tmpfs 文件"
  89. "系统。如果不希望这样,可以执行以下命令覆盖这一行为:"
  90. #. type: Content of: <sect1><sect2><screen>
  91. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:55
  92. #, no-wrap
  93. msgid "<userinput>ln -sfv /dev/null /etc/systemd/system/tmp.mount</userinput>"
  94. msgstr "<userinput>ln -sfv /dev/null /etc/systemd/system/tmp.mount</userinput>"
  95. #. type: Content of: <sect1><sect2><para>
  96. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:57
  97. msgid ""
  98. "Alternatively, if a a separate partition for <filename class=\"directory\">/"
  99. "tmp</filename> is desired, specify that partition in a <filename>/etc/fstab</"
  100. "filename> entry."
  101. msgstr ""
  102. "或者,如果希望使用一个单独的 <filename class=\"directory\">/tmp</filename> 分"
  103. "区,在 <filename>/etc/fstab</filename> 中为其添加一个条目。"
  104. #. type: Content of: <sect1><sect2><warning><para>
  105. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:63
  106. msgid ""
  107. "Do not create the symbolic link above if a separate partition is used for "
  108. "<filename class=\"directory\">/tmp</filename>. This will prevent the root "
  109. "file system (/) from being remounted r/w and make the system unusable when "
  110. "booted."
  111. msgstr ""
  112. "如果使用了单独的 <filename class=\"directory\">/tmp</filename> 分区,不要创"
  113. "建上面的符号链接。这会导致根文件系统 (/) 无法重新挂载为可读写,使得系统在引导"
  114. "后不可用。"
  115. #. type: Content of: <sect1><sect2><title>
  116. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:73
  117. msgid "Configuring Automatic File Creation and Deletion"
  118. msgstr "配置文件自动创建和删除"
  119. #. type: Content of: <sect1><sect2><para>
  120. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:75
  121. msgid "There are several services that create or delete files or directories:"
  122. msgstr "有一些创建或删除文件、目录的服务:"
  123. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  124. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:79
  125. msgid "systemd-tmpfiles-clean.service"
  126. msgstr "systemd-tmpfiles-clean.service"
  127. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  128. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:80
  129. msgid "systemd-tmpfiles-setup-dev.service"
  130. msgstr "systemd-tmpfiles-setup-dev.service"
  131. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  132. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:81
  133. msgid "systemd-tmpfiles-setup.service"
  134. msgstr "systemd-tmpfiles-setup.service"
  135. #. type: Content of: <sect1><sect2><para>
  136. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:84
  137. msgid ""
  138. "The system location for the configuration files is <filename>/usr/lib/"
  139. "tmpfiles.d/*.conf</filename>. The local configuration files are in <filename "
  140. "class=\"directory\">/etc/tmpfiles.d</filename>. Files in <filename class="
  141. "\"directory\">/etc/tmpfiles.d</filename> override files with the same name "
  142. "in <filename class=\"directory\">/usr/lib/tmpfiles.d</filename>. See "
  143. "<filename>tmpfiles.d(5)</filename> manual page for file format details."
  144. msgstr ""
  145. "它们的系统配置文件位于 <filename>/usr/lib/tmpfiles.d/*.conf</filename>。本地"
  146. "配置文件位于 <filename class=\"directory\">/etc/tmpfiles.d</filename>。"
  147. "<filename class=\"directory\">/etc/tmpfiles.d</filename> 中的文件覆盖 "
  148. "<filename class=\"directory\">/usr/lib/tmpfiles.d</filename> 中的同名文件。参"
  149. "阅 <filename>tmpfiles.d(5)</filename> man 手册页面,了解配置文件格式的细节。"
  150. #. type: Content of: <sect1><sect2><para><screen>
  151. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:101
  152. #, no-wrap
  153. msgid "q /tmp 1777 root root 10d"
  154. msgstr "q /tmp 1777 root root 10d"
  155. #. type: Content of: <sect1><sect2><para>
  156. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:95
  157. msgid ""
  158. "Note that the syntax for the <filename>/usr/lib/tmpfiles.d/*.conf</filename> "
  159. "files can be confusing. For example, the default deletion of files in the /"
  160. "tmp directory is located in <filename>/usr/lib/tmpfiles.d/tmp.conf</"
  161. "filename> with the line: <placeholder type=\"screen\" id=\"0\"/> The type "
  162. "field, q, discusses creating a subvolume with quotas which is really only "
  163. "applicable to btrfs filesystems. It references type v which in turn "
  164. "references type d (directory). This then creates the specified directory if "
  165. "is is not present and adjusts the permissions and ownership as specified. "
  166. "Contents of the directory will be subject to time based cleanup if the age "
  167. "argument is specified."
  168. msgstr ""
  169. "注意 <filename>/usr/lib/tmpfiles.d/*.conf</filename> 文件的语法较难理解。例"
  170. "如,删除 /tmp 目录下文件的默认规则是文件 <filename>/usr/lib/tmpfiles.d/tmp."
  171. "conf</filename> 的一行:<placeholder type=\"screen\" id=\"0\"/> 类别字段 q "
  172. "表示创建一个带有配额的子卷,它实际上只适用于 btrfs 文件系统。它引用类别 v,"
  173. "类别 v 又引用类别 d (目录)。对于类别 d ,会在目录不存在时自动创建它,并根据配置文件调整其"
  174. "权限和所有者。如果 age 参数被指定,该目录中较老的文件会被自动清理。"
  175. #. type: Content of: <sect1><sect2><para><screen>
  176. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:116
  177. #, no-wrap
  178. msgid ""
  179. "<userinput>mkdir -p /etc/tmpfiles.d\n"
  180. "cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d</userinput>"
  181. msgstr ""
  182. "<userinput>mkdir -p /etc/tmpfiles.d\n"
  183. "cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d</userinput>"
  184. #. type: Content of: <sect1><sect2><para>
  185. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:112
  186. msgid ""
  187. "If the default parameters are not desired, then the file should be copied to "
  188. "<filename class=\"directory\">/etc/tmpfiles.d</filename> and edited as "
  189. "desired. For example: <placeholder type=\"screen\" id=\"0\"/>"
  190. msgstr ""
  191. "如果默认参数不符合您的期望,您可以将文件复制到 <filename class=\"directory"
  192. "\">/etc/tmpfiles.d</filename> 目录,再编辑复制得到的副本。例如:"
  193. "<placeholder type=\"screen\" id=\"0\"/>"
  194. #. type: Content of: <sect1><sect2><title>
  195. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:123
  196. msgid "Overriding Default Services Behavior"
  197. msgstr "覆盖系统服务默认行为"
  198. #. type: Content of: <sect1><sect2><para>
  199. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:125
  200. msgid ""
  201. "The parameters of a unit can be overriden by creating a directory and a "
  202. "configuration file in <filename class=\"directory\">/etc/systemd/system</"
  203. "filename>. For example:"
  204. msgstr ""
  205. "Systemd 单元的参数可以通过在 <filename class=\"directory\">/etc/systemd/"
  206. "system</filename> 中创建一个包含配置文件的目录而覆盖。例如:"
  207. #. type: Content of: <sect1><sect2><screen>
  208. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:129
  209. #, no-wrap
  210. msgid ""
  211. "<userinput>mkdir -pv /etc/systemd/system/foobar.service.d\n"
  212. "\n"
  213. "cat > /etc/systemd/system/foobar.service.d/foobar.conf &lt;&lt; EOF\n"
  214. "<literal>[Service]\n"
  215. "Restart=always\n"
  216. "RestartSec=30</literal>\n"
  217. "EOF</userinput>"
  218. msgstr ""
  219. "<userinput>mkdir -pv /etc/systemd/system/foobar.service.d\n"
  220. "\n"
  221. "cat > /etc/systemd/system/foobar.service.d/foobar.conf &lt;&lt; EOF\n"
  222. "<literal>[Service]\n"
  223. "Restart=always\n"
  224. "RestartSec=30</literal>\n"
  225. "EOF</userinput>"
  226. #. type: Content of: <sect1><sect2><para>
  227. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:137
  228. msgid ""
  229. "See <filename>systemd.unit(5)</filename> manual page for more information. "
  230. "After creating the configuration file, run <userinput>systemctl daemon-"
  231. "reload</userinput> and <userinput>systemctl restart foobar</userinput> to "
  232. "activate the changes to a service."
  233. msgstr ""
  234. "参阅 <filename>systemd.unit(5)</filename> man 手册页面获取更多信息。在创建配"
  235. "置文件后,执行 <userinput>systemctl daemon-reload</userinput> 和 "
  236. "<userinput>systemctl restart foobar</userinput>,激活对服务进行的修改。"
  237. #. type: Content of: <sect1><sect2><title>
  238. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:145
  239. msgid "Debugging the Boot Sequence"
  240. msgstr "调试引导过程"
  241. #. type: Content of: <sect1><sect2><para>
  242. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:147
  243. msgid ""
  244. "Rather than plain shell scripts used in SysVinit or BSD style init systems, "
  245. "systemd uses a unified format for different types of startup files (or "
  246. "units). The command <command>systemctl</command> is used to enable, disable, "
  247. "control state, and obtain status of unit files. Here are some examples of "
  248. "frequently used commands:"
  249. msgstr ""
  250. "与 SysVinit 或 BSD 风格 init 系统不同,systemd 使用统一格式处理不同种类的引"
  251. "导文件 (或称为单元)。命令 <command>systemctl</command> 能够启用、禁用单元文"
  252. "件,或控制、查询单元文件的状态。以下是一些常用的命令:"
  253. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  254. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:155
  255. msgid ""
  256. "<command>systemctl list-units -t <replaceable>&lt;service&gt;</replaceable> "
  257. "[--all]</command>: lists loaded unit files of type service."
  258. msgstr ""
  259. "<command>systemctl list-units -t <replaceable>&lt;service&gt;</replaceable> "
  260. "[--all]</command>: 列出已加载的服务 (service) 类型单元文件。"
  261. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  262. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:159
  263. msgid ""
  264. "<command>systemctl list-units -t <replaceable>&lt;target&gt;</replaceable> "
  265. "[--all]</command>: lists loaded unit files of type target."
  266. msgstr ""
  267. "<command>systemctl list-units -t <replaceable>&lt;target&gt;</replaceable> "
  268. "[--all]</command>: 列出已加载的引导目标 (target) 类型单元文件。"
  269. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  270. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:163
  271. msgid ""
  272. "<command>systemctl show -p Wants <replaceable>&lt;multi-user.target&gt;</"
  273. "replaceable></command>: shows all units that depend on the multi-user "
  274. "target. Targets are special unit files that are anogalous to runlevels under "
  275. "SysVinit."
  276. msgstr ""
  277. "<command>systemctl show -p Wants <replaceable>&lt;multi-user.target&gt;</"
  278. "replaceable></command>: 显示所有依赖于 multi-user 引导目标的单元,引导目标 "
  279. "(target)是一种和 SysVinit 中运行级别 (runlevel) 地位相同的特殊单元文件。"
  280. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  281. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:169
  282. msgid ""
  283. "<command>systemctl status <replaceable>&lt;servicename.service&gt;</"
  284. "replaceable></command>: shows the status of the servicename service. The ."
  285. "service extension can be omitted if there are no other unit files with the "
  286. "same name, such as .socket files (which create a listening socket that "
  287. "provides similar functionality to inetd/xinetd)."
  288. msgstr ""
  289. "<command>systemctl status <replaceable>&lt;servicename.service&gt;</"
  290. "replaceable></command>: 显示名为 servicename 的服务的状态。如果没有同名的其他"
  291. "类型单元文件,可以省略 .service 后缀。其他类型的单元文件有 .socket 文件 (它"
  292. "创建一个监听套接字,提供和 inetd/xinetd 类似的功能)。"
  293. #. type: Content of: <sect1><sect2><title>
  294. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:180
  295. msgid "Working with the Systemd Journal"
  296. msgstr "使用 systemd 日志"
  297. #. type: Content of: <sect1><sect2><para>
  298. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:182
  299. msgid ""
  300. "Logging on a system booted with systemd is handled with systemd-journald (by "
  301. "default), rather than a typical unix syslog daemon. You can also add a "
  302. "normal syslog daemon and have both operate side by side if desired. The "
  303. "systemd-journald program stores journal entries in a binary format rather "
  304. "than a plain text log file. To assist with parsing the file, the command "
  305. "<command>journalctl</command> is provided. Here are some examples of "
  306. "frequently used commands:"
  307. msgstr ""
  308. "(默认情况下) 在使用 systemd 引导的系统上,systemd-journald 服务负责处理日"
  309. "志,它取代了传统的 Unix syslog 守护进程。如果您希望的话,也可以添加一个普通 "
  310. "syslog 守护进程,它和 systemd-journald 可以一起工作。systemd-journald 程序将"
  311. "日志项储存为二进制格式,而不是纯文本日志文件。为了解析日志文件,需要使用 "
  312. "systemd 提供的 <command>journalctl</command> 命令。下面是该命令的常见用法:"
  313. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  314. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:192
  315. msgid ""
  316. "<command>journalctl -r</command>: shows all contents of the journal in "
  317. "reverse chronological order."
  318. msgstr "<command>journalctl -r</command>:按时间顺序,倒序显示所有日志内容。"
  319. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  320. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:196
  321. msgid ""
  322. "<command>journalctl -u <replaceable>UNIT</replaceable></command>: shows the "
  323. "journal entries associated with the specified UNIT file."
  324. msgstr ""
  325. "<command>journalctl -u <replaceable>UNIT</replaceable></command>: 显示与给定"
  326. "单元文件 UNIT 关联的日志。"
  327. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  328. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:201
  329. msgid ""
  330. "<command>journalctl -b[=ID] -r</command>: shows the journal entries since "
  331. "last successful boot (or for boot ID) in reverse chronological order."
  332. msgstr ""
  333. "<command>journalctl -b[=ID] -r</command>: 按时间倒序,显示自上次引导以来 (或"
  334. "编号为 ID 的引导中) 的所有日志。"
  335. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  336. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:206
  337. msgid ""
  338. "<command>journalctl -f</command>: provides functionality similar to tail -f "
  339. "(follow)."
  340. msgstr ""
  341. "<command>journalctl -f</command>: 提供类似 tail -f 的功能 (不断将新日志项输出"
  342. "到屏幕)。"
  343. #. type: Content of: <sect1><sect2><title>
  344. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:214
  345. msgid "Working with Core Dumps"
  346. msgstr "处理核心转储"
  347. #. type: Content of: <sect1><sect2><para>
  348. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:216
  349. msgid ""
  350. "Core dumps are useful to debug crashed programs, especially when a daemon "
  351. "process crashes. On systemd booted systems the core dumping is handled by "
  352. "<command>systemd-coredump</command>. It will log the core dump in the "
  353. "journal and store the core dump itself in <filename class=\"directory\">/var/"
  354. "lib/systemd/coredump</filename>. To retrieve and process core dumps, the "
  355. "<command>coredumpctl</command> tool is provided. Here are some examples of "
  356. "frequently used commands:"
  357. msgstr ""
  358. "核心转储在调试崩溃的程序时非常有用,特别是对于守护进程崩溃的情况。"
  359. "在 systemd 引导的系统上,核心转储由 <command>systemd-coredump</command> "
  360. "处理。它会在日志中记录核心转储,并且将核心转储文件本身存储到 "
  361. "<filename class=\"directory\">/var/lib/systemd/coredump</filename> 中。"
  362. "如果要获取和处理核心转储文件,可以使用 <command>coredumpctl</command> "
  363. "工具。下面给出它的常用命令的示例:"
  364. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  365. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:227
  366. msgid ""
  367. "<command>coredumpctl -r</command>: lists all core dumps in reverse "
  368. "chronological order."
  369. msgstr "<command>coredumpctl -r</command>:按时间顺序,倒序显示所有核心转储记录。"
  370. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  371. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:231
  372. msgid ""
  373. "<command>coredumpctl -1 info</command>: shows the information from the last "
  374. "core dump."
  375. msgstr ""
  376. "<command>coredumpctl -1 info</command>:显示最近一次核心转储的信息。"
  377. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  378. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:235
  379. msgid ""
  380. "<command>coredumpctl -1 debug</command>: loads the last core dump into "
  381. "<ulink url=\"&blfs-book;general/gdb.html\">GDB</ulink>."
  382. msgstr ""
  383. "<command>coredumpctl -1 debug</command>:将最后一次核心转储加载到 "
  384. "<ulink url=\"&blfs-book;general/gdb.html\">GDB</ulink> 中。"
  385. #. type: Content of: <sect1><sect2><para>
  386. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:241
  387. msgid ""
  388. "Core dumps may use a lot of disk space. The maximum disk space used by core "
  389. "dumps can be limited by creating a configuration file in <filename class="
  390. "\"directory\">/etc/systemd/coredump.conf.d</filename>. For example:"
  391. msgstr ""
  392. "核心转储可能使用大量磁盘空间。为了限制核心转储使用的最大磁盘空间,"
  393. "可以在 <filename class=\"directory\">/etc/systemd/coredump.conf.d"
  394. "</filename> 中创建一个配置文件。例如:"
  395. #. type: Content of: <sect1><sect2><screen>
  396. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:246
  397. #, no-wrap
  398. msgid ""
  399. "<userinput>mkdir -pv /etc/systemd/coredump.conf.d\n"
  400. "\n"
  401. "cat &gt; /etc/systemd/coredump.conf.d/maxuse.conf &lt;&lt; EOF\n"
  402. "<literal>[Coredump]\n"
  403. "MaxUse=5G</literal>\n"
  404. "EOF</userinput>"
  405. msgstr ""
  406. "<userinput>mkdir -pv /etc/systemd/coredump.conf.d\n"
  407. "\n"
  408. "cat &gt; /etc/systemd/coredump.conf.d/maxuse.conf &lt;&lt; EOF\n"
  409. "<literal>[Coredump]\n"
  410. "MaxUse=5G</literal>\n"
  411. "EOF</userinput>"
  412. #. type: Content of: <sect1><sect2><para>
  413. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:253
  414. msgid ""
  415. "See the <filename>systemd-coredump(8)</filename>, <filename>coredumpctl(1)</"
  416. "filename>, and <filename>coredump.conf.d(5)</filename> manual pages for more "
  417. "information."
  418. msgstr ""
  419. "参阅 man 手册页面 <filename>systemd-coredump(8)</filename>,<filename>coredumpctl(1)</"
  420. "filename>,以及 <filename>coredump.conf.d(5)</filename> 了解更多信息。"
  421. #. type: Content of: <sect1><sect2><title>
  422. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:260
  423. msgid "Long Running Processes"
  424. msgstr "持续运行进程"
  425. #. type: Content of: <sect1><sect2><para>
  426. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:262
  427. msgid ""
  428. "Beginning with systemd-230, all user processes are killed when a user "
  429. "session is ended, even if nohup is used, or the process uses the "
  430. "<function>daemon()</function> or <function>setsid()</function> functions. "
  431. "This is a deliberate change from a historically permissive environment to a "
  432. "more restrictive one. The new behavior may cause issues if you depend on "
  433. "long running programs (e.g., <command>screen</command> or <command>tmux</"
  434. "command>) to remain active after ending your user session. There are three "
  435. "ways to enable lingering processes to remain after a user session is ended."
  436. msgstr ""
  437. "从 systemd 的 230 版本开始,在用户会话结束时,所有用户进程都被杀死,即使使用"
  438. "了 nohup 或 <function>daemon()</function> 、<function>setsid</function> 等函"
  439. "数也不例外。这是开发者有意做出的修改,将传统的宽松环境改为更加严格的环境。如"
  440. "果您需要让持续运行的程序 (例如 <command>screen</command> 或 <command>tmux</"
  441. "command>) 在用户会话结束后保持运行,这项新的行为会导致问题。有三种方法使得这"
  442. "类驻留进程在用户会话结束后继续运行:"
  443. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  444. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:275
  445. msgid ""
  446. "<emphasis>Enable process lingering for only selected users</emphasis>: "
  447. "Normal users have permission to enable process lingering with the command "
  448. "<command>loginctl enable-linger</command> for their own user. System "
  449. "administrators can use the same command with a <parameter>user</parameter> "
  450. "argument to enable for a user. That user can then use the <command>systemd-"
  451. "run</command> command to start long running processes. For example: "
  452. "<command>systemd-run --scope --user /usr/bin/screen</command>. If you enable "
  453. "lingering for your user, the user@.service will remain even after all login "
  454. "sessions are closed, and will automatically start at system boot. This has "
  455. "the advantage of explicitly allowing and disallowing processes to run after "
  456. "the user session has ended, but breaks backwards compatibility with tools "
  457. "like <command>nohup</command> and utilities that use <function>daemon()</"
  458. "function>."
  459. msgstr ""
  460. "<emphasis>仅为选定的用户启用进程驻留</emphasis>:普通用户有执行命令 "
  461. "<command>loginctl enable-linger</command> 启用进程驻留的权限,管理员可以使用"
  462. "带 <parameter>user</parameter> 参数的该命令,为特定用户启用进程驻留。在启用"
  463. "进程驻留后,可以使用 <command>systemd-run</command> 命令启动持续运行的进程。"
  464. "例如,<command>systemd-run --scope --user /usr/bin/screen</command>。如果您"
  465. "为您的用户启用了进程驻留,则 user@.service 将持续运行,甚至在所有登录会话关"
  466. "闭后仍然运行,而且会在系统引导时自动启动。这种方法的好处是可以显式地允许或禁"
  467. "止进程在用户会话结束后继续运行,但却破坏了和 <command>nohup</command> 等工"
  468. "具,和使用 <function>daemon()</function> 函数的工具的兼容性。"
  469. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  470. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:293
  471. msgid ""
  472. "<emphasis>Enable system-wide process lingering</emphasis>: You can set "
  473. "<parameter>KillUserProcesses=no</parameter> in <filename>/etc/systemd/logind."
  474. "conf</filename> to enable process lingering globally for all users. This has "
  475. "the benefit of leaving the old method available to all users at the expense "
  476. "of explicit control."
  477. msgstr ""
  478. "<emphasis>为整个系统启用进程驻留</emphasis>:您可以在将"
  479. "<parameter>KillUserProcesses=no</parameter> 设置行加入 <filename>/etc/"
  480. "systemd/logind.conf</filename>,为所有用户全局地启用进程驻留。它的好处是允"
  481. "许所有用户继续使用旧方法,但无法进行明确控制。"
  482. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  483. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/systemd-custom.xml:302
  484. msgid ""
  485. "<emphasis>Disable at build-time</emphasis>: You can disable lingering by "
  486. "default while building systemd by adding the switch <parameter>-Ddefault-"
  487. "kill-user-processes=false</parameter> to the <command>meson</command> "
  488. "command for systemd. This completely disables the ability of systemd to kill "
  489. "user processes at session end."
  490. msgstr ""
  491. "<emphasis>在编译时禁用该功能</emphasis>:您可以在构建 systemd 时传递参数 "
  492. "<parameter>-Ddefault-kill-user-process=no</parameter> 给 <command>meson</"
  493. "command>,使得 systemd 默认启用进程驻留。这完全禁用了 systemd 在会话结束时"
  494. "杀死用户进程的功能。"