createfiles.po 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. msgid ""
  2. msgstr ""
  3. "X-Pootle-Revision: 9999999\n"
  4. "X-Pootle-Path: /zh_CN/lfs/chapter07/createfiles.po\n"
  5. "Project-Id-Version: PACKAGE VERSION\n"
  6. "POT-Creation-Date: 2020-08-08 19:28+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 "Creating Essential Files and Symlinks"
  17. msgstr "创建必要的文件和符号链接"
  18. #. type: Content of: <sect1><indexterm><primary>
  19. msgid "/etc/passwd"
  20. msgstr "/etc/passwd"
  21. #. type: Content of: <sect1><indexterm><primary>
  22. msgid "/etc/group"
  23. msgstr "/etc/group"
  24. #. type: Content of: <sect1><indexterm><primary>
  25. msgid "/var/run/utmp"
  26. msgstr "/var/run/utmp"
  27. #. type: Content of: <sect1><indexterm><primary>
  28. msgid "/var/log/btmp"
  29. msgstr "/var/log/btmp"
  30. #. type: Content of: <sect1><indexterm><primary>
  31. msgid "/var/log/lastlog"
  32. msgstr "/var/log/lastlog"
  33. #. type: Content of: <sect1><indexterm><primary>
  34. msgid "/var/log/wtmp"
  35. msgstr "/var/log/wtmp"
  36. #. type: Content of: <sect1><para>
  37. msgid ""
  38. "Historically, Linux maintains a list of the mounted file systems in the file "
  39. "<filename>/etc/mtab</filename>. Modern kernels maintain this list internally "
  40. "and exposes it to the user via the <filename class=\"directory\">/proc</"
  41. "filename> filesystem. To satisfy utilities that expect the presence of "
  42. "<filename>/etc/mtab</filename>, create the following symbolic link:"
  43. msgstr ""
  44. "历史上,Linux 在 <filename>/etc/mtab</filename> 维护已经挂载的文件系统的列"
  45. "表。现代内核在内部维护该列表,并通过 <filename class=\"directory\">/proc</"
  46. "filename> 文件系统将它展示给用户。为了满足那些需要 <filename>/etc/mtab</"
  47. "filename> 的工具,执行以下命令,创建符号链接:"
  48. #. type: Content of: <sect1><screen>
  49. #, no-wrap
  50. msgid "<userinput>ln -sv /proc/self/mounts /etc/mtab</userinput>"
  51. msgstr "<userinput>ln -sv /proc/self/mounts /etc/mtab</userinput>"
  52. #. type: Content of: <sect1><para>
  53. msgid ""
  54. "Create a basic <filename>/etc/hosts</filename> file to be referenced in some "
  55. "test suites, and in one of Perl's configuration files as well:"
  56. msgstr ""
  57. "创建一个基本的 <filename>/etc/hosts</filename> 文件,一些测试套件,以及 Perl "
  58. "的一个配置文件将会使用它:"
  59. #. type: Content of: <sect1><screen>
  60. #, no-wrap
  61. msgid "<userinput>echo \"127.0.0.1 localhost $(hostname)\" &gt; /etc/hosts</userinput>"
  62. msgstr "<userinput>echo \"127.0.0.1 localhost $(hostname)\" &gt; /etc/hosts</userinput>"
  63. #. type: Content of: <sect1><para>
  64. msgid ""
  65. "In order for user <systemitem class=\"username\">root</systemitem> to be "
  66. "able to login and for the name <quote>root</quote> to be recognized, there "
  67. "must be relevant entries in the <filename>/etc/passwd</filename> and "
  68. "<filename>/etc/group</filename> files."
  69. msgstr ""
  70. "为了使得 <systemitem class=\"username\">root</systemitem> 能正常登录,而且用"
  71. "户名 <quote>root</quote> 能被正常识别,必须在文件 <filename>/etc/passwd</"
  72. "filename> 和 <filename>/etc/groups</filename> 中写入相关的条目。"
  73. #. type: Content of: <sect1><para>
  74. msgid ""
  75. "Create the <filename>/etc/passwd</filename> file by running the following "
  76. "command:"
  77. msgstr "执行以下命令创建 <filename>/etc/passwd</filename> 文件:"
  78. #. type: Content of: <sect1><screen>
  79. #, no-wrap
  80. msgid ""
  81. "<userinput>cat &gt; /etc/passwd &lt;&lt; \"EOF\"\n"
  82. "<literal>root:x:0:0:root:/root:/bin/bash\n"
  83. "bin:x:1:1:bin:/dev/null:/bin/false\n"
  84. "daemon:x:6:6:Daemon User:/dev/null:/bin/false\n"
  85. "messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n"
  86. "nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n"
  87. "EOF</userinput>"
  88. msgstr ""
  89. "<userinput>cat &gt; /etc/passwd &lt;&lt; \"EOF\"\n"
  90. "<literal>root:x:0:0:root:/root:/bin/bash\n"
  91. "bin:x:1:1:bin:/dev/null:/bin/false\n"
  92. "daemon:x:6:6:Daemon User:/dev/null:/bin/false\n"
  93. "messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n"
  94. "nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n"
  95. "EOF</userinput>"
  96. #. type: Content of: <sect1><screen>
  97. #, no-wrap
  98. msgid ""
  99. "<userinput>cat &gt; /etc/passwd &lt;&lt; \"EOF\"\n"
  100. "<literal>root:x:0:0:root:/root:/bin/bash\n"
  101. "bin:x:1:1:bin:/dev/null:/bin/false\n"
  102. "daemon:x:6:6:Daemon User:/dev/null:/bin/false\n"
  103. "messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n"
  104. "systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false\n"
  105. "systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false\n"
  106. "systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false\n"
  107. "systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false\n"
  108. "systemd-network:x:76:76:systemd Network Management:/:/bin/false\n"
  109. "systemd-resolve:x:77:77:systemd Resolver:/:/bin/false\n"
  110. "systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false\n"
  111. "systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false\n"
  112. "nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n"
  113. "EOF</userinput>"
  114. msgstr ""
  115. "<userinput>cat &gt; /etc/passwd &lt;&lt; \"EOF\"\n"
  116. "<literal>root:x:0:0:root:/root:/bin/bash\n"
  117. "bin:x:1:1:bin:/dev/null:/bin/false\n"
  118. "daemon:x:6:6:Daemon User:/dev/null:/bin/false\n"
  119. "messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n"
  120. "systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false\n"
  121. "systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false\n"
  122. "systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false\n"
  123. "systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false\n"
  124. "systemd-network:x:76:76:systemd Network Management:/:/bin/false\n"
  125. "systemd-resolve:x:77:77:systemd Resolver:/:/bin/false\n"
  126. "systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false\n"
  127. "systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false\n"
  128. "nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n"
  129. "EOF</userinput>"
  130. #. type: Content of: <sect1><para>
  131. msgid ""
  132. "The actual password for <systemitem class=\"username\">root</systemitem> "
  133. "will be set later."
  134. msgstr ""
  135. "我们以后再设置 <systemitem class=\"username\">root</systemitem> 用户的实际密"
  136. "码。"
  137. #. type: Content of: <sect1><para>
  138. msgid ""
  139. "Create the <filename>/etc/group</filename> file by running the following "
  140. "command:"
  141. msgstr "执行以下命令,创建 <filename>/etc/group</filename> 文件:"
  142. #. type: Content of: <sect1><screen>
  143. #, no-wrap
  144. msgid ""
  145. "<userinput>cat &gt; /etc/group &lt;&lt; \"EOF\"\n"
  146. "<literal>root:x:0:\n"
  147. "bin:x:1:daemon\n"
  148. "sys:x:2:\n"
  149. "kmem:x:3:\n"
  150. "tape:x:4:\n"
  151. "tty:x:5:\n"
  152. "daemon:x:6:\n"
  153. "floppy:x:7:\n"
  154. "disk:x:8:\n"
  155. "lp:x:9:\n"
  156. "dialout:x:10:\n"
  157. "audio:x:11:\n"
  158. "video:x:12:\n"
  159. "utmp:x:13:\n"
  160. "usb:x:14:\n"
  161. "cdrom:x:15:\n"
  162. "adm:x:16:\n"
  163. "messagebus:x:18:\n"
  164. "input:x:24:\n"
  165. "mail:x:34:\n"
  166. "kvm:x:61:\n"
  167. "wheel:x:97:\n"
  168. "nogroup:x:99:\n"
  169. "users:x:999:</literal>\n"
  170. "EOF</userinput>"
  171. msgstr ""
  172. "<userinput>cat &gt; /etc/group &lt;&lt; \"EOF\"\n"
  173. "<literal>root:x:0:\n"
  174. "bin:x:1:daemon\n"
  175. "sys:x:2:\n"
  176. "kmem:x:3:\n"
  177. "tape:x:4:\n"
  178. "tty:x:5:\n"
  179. "daemon:x:6:\n"
  180. "floppy:x:7:\n"
  181. "disk:x:8:\n"
  182. "lp:x:9:\n"
  183. "dialout:x:10:\n"
  184. "audio:x:11:\n"
  185. "video:x:12:\n"
  186. "utmp:x:13:\n"
  187. "usb:x:14:\n"
  188. "cdrom:x:15:\n"
  189. "adm:x:16:\n"
  190. "messagebus:x:18:\n"
  191. "input:x:24:\n"
  192. "mail:x:34:\n"
  193. "kvm:x:61:\n"
  194. "wheel:x:97:\n"
  195. "nogroup:x:99:\n"
  196. "users:x:999:</literal>\n"
  197. "EOF</userinput>"
  198. #. type: Content of: <sect1><screen>
  199. #, no-wrap
  200. msgid ""
  201. "<userinput>cat &gt; /etc/group &lt;&lt; \"EOF\"\n"
  202. "<literal>root:x:0:\n"
  203. "bin:x:1:daemon\n"
  204. "sys:x:2:\n"
  205. "kmem:x:3:\n"
  206. "tape:x:4:\n"
  207. "tty:x:5:\n"
  208. "daemon:x:6:\n"
  209. "floppy:x:7:\n"
  210. "disk:x:8:\n"
  211. "lp:x:9:\n"
  212. "dialout:x:10:\n"
  213. "audio:x:11:\n"
  214. "video:x:12:\n"
  215. "utmp:x:13:\n"
  216. "usb:x:14:\n"
  217. "cdrom:x:15:\n"
  218. "adm:x:16:\n"
  219. "messagebus:x:18:\n"
  220. "systemd-journal:x:23:\n"
  221. "input:x:24:\n"
  222. "mail:x:34:\n"
  223. "kvm:x:61:\n"
  224. "systemd-bus-proxy:x:72:\n"
  225. "systemd-journal-gateway:x:73:\n"
  226. "systemd-journal-remote:x:74:\n"
  227. "systemd-journal-upload:x:75:\n"
  228. "systemd-network:x:76:\n"
  229. "systemd-resolve:x:77:\n"
  230. "systemd-timesync:x:78:\n"
  231. "systemd-coredump:x:79:\n"
  232. "wheel:x:97:\n"
  233. "nogroup:x:99:\n"
  234. "users:x:999:</literal>\n"
  235. "EOF</userinput>"
  236. msgstr ""
  237. "<userinput>cat &gt; /etc/group &lt;&lt; \"EOF\"\n"
  238. "<literal>root:x:0:\n"
  239. "bin:x:1:daemon\n"
  240. "sys:x:2:\n"
  241. "kmem:x:3:\n"
  242. "tape:x:4:\n"
  243. "tty:x:5:\n"
  244. "daemon:x:6:\n"
  245. "floppy:x:7:\n"
  246. "disk:x:8:\n"
  247. "lp:x:9:\n"
  248. "dialout:x:10:\n"
  249. "audio:x:11:\n"
  250. "video:x:12:\n"
  251. "utmp:x:13:\n"
  252. "usb:x:14:\n"
  253. "cdrom:x:15:\n"
  254. "adm:x:16:\n"
  255. "messagebus:x:18:\n"
  256. "systemd-journal:x:23:\n"
  257. "input:x:24:\n"
  258. "mail:x:34:\n"
  259. "kvm:x:61:\n"
  260. "systemd-bus-proxy:x:72:\n"
  261. "systemd-journal-gateway:x:73:\n"
  262. "systemd-journal-remote:x:74:\n"
  263. "systemd-journal-upload:x:75:\n"
  264. "systemd-network:x:76:\n"
  265. "systemd-resolve:x:77:\n"
  266. "systemd-timesync:x:78:\n"
  267. "systemd-coredump:x:79:\n"
  268. "wheel:x:97:\n"
  269. "nogroup:x:99:\n"
  270. "users:x:999:</literal>\n"
  271. "EOF</userinput>"
  272. #. type: Content of: <sect1><para>
  273. msgid ""
  274. "The created groups are not part of any standard&mdash;they are groups "
  275. "decided on in part by the requirements of the Udev configuration in Chapter "
  276. "9, and in part by common convention employed by a number of existing Linux "
  277. "distributions. In addition, some test suites rely on specific users or "
  278. "groups. The Linux Standard Base (LSB, available at <ulink url=\"http://"
  279. "refspecs.linuxfoundation.org/lsb.shtml\"/>) only recommends that, besides "
  280. "the group <systemitem class=\"groupname\">root</systemitem> with a Group ID "
  281. "(GID) of 0, a group <systemitem class=\"groupname\">bin</systemitem> with a "
  282. "GID of 1 be present. All other group names and GIDs can be chosen freely by "
  283. "the system administrator since well-written programs do not depend on GID "
  284. "numbers, but rather use the group's name."
  285. msgstr ""
  286. "这里创建的用户组并不属于任何标准 —— 它们一部分是为了满足第 9 章中 Udev 配置的"
  287. "需要,另一部分借鉴了一些 Linux 发行版的通用惯例。另外,某些测试套件需要特定的"
  288. "用户或组。Linux Standard Base (LSB,可以在 <ulink url=\"http://www.linuxbase."
  289. "org\"/> 查看) 标准只推荐以组 ID 0 创建用户组 <systemitem class=\"groupname"
  290. "\">root</systemitem>,以及以组 ID 1 创建用户组 <systemitem class=\"groupname"
  291. "\">bin</systemitem>,其他组名和组 ID 由系统管理员自由分配,因为好的程序不会依"
  292. "赖组 ID 数字,而是使用组名。"
  293. #. type: Content of: <sect1><para>
  294. msgid ""
  295. "Some tests in <xref linkend=\"chapter-building-system\"/> need a regular "
  296. "user. We add this user here and delete this account at the end of that "
  297. "chapter."
  298. msgstr ""
  299. "<xref linkend=\"chapter-building-system\"/>中的一些测试需要使用一个普通用户。"
  300. "我们这里创建一个用户,在那一章的末尾再删除该用户。"
  301. #. type: Content of: <sect1><screen>
  302. #, no-wrap
  303. msgid ""
  304. "<userinput>echo \"tester:x:$(ls -n $(tty) | cut -d\" \" -f3):101::/home/tester:/bin/bash\" &gt;&gt; /etc/passwd\n"
  305. "echo \"tester:x:101:\" &gt;&gt; /etc/group\n"
  306. "install -o tester -d /home/tester</userinput>"
  307. msgstr ""
  308. "<userinput>echo \"tester:x:$(ls -n $(tty) | cut -d\" \" -f3):101::/home/tester:/bin/bash\" &gt;&gt; /etc/passwd\n"
  309. "echo \"tester:x:101:\" &gt;&gt; /etc/group\n"
  310. "install -o tester -d /home/tester</userinput>"
  311. #. type: Content of: <sect1><para>
  312. msgid ""
  313. "To remove the <quote>I have no name!</quote> prompt, start a new shell. "
  314. "Since the <filename>/etc/passwd</filename> and <filename>/etc/group</"
  315. "filename> files have been created, user name and group name resolution will "
  316. "now work:"
  317. msgstr ""
  318. "为了移除 <quote>I have no name!</quote> 提示符,需要打开一个新 shell。由于已"
  319. "经创建了文件 <filename>/etc/passwd</filename> 和 <filename>/etc/group</"
  320. "filename>,用户名和组名现在就可以正常解析了:"
  321. #. type: Content of: <sect1><screen>
  322. #, no-wrap
  323. msgid "<userinput>exec /bin/bash --login +h</userinput>"
  324. msgstr "<userinput>exec /bin/bash --login +h</userinput>"
  325. #. type: Content of: <sect1><para>
  326. msgid ""
  327. "Note the use of the <parameter>+h</parameter> directive. This tells "
  328. "<command>bash</command> not to use its internal path hashing. Without this "
  329. "directive, <command>bash</command> would remember the paths to binaries it "
  330. "has executed. To ensure the use of the newly compiled binaries as soon as "
  331. "they are installed, the <parameter>+h</parameter> directive will be used for "
  332. "the duration of this and the next chapter."
  333. msgstr ""
  334. "注意这里使用了 <parameter>+h</parameter> 参数。它告诉 <command>bash</"
  335. "command> 不要使用内部的路径散列机制。如果没有指定该参数,<command>bash</"
  336. "command> 会记忆它执行过程序的路径。为了在安装新编译好的程序后马上使用它们,在"
  337. "本章和下一章中总是使用 <parameter>+h</parameter>。"
  338. #. type: Content of: <sect1><para>
  339. msgid ""
  340. "The <command>login</command>, <command>agetty</command>, and <command>init</"
  341. "command> programs (and others) use a number of log files to record "
  342. "information such as who was logged into the system and when. However, these "
  343. "programs will not write to the log files if they do not already exist. "
  344. "Initialize the log files and give them proper permissions:"
  345. msgstr ""
  346. "<command>login</command>、<command>agetty</command> 和 <command>init</"
  347. "command> 等程序使用一些日志文件,以记录登录系统的用户和登录时间等信息。然而,"
  348. "这些程序不会创建不存在的日志文件。初始化日志文件,并为它们设置合适的访问权"
  349. "限:"
  350. #. type: Content of: <sect1><screen>
  351. #, no-wrap
  352. msgid ""
  353. "<userinput>touch /var/log/{btmp,lastlog,faillog,wtmp}\n"
  354. "chgrp -v utmp /var/log/lastlog\n"
  355. "chmod -v 664 /var/log/lastlog\n"
  356. "chmod -v 600 /var/log/btmp</userinput>"
  357. msgstr ""
  358. "<userinput>touch /var/log/{btmp,lastlog,faillog,wtmp}\n"
  359. "chgrp -v utmp /var/log/lastlog\n"
  360. "chmod -v 664 /var/log/lastlog\n"
  361. "chmod -v 600 /var/log/btmp</userinput>"
  362. #. type: Content of: <sect1><para>
  363. msgid ""
  364. "The <filename>/var/log/wtmp</filename> file records all logins and logouts. "
  365. "The <filename>/var/log/lastlog</filename> file records when each user last "
  366. "logged in. The <filename>/var/log/faillog</filename> file records failed "
  367. "login attempts. The <filename>/var/log/btmp</filename> file records the bad "
  368. "login attempts."
  369. msgstr ""
  370. "文件 <filename>/var/log/wtmp</filename> 记录所有的登录和登出,文件 "
  371. "<filename>/var/log/lastlog</filename> 记录每个用户最后登录的时间,文件 "
  372. "<filename>/var/log/faillog</filename> 记录所有失败的登录尝试,文件 "
  373. "<filename>/var/log/btmp</filename> 记录所有错误的登录尝试。"
  374. #. type: Content of: <sect1><note><para>
  375. msgid ""
  376. "The <filename>/run/utmp</filename> file records the users that are currently "
  377. "logged in. This file is created dynamically in the boot scripts."
  378. msgstr ""
  379. "文件 <filename>/run/utmp</filename> 记录当前登录的用户,它由引导脚本动态创"
  380. "建。"