| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 | msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""POT-Creation-Date: 2020-06-17 12:44+0800\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""Language: zh_CN\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n""X-Generator: Translate Toolkit 2.2.5\n"#. type: Content of: <sect1><title>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:11msgid "Creating Essential Files and Symlinks"msgstr "创建必要的文件和符号链接"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:14msgid "/etc/passwd"msgstr "/etc/passwd"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:18msgid "/etc/group"msgstr "/etc/group"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:22msgid "/var/run/utmp"msgstr "/var/run/utmp"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:26msgid "/var/log/btmp"msgstr "/var/log/btmp"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:30msgid "/var/log/lastlog"msgstr "/var/log/lastlog"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:34msgid "/var/log/wtmp"msgstr "/var/log/wtmp"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:37msgid """Historically, Linux maintains a list of the mounted file systems in the file ""<filename>/etc/mtab</filename>. Modern kernels maintain this list internally ""and exposes it to the user via the <filename class=\"directory\">/proc</""filename> filesystem. To satisfy utilities that expect the presence of ""<filename>/etc/mtab</filename>, create the following symbolic link:"msgstr """历史上,Linux 在 <filename>/etc/mtab</filename> 维护已经挂载的文件系统的列""表。现代内核在内部维护该列表,并通过 <filename class=\"directory\">/proc</""filename> 文件系统将它展示给用户。为了满足那些需要 <filename>/etc/mtab</""filename> 的工具,执行以下命令,创建符号链接:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:44#, no-wrapmsgid "<userinput>ln -sv /proc/self/mounts /etc/mtab</userinput>"msgstr "<userinput>ln -sv /proc/self/mounts /etc/mtab</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:46msgid """Create a basic <filename>/etc/hosts</filename> file to be referenced in some ""test suites, and in one of Perl's configuration files as well:"msgstr """创建一个基本的 <filename>/etc/hosts</filename> 文件,""一些测试套件,以及 Perl 的一个配置文件将会使用它:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:50#, no-wrapmsgid "<userinput>echo \"127.0.0.1 localhost $(hostname)\" > /etc/hosts</userinput>"msgstr "<userinput>echo \"127.0.0.1 localhost $(hostname)\" > /etc/hosts</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:52msgid """In order for user <systemitem class=\"username\">root</systemitem> to be ""able to login and for the name <quote>root</quote> to be recognized, there ""must be relevant entries in the <filename>/etc/passwd</filename> and ""<filename>/etc/group</filename> files."msgstr """为了使得 <systemitem class=\"username\">root</systemitem> 能正常登录,而且用""户名 <quote>root</quote> 能被正常识别,必须在文件 <filename>/etc/passwd</""filename> 和 <filename>/etc/groups</filename> 中写入相关的条目。"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:57msgid """Create the <filename>/etc/passwd</filename> file by running the following ""command:"msgstr "执行以下命令创建 <filename>/etc/passwd</filename> 文件:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:60#, no-wrapmsgid """<userinput>cat > /etc/passwd << \"EOF\"\n""<literal>root:x:0:0:root:/root:/bin/bash\n""bin:x:1:1:bin:/dev/null:/bin/false\n""daemon:x:6:6:Daemon User:/dev/null:/bin/false\n""messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n""nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n""EOF</userinput>"msgstr """<userinput>cat > /etc/passwd << \"EOF\"\n""<literal>root:x:0:0:root:/root:/bin/bash\n""bin:x:1:1:bin:/dev/null:/bin/false\n""daemon:x:6:6:Daemon User:/dev/null:/bin/false\n""messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n""nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n""EOF</userinput>"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:68#, no-wrapmsgid """<userinput>cat > /etc/passwd << \"EOF\"\n""<literal>root:x:0:0:root:/root:/bin/bash\n""bin:x:1:1:bin:/dev/null:/bin/false\n""daemon:x:6:6:Daemon User:/dev/null:/bin/false\n""messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n""systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false\n""systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false\n""systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false\n""systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false\n""systemd-network:x:76:76:systemd Network Management:/:/bin/false\n""systemd-resolve:x:77:77:systemd Resolver:/:/bin/false\n""systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false\n""systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false\n""nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n""EOF</userinput>"msgstr """<userinput>cat > /etc/passwd << \"EOF\"\n""<literal>root:x:0:0:root:/root:/bin/bash\n""bin:x:1:1:bin:/dev/null:/bin/false\n""daemon:x:6:6:Daemon User:/dev/null:/bin/false\n""messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false\n""systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false\n""systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false\n""systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false\n""systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false\n""systemd-network:x:76:76:systemd Network Management:/:/bin/false\n""systemd-resolve:x:77:77:systemd Resolver:/:/bin/false\n""systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false\n""systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false\n""nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal>\n""EOF</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:84msgid """The actual password for <systemitem class=\"username\">root</systemitem> ""will be set later."msgstr """我们以后再设置 <systemitem class=\"username\">root</systemitem> 用户的实际密""码。"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:87msgid """Create the <filename>/etc/group</filename> file by running the following ""command:"msgstr "执行以下命令,创建 <filename>/etc/group</filename> 文件:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:90#, no-wrapmsgid """<userinput>cat > /etc/group << \"EOF\"\n""<literal>root:x:0:\n""bin:x:1:daemon\n""sys:x:2:\n""kmem:x:3:\n""tape:x:4:\n""tty:x:5:\n""daemon:x:6:\n""floppy:x:7:\n""disk:x:8:\n""lp:x:9:\n""dialout:x:10:\n""audio:x:11:\n""video:x:12:\n""utmp:x:13:\n""usb:x:14:\n""cdrom:x:15:\n""adm:x:16:\n""messagebus:x:18:\n""input:x:24:\n""mail:x:34:\n""kvm:x:61:\n""wheel:x:97:\n""nogroup:x:99:\n""users:x:999:</literal>\n""EOF</userinput>"msgstr """<userinput>cat > /etc/group << \"EOF\"\n""<literal>root:x:0:\n""bin:x:1:daemon\n""sys:x:2:\n""kmem:x:3:\n""tape:x:4:\n""tty:x:5:\n""daemon:x:6:\n""floppy:x:7:\n""disk:x:8:\n""lp:x:9:\n""dialout:x:10:\n""audio:x:11:\n""video:x:12:\n""utmp:x:13:\n""usb:x:14:\n""cdrom:x:15:\n""adm:x:16:\n""messagebus:x:18:\n""input:x:24:\n""mail:x:34:\n""kvm:x:61:\n""wheel:x:97:\n""nogroup:x:99:\n""users:x:999:</literal>\n""EOF</userinput>"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:117#, no-wrapmsgid """<userinput>cat > /etc/group << \"EOF\"\n""<literal>root:x:0:\n""bin:x:1:daemon\n""sys:x:2:\n""kmem:x:3:\n""tape:x:4:\n""tty:x:5:\n""daemon:x:6:\n""floppy:x:7:\n""disk:x:8:\n""lp:x:9:\n""dialout:x:10:\n""audio:x:11:\n""video:x:12:\n""utmp:x:13:\n""usb:x:14:\n""cdrom:x:15:\n""adm:x:16:\n""messagebus:x:18:\n""systemd-journal:x:23:\n""input:x:24:\n""mail:x:34:\n""kvm:x:61:\n""systemd-bus-proxy:x:72:\n""systemd-journal-gateway:x:73:\n""systemd-journal-remote:x:74:\n""systemd-journal-upload:x:75:\n""systemd-network:x:76:\n""systemd-resolve:x:77:\n""systemd-timesync:x:78:\n""systemd-coredump:x:79:\n""wheel:x:97:\n""nogroup:x:99:\n""users:x:999:</literal>\n""EOF</userinput>"msgstr """<userinput>cat > /etc/group << \"EOF\"\n""<literal>root:x:0:\n""bin:x:1:daemon\n""sys:x:2:\n""kmem:x:3:\n""tape:x:4:\n""tty:x:5:\n""daemon:x:6:\n""floppy:x:7:\n""disk:x:8:\n""lp:x:9:\n""dialout:x:10:\n""audio:x:11:\n""video:x:12:\n""utmp:x:13:\n""usb:x:14:\n""cdrom:x:15:\n""adm:x:16:\n""messagebus:x:18:\n""systemd-journal:x:23:\n""input:x:24:\n""mail:x:34:\n""kvm:x:61:\n""systemd-bus-proxy:x:72:\n""systemd-journal-gateway:x:73:\n""systemd-journal-remote:x:74:\n""systemd-journal-upload:x:75:\n""systemd-network:x:76:\n""systemd-resolve:x:77:\n""systemd-timesync:x:78:\n""systemd-coredump:x:79:\n""wheel:x:97:\n""nogroup:x:99:\n""users:x:999:</literal>\n""EOF</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:153msgid """The created groups are not part of any standard—they are groups ""decided on in part by the requirements of the Udev configuration in Chapter ""9, and in part by common convention employed by a number of existing Linux ""distributions. In addition, some test suites rely on specific users or ""groups.  The Linux Standard Base (LSB, available at <ulink url=\"http://""refspecs.linuxfoundation.org/lsb.shtml\"/>) only recommends that, besides ""the group <systemitem class=\"groupname\">root</systemitem> with a Group ID ""(GID) of 0, a group <systemitem class=\"groupname\">bin</systemitem> with a ""GID of 1 be present. All other group names and GIDs can be chosen freely by ""the system administrator since well-written programs do not depend on GID ""numbers, but rather use the group's name."msgstr """这里创建的用户组并不属于任何标准 —— 它们一部分是为了满足第 9 章中 Udev 配置的需""要,另一部分借鉴了一些 Linux 发行版的通用惯例。另外,某些测试套件需要特定的""用户或组。Linux Standard Base (LSB,可以在 <ulink url=\"http://www.""linuxbase.org\"/> 查看) 标准只推荐以组 ID 0 创建用户组 <systemitem class=""\"groupname\">root</systemitem>,以及以组 ID 1 创建用户组 <systemitem class=""\"groupname\">bin</systemitem>,其他组名和组 ID 由系统管理员自由分配,因为好""的程序不会依赖组 ID 数字,而是使用组名。"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:165msgid """Some tests in <xref linkend=\"chapter-building-system\"/> need a regular ""user. We add this user here and delete this account at the end of that ""chapter."msgstr """<xref linkend=\"chapter-building-system\"/>""中的一些测试需要使用一个普通用户。我们这里创建一个用户,""在那一章的末尾再删除该用户。"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:169#, no-wrapmsgid """<userinput>echo \"tester:x:$(ls -n $(tty) | cut -d\" \" -f3):101::/home/tester:/bin/bash\" >> /etc/passwd\n""echo \"tester:x:101:\" >> /etc/group\n""install -o tester -d /home/tester</userinput>"msgstr """<userinput>echo \"tester:x:$(ls -n $(tty) | cut -d\" \" -f3):101::/home/tester:/bin/bash\" >> /etc/passwd\n""echo \"tester:x:101:\" >> /etc/group\n""install -o tester -d /home/tester</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:173msgid """To remove the <quote>I have no name!</quote> prompt, start a new shell. ""Since the <filename>/etc/passwd</filename> and <filename>/etc/group</""filename> files have been created, user name and group name resolution will ""now work:"msgstr """为了移除 <quote>I have no name!</quote> 提示符,需要打开一个新 shell。由于""已经创建了文件 <filename>/etc/passwd</filename> 和 <filename>/etc/group</""filename>,用户名和组名现在就可以正常解析了:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:179#, no-wrapmsgid "<userinput>exec /bin/bash --login +h</userinput>"msgstr "<userinput>exec /bin/bash --login +h</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:181msgid """Note the use of the <parameter>+h</parameter> directive. This tells ""<command>bash</command> not to use its internal path hashing. Without this ""directive, <command>bash</command> would remember the paths to binaries it ""has executed. To ensure the use of the newly compiled binaries as soon as ""they are installed, the <parameter>+h</parameter> directive will be used for ""the duration of this and the next chapter."msgstr """注意这里使用了 <parameter>+h</parameter> 参数。它告诉 <command>bash</""command> 不要使用内部的路径散列机制。如果没有指定该参数,<command>bash</""command> 会记忆它执行过程序的路径。为了在安装新编译好的程序后马上使用它们,""在本章和下一章中总是使用 <parameter>+h</parameter>。"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:188msgid """The <command>login</command>, <command>agetty</command>, and <command>init</""command> programs (and others) use a number of log files to record ""information such as who was logged into the system and when. However, these ""programs will not write to the log files if they do not already exist. ""Initialize the log files and give them proper permissions:"msgstr """<command>login</command>、<command>agetty</command> 和 <command>init</""command> 等程序使用一些日志文件,以记录登录系统的用户和登录时间等信息。然""而,这些程序不会创建不存在的日志文件。初始化日志文件,并为它们设置合适的访问""权限:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:195#, no-wrapmsgid """<userinput>touch /var/log/{btmp,lastlog,faillog,wtmp}\n""chgrp -v utmp /var/log/lastlog\n""chmod -v 664  /var/log/lastlog\n""chmod -v 600  /var/log/btmp</userinput>"msgstr """<userinput>touch /var/log/{btmp,lastlog,faillog,wtmp}\n""chgrp -v utmp /var/log/lastlog\n""chmod -v 664  /var/log/lastlog\n""chmod -v 600  /var/log/btmp</userinput>"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:200msgid """The <filename>/var/log/wtmp</filename> file records all logins and logouts. ""The <filename>/var/log/lastlog</filename> file records when each user last ""logged in. The <filename>/var/log/faillog</filename> file records failed ""login attempts.  The <filename>/var/log/btmp</filename> file records the bad ""login attempts."msgstr """文件 <filename>/var/log/wtmp</filename> 记录所有的登录和登出,文件 ""<filename>/var/log/lastlog</filename> 记录每个用户最后登录的时间,文件 ""<filename>/var/log/faillog</filename> 记录所有失败的登录尝试,文件 ""<filename>/var/log/btmp</filename> 记录所有错误的登录尝试。"#. type: Content of: <sect1><note><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:206msgid """The <filename>/run/utmp</filename> file records the users that are currently ""logged in.  This file is created dynamically in the boot scripts."msgstr """文件 <filename>/run/utmp</filename> 记录当前登录的用户,它由引导脚本动态创""建。"
 |