1
0

systemd-custom.po 23 KB

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