# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy 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 \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: Content of: #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:11 msgid "Creating Essential Files and Symlinks" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:14 msgid "/etc/passwd" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:18 msgid "/etc/group" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:22 msgid "/var/run/utmp" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:26 msgid "/var/log/btmp" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:30 msgid "/var/log/lastlog" msgstr "" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:34 msgid "/var/log/wtmp" msgstr "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:37 msgid "" "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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:44 #, no-wrap msgid "<userinput>ln -sv /proc/self/mounts /etc/mtab</userinput>" msgstr "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:46 msgid "" "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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:50 #, no-wrap msgid "" "<userinput>echo \"127.0.0.1 localhost $(hostname)\" > " "/etc/hosts</userinput>" msgstr "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:52 msgid "" "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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:57 msgid "" "Create the <filename>/etc/passwd</filename> file by running the following " "command:" msgstr "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:60 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:68 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:84 msgid "" "The actual password for <systemitem class=\"username\">root</systemitem> " "will be set later." msgstr "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:87 msgid "" "Create the <filename>/etc/group</filename> file by running the following " "command:" msgstr "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:90 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:117 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:153 msgid "" "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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:165 msgid "" "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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:169 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:173 msgid "" "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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:179 #, no-wrap msgid "<userinput>exec /bin/bash --login +h</userinput>" msgstr "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:181 msgid "" "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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:188 msgid "" "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 "" #. type: Content of: <sect1><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:195 #, no-wrap msgid "" "<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 "" #. type: Content of: <sect1><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:200 msgid "" "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 "" #. type: Content of: <sect1><note><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter07/createfiles.xml:206 msgid "" "The <filename>/run/utmp</filename> file records the users that are currently " "logged in. This file is created dynamically in the boot scripts." msgstr ""