2 % This is part of LFSbookja package.
4 % This is a CTIE change file for the original XML source of the LFSbook.
7 <?xml version="1.0" encoding="ISO-8859-1"?>
9 <?xml version="1.0" encoding="UTF-8"?>
13 <title>Creating Essential Files and Symlinks</title>
15 <title>重要なファイルとシンボリックリンクの生成</title>
19 <para>Historically, Linux maintains a list of the mounted file systems in the
20 file <filename>/etc/mtab</filename>. Modern kernels maintain this list
21 internally and expose it to the user via the <filename
22 class="directory">/proc</filename> filesystem. To satisfy utilities that
23 expect the presence of <filename>/etc/mtab</filename>, create the following
27 Linux のこれまでの経緯として、マウントされているファイルシステムの情報は <filename>/etc/mtab</filename> ファイルに保持されています。
28 最新の Linux であれば、内部的にこのファイルを管理し、ユーザーに対しては <filename
29 class="directory">/proc</filename> ファイルシステムを通じて情報提示しています。
30 <filename>/etc/mtab</filename> ファイルの存在を前提としているプログラムが正常動作するように、以下のシンボリックリンクを作成します。
35 <para>Create a basic <filename>/etc/hosts</filename> file to be
36 referenced in some test suites, and in one of Perl's configuration files
40 テストスイートの中に <filename>/etc/hosts</filename> ファイルを参照するものがあるので、単純なものをここで生成します。
41 これは Perl の設定ファイルにおいても参照されます。
46 <para>In order for user <systemitem class="username">root</systemitem> to be
47 able to login and for the name <quote>root</quote> to be recognized, there
48 must be relevant entries in the <filename>/etc/passwd</filename> and
49 <filename>/etc/group</filename> files.</para>
52 <systemitem class="username">root</systemitem> ユーザーがログインできるように、またその<quote>root</quote>という名称を認識できるように <filename>/etc/passwd</filename> ファイルと <filename>/etc/group</filename> ファイルには該当する情報が登録されている必要があります。
57 <para>Create the <filename>/etc/passwd</filename> file by running the following
61 以下のコマンドを実行して <filename>/etc/passwd</filename> ファイルを生成します。
66 <para>The actual password for <systemitem class="username">root</systemitem>
67 will be set later.</para>
70 <systemitem class="username">root</systemitem> ユーザーに対する本当のパスワードは後に定めます。
75 <para>Create the <filename>/etc/group</filename> file by running the following
79 以下のコマンドを実行して <filename>/etc/group</filename> ファイルを生成します。
84 <para>The created groups are not part of any standard—they are groups
85 decided on in part by the requirements of the Udev configuration in Chapter
86 9, and in part by common convention employed by a number of existing Linux
87 distributions. In addition, some test suites rely on specific users or
88 groups. The Linux Standard Base (LSB, available at <ulink
89 url="http://refspecs.linuxfoundation.org/lsb.shtml"/>) only recommends that,
90 besides the group <systemitem class="groupname">root</systemitem> with a
91 Group ID (GID) of 0, a group <systemitem class="groupname">bin</systemitem>
92 with a GID of 1 be present. The GID of 5 is widely used for
93 <systemitem class="groupname">tty</systemitem> group, and the number 5 is
94 also used in <phrase revision="systemd">systemd</phrase>
95 <phrase revision="sysv"><filename>/etc/fstab</filename></phrase> for the
96 <systemitem class="filesystem">devpts</systemitem> filesystem.
97 All other group names and GIDs can be chosen freely by the system
98 administrator since well-written programs do not depend on GID numbers,
99 but rather use the group's name.</para>
102 作成するグループは何かの標準に基づいたものではありません。
103 一部は 9 章の udev の設定に必要となるものですし、一部は既存の Linux ディストリビューションが採用している慣用的なものです。
104 またテストスイートにて特定のユーザーやグループを必要としているものがあります。
105 Linux Standard Base (<ulink url="http://www.linuxbase.org"/> 参照) では <systemitem
106 class="groupname">root</systemitem> グループのグループID (GID) は 0、<systemitem
107 class="groupname">bin</systemitem> グループの GID は 1 を定めているにすぎません。
108 GID 5 は <systemitem class="groupname">tty</systemitem> グループに対して広く用いられています。
109 また数値 5 は <systemitem class="filesystem">devpts</systemitem> ファイルシステムに対して <phrase
110 revision="systemd">systemd</phrase>
111 <phrase revision="sysv"><filename>/etc/fstab</filename></phrase> においても用いられています。
112 他のグループとその GID はシステム管理者が自由に取り決めることができます。
113 というのも通常のプログラムであれば GID の値に依存することはなく、あくまでグループ名を用いてプログラミングされているからです。
118 <para>The ID 65534 is used by the kernel for NFS and separate user
119 namespaces for unmapped users and groups (those exist on the NFS server
120 or the parent user namespace, but <quote>do not exist</quote> on the local
121 machine or in the separate namespace). We assign
122 <systemitem class="username">nobody</systemitem> and
123 <systemitem class="groupname">nogroup</systemitem> for it to avoid an
124 unnamed ID. But other distros may treat this ID differently, so any
125 portable program should not depend on this assignment.</para>
128 ID 65534 は NFS のカーネルが利用し、マップされていないユーザーやグループに対するユーザー名前空間を切り分けます
129 (これは NFS サーバー上や親のユーザー空間に存在しますが、ローカルマシンや分離された名前空間には存在しません)。
130 未割り当ての ID を避けるために、この ID を <systemitem
131 class="username">nobody</systemitem> と <systemitem
132 class="groupname">nogroup</systemitem> に用いることにします。
133 他のディストリビューションにおいては、この ID を異なる用い方をしている場合があるため、移植性を考慮するプログラムでは、ここでの割り当てに依存しないようにしてください。
138 <para>Some tests in <xref linkend="chapter-building-system"/> need a regular
139 user. We add this user here and delete this account at the end of that
143 <xref linkend="chapter-building-system"/> におけるテストの中には、通常のユーザーを必要とするものがあります。
144 ここでそういったユーザーをここで追加し、その章の最後には削除します。
149 <para>To remove the <quote>I have no name!</quote> prompt, start a new
151 <filename>/etc/passwd</filename> and <filename>/etc/group</filename>
152 files have been created, user name and group name resolution will now
156 プロンプトの<quote>I have no name!</quote>を取り除くために新たなシェルを起動します。
157 <filename>/etc/passwd</filename> ファイルと <filename>/etc/group</filename> ファイルを作ったので、ユーザー名とグループ名の名前解決が適切に動作します。
162 <para>The <command>login</command>, <command>agetty</command>, and
163 <command>init</command> programs (and others) use a number of log
164 files to record information such as who was logged into the system and
165 when. However, these programs will not write to the log files if they
166 do not already exist. Initialize the log files and give them
167 proper permissions:</para>
170 <command>login</command>、<command>agetty</command>、<command>init</command> といったプログラム (あるいは他のプログラム) は、システムに誰がいつログインしたかといった情報を多くのログファイルに記録します。
171 しかしログファイルがあらかじめ存在していない場合は、ログファイルの出力が行われません。
172 そこでそのようなログファイルを作成し、適切なパーミッションを与えます。
177 <para>The <filename>/var/log/wtmp</filename> file records all logins and
178 logouts. The <filename>/var/log/lastlog</filename> file records when each
179 user last logged in. The <filename>/var/log/faillog</filename> file records
180 failed login attempts. The <filename>/var/log/btmp</filename> file records
181 the bad login attempts.</para>
184 <filename>/var/log/wtmp</filename> ファイルはすべてのログイン、ログアウトの情報を保持します。
185 <filename>/var/log/lastlog</filename> ファイルは各ユーザーが最後にログインした情報を保持します。
186 <filename>/var/log/faillog</filename> ファイルはログインに失敗した情報を保持します。
187 <filename>/var/log/btmp</filename> ファイルは不正なログイン情報を保持します。
192 <note><para>The <filename>/run/utmp</filename> file records the users that
193 are currently logged in. This file is created dynamically in the boot
194 scripts.</para></note>
197 <filename>/run/utmp</filename> ファイルは現在ログインしているユーザーの情報を保持します。
198 このファイルはブートスクリプトが動的に生成します。