]> git.proxmox.com Git - mirror_lxc.git/blame - doc/ja/lxc.container.conf.sgml.in
Fix syntax error in lxc-download
[mirror_lxc.git] / doc / ja / lxc.container.conf.sgml.in
CommitLineData
fb261f53
KY
1<!--
2
3lxc: linux Container library
4
5(C) Copyright IBM Corp. 2007, 2008
6
7Authors:
8Daniel Lezcano <daniel.lezcano at free.fr>
9
10This library is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2.1 of the License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public
21License along with this library; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24Translated into Japanese
25by KATOH Yasufumi <karma at jazz.email.ne.jp>
26
27-->
28
29<!DOCTYPE refentry PUBLIC @docdtd@ [
30
31<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
32]>
33
34<refentry>
35
36 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
37
38 <refmeta>
39 <refentrytitle>lxc.container.conf</refentrytitle>
40 <manvolnum>5</manvolnum>
41 </refmeta>
42
43 <refnamediv>
44 <refname>lxc.container.conf</refname>
45
46 <refpurpose>
47 <!--
48 LXC container configuration file
49 -->
50 LXC コンテナ設定ファイル
51 </refpurpose>
52 </refnamediv>
53
54 <refsect1>
55 <title><!-- Description -->説明</title>
56
57 <para>
58 <!--
2513f519
KY
59 LXC is the well-known and heavily tested low-level Linux container
60 runtime. It is in active development since 2008 and has proven itself in
61 critical production environments world-wide. Some of its core contributors
62 are the same people that helped to implement various well-known
63 containerization features inside the Linux kernel.
64 -->
65 LXC は良く知られた、多くのテストが行われた Linux コンテナのランタイムです。LXC は、2008 年以来アクティブに開発されており、世界中の重要な本番環境で実証されています。開発への貢献者の中には、Linux カーネル内の良く知られた様々なコンテナ機能の実装に貢献した人と同じ人もいます。
fb261f53
KY
66 </para>
67
68 <para>
69 <!--
2513f519
KY
70 LXC's main focus is system containers. That is, containers which offer an
71 environment as close as possible as the one you'd get from a VM but
72 without the overhead that comes with running a separate kernel and
73 simulating all the hardware.
74 -->
75 LXC は主にシステムコンテナにフォーカスを当てています。つまり、VM で得られる環境と可能な限り近い環境を提供を提供するにも関わらず、別々のカーネルを実行したり、ハードウェアをすべてシミュレートしたりすることによるオーバーヘッドがないコンテナのことです。
76 </para>
77
78 <para>
79 <!--
80 This is achieved through a combination of kernel security features such as
81 namespaces, mandatory access control and control groups.
82 -->
83 このような環境は、名前空間 (namespace)、強制アクセスコントロール、cgroup といったカーネルのセキュリティ機能の組み合わせで実現しています。
84 </para>
85
86 <para>
87 <!--
88 LXC has supports unprivileged containers. Unprivileged containers are
89 containers that are run without any privilege. This requires support for
90 user namespaces in the kernel that the container is run on. LXC was the
91 first runtime to support unprivileged containers after user namespaces
92 were merged into the mainline kernel.
93 -->
94 LXC は非特権コンテナをサポートしています。非特権コンテナは、いかなる特権も持たずに実行するコンテナです。非特権コンテナの実行には、コンテナを実行しているカーネルにユーザ名前空間 (user namespace) のサポートが必要です。LXC は、ユーザ名前空間がメインラインカーネルにマージされてから、初めて非特権コンテナをサポートしたランタイムです。
95 </para>
96
97 <para>
98 <!--
99 In essence, user namespaces isolate given sets of UIDs and GIDs. This is
100 achieved by establishing a mapping between a range of UIDs and GIDs on the
101 host to a different (unprivileged) range of UIDs and GIDs in the
102 container. The kernel will translate this mapping in such a way that
103 inside the container all UIDs and GIDs appear as you would expect from the
104 host whereas on the host these UIDs and GIDs are in fact unprivileged. For
105 example, a process running as UID and GID 0 inside the container might
106 appear as UID and GID 100000 on the host. The implementation and working
107 details can be gathered from the corresponding user namespace man page.
108 UID and GID mappings can be defined with the <option>lxc.id_map</option>
109 key.
110 -->
111 本質的には、ユーザ名前空間は与えられた UID、GID の組を隔離します。ユーザ名前空間は、ホスト上の UID、GID のある範囲を、それとは異なるコンテナ上の UID、GID の範囲へマッピングすることで実現します。カーネルは、ホスト上では実際には UID、GID は特権を持たないにも関わらず、コンテナ内ではすべての UID、GID が期待されるように見えるように変換を行います。
112 例えば、コンテナ内では UID、GID が 0 として実行中のプロセスは、ホスト上では UID、GID が 100000 として見えるでしょう。実装と動作の詳細は、ユーザ名前空間の man ページから得られます。UID と GID のマッピングは <option>lxc.id_map</option> を使って定義できます。
fb261f53
KY
113 </para>
114
115 <para>
116 <!--
2513f519
KY
117 Linux containers are defined with a simple configuration file. Each
118 option in the configuration file has the form <command>key =
119 value</command> fitting in one line. The "#" character means the line is a
120 comment. List options, like capabilities and cgroups options, can be used
121 with no value to clear any previously defined values of that option.
122 -->
123 Linux コンテナは、簡単な設定ファイルで定義します。設定ファイル中のオプションは <command>key = value</command> の形で一行で表します。'#' は、その行はコメントであることを示します。ケーパビリティや cgroup のオプションのような、リスト形式で指定するオプションでは、value がない形式で指定でき、そのように使うと、それ以前に定義した値をすべてクリアします。
124 </para>
125
126 <para>
127 <!--
128 LXC namespaces configuration keys by using single dots. This means complex
7fa3f2e9 129 configuration keys such as <option>lxc.net.0</option> expose various
130 subkeys such as <option>lxc.net.0.type</option>,
131 <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6</option>, and
2513f519 132 others for even more fine-grained configuration.
fb261f53 133 -->
7fa3f2e9 134 LXC は、シングルドットを使って設定キーの名前空間を表します。<option>lxc.net.0</option> のような複雑な設定キーは、<option>lxc.net.0.type</option>、<option>lxc.net.0.link</option>、<option>lxc.net.0.ipv6</option> や、さらに細分化された設定向けの色々なサブキーを持つことを意味します。
fb261f53
KY
135 </para>
136
137 <refsect2>
138 <title><!-- Configuration -->設定</title>
139 <para>
140 <!--
2513f519
KY
141 In order to ease administration of multiple related containers, it is
142 possible to have a container configuration file cause another file to be
143 loaded. For instance, network configuration can be defined in one common
144 file which is included by multiple containers. Then, if the containers
145 are moved to another host, only one file may need to be updated.
146 -->
dc421f3a
KY
147 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。
148 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。
149 その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。
fb261f53
KY
150 </para>
151
152 <variablelist>
50a8555e
KY
153 <varlistentry>
154 <term>
155 <option>lxc.include</option>
156 </term>
157 <listitem>
158 <para>
fb261f53 159 <!--
50a8555e
KY
160 Specify the file to be included. The included file must be
161 in the same valid lxc configuration file format.
fb261f53 162 -->
dc421f3a
KY
163 include させたいファイルを指定します。
164 include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。
50a8555e
KY
165 </para>
166 </listitem>
167 </varlistentry>
fb261f53
KY
168 </variablelist>
169 </refsect2>
170
171 <refsect2>
172 <title><!-- Architecture -->アーキテクチャ</title>
173 <para>
174 <!--
2513f519
KY
175 Allows one to set the architecture for the container. For example, set a
176 32bits architecture for a container running 32bits binaries on a 64bits
177 host. This fixes the container scripts which rely on the architecture to
178 do some work like downloading the packages.
fb261f53 179 -->
dc421f3a
KY
180 コンテナに対してアーキテクチャを設定することが可能です。
181 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。
182 この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。
fb261f53
KY
183 </para>
184
185 <variablelist>
50a8555e
KY
186 <varlistentry>
187 <term>
188 <option>lxc.arch</option>
189 </term>
190 <listitem>
191 <para>
fb261f53 192 <!--
50a8555e 193 Specify the architecture for the container.
fb261f53 194 -->
dc421f3a 195 コンテナに設定するアーキテクチャを指定します。
50a8555e
KY
196 </para>
197 <para>
fb261f53 198 <!--
2513f519
KY
199 Some valid options are
200 <option>x86</option>,
201 <option>i686</option>,
202 <option>x86_64</option>,
203 <option>amd64</option>
204 -->
205 有効なオプションには以下のようなものがあります。
206 <option>x86</option>,
207 <option>i686</option>,
208 <option>x86_64</option>,
209 <option>amd64</option>
210 </para>
211 </listitem>
212 </varlistentry>
fb261f53
KY
213 </variablelist>
214
215 </refsect2>
216
217 <refsect2>
218 <title><!-- Hostname -->ホスト名</title>
219 <para>
220 <!--
2513f519
KY
221 The utsname section defines the hostname to be set for the container.
222 That means the container can set its own hostname without changing the
223 one from the system. That makes the hostname private for the container.
fb261f53 224 -->
dc421f3a
KY
225 utsname セクションは、コンテナに設定されるホスト名を定義します。
226 コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。
227 このことにより、ホスト名はコンテナ専用となります。
fb261f53
KY
228 </para>
229 <variablelist>
50a8555e
KY
230 <varlistentry>
231 <term>
b67771bc 232 <option>lxc.uts.name</option>
50a8555e
KY
233 </term>
234 <listitem>
235 <para>
fb261f53 236 <!--
50a8555e 237 specify the hostname for the container
fb261f53 238 -->
dc421f3a 239 コンテナのホスト名を指定します。
50a8555e
KY
240 </para>
241 </listitem>
242 </varlistentry>
fb261f53
KY
243 </variablelist>
244 </refsect2>
245
246 <refsect2>
247 <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title>
248 <para>
50a8555e 249 <!--
2513f519
KY
250 Allows one to specify signal name or number sent to the container's
251 init process to cleanly shutdown the container. Different init systems
252 could use different signals to perform clean shutdown sequence. This
253 option allows the signal to be specified in kill(1) fashion, e.g.
254 SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is
255 SIGPWR.
50a8555e 256 -->
2513f519 257 コンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定できます。init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。このオプションではシグナルとして kill(1) で使う形式を指定できます。
dc421f3a 258 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。
fb261f53
KY
259 </para>
260 <variablelist>
ea4cadbf
KY
261 <varlistentry>
262 <term>
55c84efc 263 <option>lxc.signal.halt</option>
ea4cadbf
KY
264 </term>
265 <listitem>
266 <para>
267 <!--
268 specify the signal used to halt the container
269 -->
270 コンテナをシャットダウンするために使うシグナルを指定します。
271 </para>
272 </listitem>
273 </varlistentry>
274 </variablelist>
275 </refsect2>
276
277 <refsect2>
278 <title>リブート時のシグナル <!-- Reboot signal --></title>
279 <para>
280 <!--
2513f519
KY
281 Allows one to specify signal name or number to reboot the container.
282 This option allows signal to be specified in kill(1) fashion, e.g.
283 SIGTERM, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal
284 is SIGINT.
fb261f53 285 -->
2513f519 286 コンテナをリブートするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
ea4cadbf
KY
287 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGINT です。
288 </para>
289 <variablelist>
290 <varlistentry>
291 <term>
55c84efc 292 <option>lxc.signal.reboot</option>
ea4cadbf
KY
293 </term>
294 <listitem>
295 <para>
296 <!--
297 specify the signal used to reboot the container
298 -->
299 コンテナをリブートするために使うシグナルを指定します。
300 </para>
301 </listitem>
302 </varlistentry>
fb261f53
KY
303 </variablelist>
304 </refsect2>
305
306 <refsect2>
307 <title><!-- Stop signal -->強制停止時のシグナル</title>
308 <para>
309 <!--
2513f519
KY
310 Allows one to specify signal name or number to forcibly shutdown the
311 container. This option allows signal to be specified in kill(1) fashion,
312 e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default
313 signal is SIGKILL.
ea4cadbf 314 -->
2513f519 315 コンテナを強制的にシャットダウンするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
dc421f3a 316 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。
fb261f53
KY
317 </para>
318 <variablelist>
ea4cadbf
KY
319 <varlistentry>
320 <term>
55c84efc 321 <option>lxc.signal.stop</option>
ea4cadbf
KY
322 </term>
323 <listitem>
324 <para>
325 <!--
326 specify the signal used to stop the container
327 -->
328 コンテナを停止するのに使用するシグナルを指定します。
329 </para>
330 </listitem>
331 </varlistentry>
fb261f53
KY
332 </variablelist>
333 </refsect2>
334
c881c406
KY
335 <refsect2>
336 <title><!-- Init command -->Init コマンド</title>
337 <para>
338 <!--
339 Sets the command to use as the init system for the containers.
340
341 This option is ignored when using lxc-execute.
342
343 Defaults to: /sbin/init
344 -->
345 コンテナの init として使うコマンドを設定します。
346 このオプションは lxc-execute では無視されます。
347 デフォルトは /sbin/init です。
348 </para>
349 <variablelist>
350 <varlistentry>
351 <term>
9dcf7b4d 352 <option>lxc.init.cmd</option>
c881c406
KY
353 </term>
354 <listitem>
355 <para>
356 <!--
357 Absolute path from container rootfs to the binary to use as init.
358 -->
359 init として使うバイナリの、コンテナの rootfs からの絶対パスを指定します。
360 </para>
361 </listitem>
362 </varlistentry>
363 </variablelist>
364 </refsect2>
365
7ee64c0f
KY
366 <refsect2>
367 <title><!-- Init ID -->Init が使う ID</title>
368 <para>
50a8555e 369 <!--
2513f519
KY
370 Sets the UID/GID to use for the init system, and subsequent commands.
371 Note that using a non-root uid when booting a system container will
372 likely not work due to missing privileges. Setting the UID/GID is mostly
373 useful when running application container.
7ee64c0f 374
7ee64c0f 375 Defaults to: UID(0), GID(0)
50a8555e
KY
376 -->
377 init と後続のコマンドが使う UID/GID を設定します。システムコンテナを起動するのに非 root な UID を使うと、特権がないために動作しないでしょう。UID/GID の指定は、通常はアプリケーションコンテナの動作の際に役に立ちます。
2513f519 378
50a8555e 379 デフォルト値: UID(0)、GID(0)
7ee64c0f
KY
380 </para>
381 <variablelist>
382 <varlistentry>
383 <term>
9dcf7b4d 384 <option>lxc.init.uid</option>
7ee64c0f
KY
385 </term>
386 <listitem>
387 <para>
50a8555e
KY
388 <!--
389 UID to use for init.
390 -->
2513f519 391 init が使う UID です。
7ee64c0f
KY
392 </para>
393 </listitem>
394 </varlistentry>
395 <varlistentry>
396 <term>
9dcf7b4d 397 <option>lxc.init.gid</option>
7ee64c0f
KY
398 </term>
399 <listitem>
400 <para>
401 <!--
2513f519 402 GID to use for init.
7ee64c0f 403 -->
2513f519 404 init が使う GID です。
7ee64c0f
KY
405 </para>
406 </listitem>
407 </varlistentry>
408 </variablelist>
409 </refsect2>
410
7346eb3a
KY
411 <refsect2>
412 <title><!-- Ephemeral -->一時的なコンテナ</title>
413 <para>
414 <!--
415 Allows one to specify whether a container will be destroyed on shutdown.
416 -->
417 シャットダウン後にコンテナを削除するかどうかを指定できます。
418 </para>
419 <variablelist>
420 <varlistentry>
421 <term>
422 <option>lxc.ephemeral</option>
423 </term>
424 <listitem>
425 <para>
426 <!--
427 The only allowed values are 0 and 1. Set this to 1 to destroy a
428 container on shutdown.
429 -->
430 指定できる値は 0 または 1 のみです。この値を 1 に設定すると、シャットダウン後にコンテナを削除します。
431 </para>
432 </listitem>
433 </varlistentry>
434 </variablelist>
435 </refsect2>
436
fb261f53
KY
437 <refsect2>
438 <title><!-- Network -->ネットワーク</title>
439 <para>
440 <!--
50a8555e
KY
441 The network section defines how the network is virtualized in
442 the container. The network virtualization acts at layer
443 two. In order to use the network virtualization, parameters
444 must be specified to define the network interfaces of the
445 container. Several virtual interfaces can be assigned and used
446 in a container even if the system has only one physical
447 network interface.
fb261f53 448 -->
dc421f3a
KY
449 ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。
450 ネットワークの仮想化はレイヤー 2 で作動します。
451 ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。
452 いくつかの仮想インターフェースをアサインすることができます。
453 そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。
fb261f53
KY
454 </para>
455 <variablelist>
3f45936b
KY
456 <varlistentry>
457 <term>
7fa3f2e9 458 <option>lxc.net</option>
3f45936b
KY
459 </term>
460 <listitem>
461 <para>
462 <!--
463 may be used without a value to clear all previous network options.
464 -->
465 値を指定せずに使い、それ以前に定義されたすべてのネットワークオプションをクリアできます。
466 </para>
467 </listitem>
468 </varlistentry>
50a8555e
KY
469 <varlistentry>
470 <term>
7fa3f2e9 471 <option>lxc.net.[i].type</option>
50a8555e
KY
472 </term>
473 <listitem>
2513f519 474 <para>
50a8555e 475 <!--
2513f519
KY
476 specify what kind of network virtualization to be used
477 for the container.
478 Multiple networks can be specified by using an additional index
479 <option>i</option>
7fa3f2e9 480 after all <option>lxc.net.*</option> keys. For example,
481 <option>lxc.net.0.type = veth</option> and
482 <option>lxc.net.1.type = veth</option> specify two different
2513f519
KY
483 networks of the same type. All keys sharing the same index
484 <option>i</option> will be treated as belonging to the same
7fa3f2e9 485 network. For example, <option>lxc.net.0.link = br0</option>
486 will belong to <option>lxc.net.0.type</option>.
2513f519 487 Currently, the different virtualization types can be:
50a8555e 488 -->
7fa3f2e9 489 コンテナがどの種類のネットワーク仮想化を使うかを指定します。すべての <option>lxc.net.*</option> キーに、追加のインデックス <option>i</option> を使うと、複数のネットワークを指定できます。例えば、<option>lxc.net.0.type = veth</option> と <option>lxc.net.1.type = veth</option> は、同じタイプの異なるネットワークを 2 つ指定します。
490 同じインデックスを指定したキーはすべて同じネットワークの指定になります。例えば、<option>lxc.net.0.link = br0</option> は <option>lxc.net.0.type</option> と同じネットワークの設定になります。
50a8555e 491 現時点では、以下のネットワーク仮想化のタイプが使えます:
2513f519 492 </para>
fb261f53 493
50a8555e 494 <para>
fb261f53 495 <!--
50a8555e
KY
496 <option>none:</option> will cause the container to share
497 the host's network namespace. This means the host
498 network devices are usable in the container. It also
499 means that if both the container and host have upstart as
500 init, 'halt' in a container (for instance) will shut down the
501 host.
fb261f53 502 -->
dc421f3a
KY
503 <option>none:</option> ホストのネットワーク名前空間を共有します。
504 これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。
505 もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。
50a8555e 506 </para>
fb261f53 507
50a8555e 508 <para>
fb261f53 509 <!--
50a8555e
KY
510 <option>empty:</option> will create only the loopback
511 interface.
fb261f53 512 -->
50a8555e
KY
513 <option>empty:</option> ループバックインターフェースだけを作成します。
514 </para>
fb261f53 515
ac11ab33 516 <para>
fb261f53 517 <!--
ac11ab33
KY
518 <option>veth:</option> a virtual ethernet pair
519 device is created with one side assigned to the container
520 and the other side attached to a bridge specified by
7fa3f2e9 521 the <option>lxc.net.[i].link</option> option.
ac11ab33
KY
522 If the bridge is not specified, then the veth pair device
523 will be created but not attached to any bridge.
524 Otherwise, the bridge has to be created on the system
525 before starting the container.
526 <command>lxc</command> won't handle any
527 configuration outside of the container.
528 By default, <command>lxc</command> chooses a name for the
529 network device belonging to the outside of the
530 container, but if you wish to handle
531 this name yourselves, you can tell <command>lxc</command>
532 to set a specific name with
7fa3f2e9 533 the <option>lxc.net.[i].veth.pair</option> option (except for
ac11ab33
KY
534 unprivileged containers where this option is ignored for security
535 reasons).
fb261f53 536 -->
7fa3f2e9 537 <option>veth:</option > 一方がコンテナに、もう一方が <option>lxc.net.[i].link</option> オプションで指定されたブリッジに接続されるペアの仮想イーサネットデバイスを作成します。
ac11ab33
KY
538 もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。
539 ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。
540 <command>lxc</command> はコンテナ外の設定を扱うことはありません。
541 デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。
7fa3f2e9 542 しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。
ac11ab33 543 </para>
fb261f53 544
50a8555e 545 <para>
fb261f53 546 <!--
50a8555e
KY
547 <option>vlan:</option> a vlan interface is linked with
548 the interface specified by
7fa3f2e9 549 the <option>lxc.net.[i].link</option> and assigned to
50a8555e 550 the container. The vlan identifier is specified with the
7fa3f2e9 551 option <option>lxc.net.[i].vlan.id</option>.
fb261f53 552 -->
7fa3f2e9 553 <option>vlan:</option> vlan インターフェースは <option>lxc.net.[i].link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。
554 vlan の指定は <option>lxc.net.[i].vlan.id</option> オプションで指定します。
50a8555e 555 </para>
fb261f53 556
50a8555e 557 <para>
fb261f53 558 <!--
50a8555e
KY
559 <option>macvlan:</option> a macvlan interface is linked
560 with the interface specified by
7fa3f2e9 561 the <option>lxc.net.[i].link</option> and assigned to
50a8555e 562 the container.
7fa3f2e9 563 <option>lxc.net.[i].macvlan.mode</option> specifies the
50a8555e
KY
564 mode the macvlan will use to communicate between
565 different macvlan on the same upper device. The accepted
5a56eeb6
KY
566 modes are <option>private</option>, <option>vepa</option>,
567 <option>bridge</option> and <option>passthru</option>.
50a8555e 568 In <option>private</option> mode, the device never
5a56eeb6
KY
569 communicates with any other device on the same upper_dev (default).
570 In <option>vepa</option> mode, the new Virtual Ethernet Port
50a8555e
KY
571 Aggregator (VEPA) mode, it assumes that the adjacent
572 bridge returns all frames where both source and
573 destination are local to the macvlan port, i.e. the
574 bridge is set up as a reflective relay. Broadcast
575 frames coming in from the upper_dev get flooded to all
576 macvlan interfaces in VEPA mode, local frames are not
5a56eeb6 577 delivered locally. In <option>bridge</option> mode, it
50a8555e
KY
578 provides the behavior of a simple bridge between
579 different macvlan interfaces on the same port. Frames
580 from one interface to another one get delivered directly
581 and are not sent out externally. Broadcast frames get
582 flooded to all other bridge ports and to the external
583 interface, but when they come back from a reflective
584 relay, we don't deliver them again. Since we know all
585 the MAC addresses, the macvlan bridge mode does not
5a56eeb6
KY
586 require learning or STP like the bridge module does. In
587 <option>passthru</option> mode, all frames received by
588 the physical interface are forwarded to the macvlan
589 interface. Only one macvlan interface in <option>passthru</option>
590 mode is possible for one physical interface.
fb261f53 591 -->
7fa3f2e9 592 <option>macvlan:</option> macvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
593 <option>lxc.net.[i].macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan の間の通信をする時に使います。
5a56eeb6
KY
594 指定できるモードは <option>private</option>、<option>vepa</option>、<option>bridge</option>、<option>passthru</option> のいずれかです。
595 <option>private</option> モードの場合、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。
596 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である <option>vepa</option> モードの場合、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。
dc421f3a
KY
597 すなわち、ブリッジが reflective relay として設定されているということです。
598 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。
599 ローカルのフレームはローカルには配送されません。
5a56eeb6 600 <option>bridge</option> モードの場合、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。
dc421f3a
KY
601 あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。
602 ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。
603 しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。
604 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。
5a56eeb6 605 <option>passthru</option> モードの場合、物理インターフェースで受け取った全てのフレームは macvlan インターフェースに転送されます。<option>passthru</option> モードの場合、ひとつの macvlan インターフェースだけが、ひとつの物理インターフェースに対して設定できます。
50a8555e 606 </para>
fb261f53 607
50a8555e 608 <para>
fb261f53 609 <!--
50a8555e 610 <option>phys:</option> an already existing interface
7fa3f2e9 611 specified by the <option>lxc.net.[i].link</option> is
50a8555e 612 assigned to the container.
fb261f53 613 -->
7fa3f2e9 614 <option>phys:</option> <option>lxc.net.[i].link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。
50a8555e
KY
615 </para>
616 </listitem>
617 </varlistentry>
fb261f53 618
50a8555e
KY
619 <varlistentry>
620 <term>
7fa3f2e9 621 <option>lxc.net.[i].flags</option>
50a8555e
KY
622 </term>
623 <listitem>
624 <para>
fb261f53 625 <!--
2513f519 626 Specify an action to do for the network.
fb261f53 627 -->
dc421f3a 628 ネットワークに対して行うアクションを指定します。
50a8555e 629 </para>
fb261f53 630
50a8555e 631 <para>
fb261f53
KY
632 <!--
633 <option>up:</option> activates the interface.
634 -->
dc421f3a 635 <option>up:</option> インターフェースを起動させます。
50a8555e
KY
636 </para>
637 </listitem>
638 </varlistentry>
fb261f53 639
50a8555e
KY
640 <varlistentry>
641 <term>
7fa3f2e9 642 <option>lxc.net.[i].link</option>
50a8555e
KY
643 </term>
644 <listitem>
645 <para>
fb261f53 646 <!--
2513f519 647 Specify the interface to be used for real network traffic.
fb261f53 648 -->
dc421f3a 649 実際のネットワークトラフィックに使うインターフェースを指定します。
50a8555e
KY
650 </para>
651 </listitem>
652 </varlistentry>
fb261f53 653
50a8555e
KY
654 <varlistentry>
655 <term>
7fa3f2e9 656 <option>lxc.net.[i].mtu</option>
50a8555e
KY
657 </term>
658 <listitem>
659 <para>
fb261f53 660 <!--
2513f519 661 Specify the maximum transfer unit for this interface.
fb261f53 662 -->
dc421f3a 663 インターフェースに対する MTU を指定します。
50a8555e
KY
664 </para>
665 </listitem>
666 </varlistentry>
fb261f53 667
50a8555e
KY
668 <varlistentry>
669 <term>
7fa3f2e9 670 <option>lxc.net.[i].name</option>
50a8555e
KY
671 </term>
672 <listitem>
673 <para>
fb261f53 674 <!--
2513f519
KY
675 The interface name is dynamically allocated, but if another name
676 is needed because the configuration files being used by the
677 container use a generic name, eg. eth0, this option will rename
678 the interface in the container.
fb261f53 679 -->
2513f519 680 インターフェース名は動的に割り当てられます。しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。
50a8555e
KY
681 </para>
682 </listitem>
683 </varlistentry>
fb261f53 684
50a8555e
KY
685 <varlistentry>
686 <term>
7fa3f2e9 687 <option>lxc.net.[i].hwaddr</option>
50a8555e
KY
688 </term>
689 <listitem>
690 <para>
fb261f53 691 <!--
2513f519
KY
692 The interface mac address is dynamically allocated by default to
693 the virtual interface, but in some cases, this is needed to
694 resolve a mac address conflict or to always have the same
695 link-local ipv6 address. Any "x" in address will be replaced by
696 random value, this allows setting hwaddr templates.
697 -->
698 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。アドレス中の "x" という文字は、ランダムな値に置き換えられます。これによりテンプレートに hwaddr を設定することが可能になります。
50a8555e
KY
699 </para>
700 </listitem>
701 </varlistentry>
fb261f53 702
50a8555e
KY
703 <varlistentry>
704 <term>
7fa3f2e9 705 <option>lxc.net.[i].ipv4</option>
50a8555e
KY
706 </term>
707 <listitem>
708 <para>
fb261f53 709 <!--
2513f519
KY
710 Specify the ipv4 address to assign to the virtualized interface.
711 Several lines specify several ipv4 addresses. The address is in
712 format x.y.z.t/m, eg. 192.168.1.123/24.
713 -->
714 仮想インターフェースに割り当てる ipv4 アドレスを指定します。複数行により複数の ipv4 アドレスを指定します。このアドレスは x.y.z.t/m というフォーマットで指定します。例) 192.168.1.123/24
50a8555e
KY
715 </para>
716 </listitem>
717 </varlistentry>
718
719 <varlistentry>
720 <term>
7fa3f2e9 721 <option>lxc.net.[i].ipv4.gateway</option>
50a8555e
KY
722 </term>
723 <listitem>
724 <para>
725 <!--
726 specify the ipv4 address to use as the gateway inside the
727 container. The address is in format x.y.z.t, eg. 192.168.1.123.
728
729 Can also have the special value <option>auto</option>,
730 which means to take the primary address from the bridge
731 interface (as specified by the
7fa3f2e9 732 <option>lxc.net.[i].link</option> option) and use that as
50a8555e
KY
733 the gateway. <option>auto</option> is only available when
734 using the <option>veth</option> and
735 <option>macvlan</option> network types.
fb261f53 736 -->
2513f519 737 コンテナでゲートウェイとして使う IPv4 アドレスを指定します。アドレスは x.y.z.t というフォーマットです。例) 192.168.1.123
7fa3f2e9 738 <option>auto</option> という特別な値を指定できます。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。
50a8555e
KY
739 </para>
740 </listitem>
741 </varlistentry>
fb261f53
KY
742
743
50a8555e
KY
744 <varlistentry>
745 <term>
7fa3f2e9 746 <option>lxc.net.[i].ipv6</option>
50a8555e
KY
747 </term>
748 <listitem>
749 <para>
fb261f53 750 <!--
2513f519
KY
751 Specify the ipv6 address to assign to the virtualized
752 interface. Several lines specify several ipv6 addresses. The
753 address is in format x::y/m, eg.
754 2003:db8:1:0:214:1234:fe0b:3596/64
fb261f53 755 -->
2513f519 756 仮想インターフェースに割り当てる ipv6 アドレスを指定します。複数行により複数の ipv6 アドレスを指定します。このアドレスは x::y/m というフォーマットで指定します。例) 2003:db8:1:0:214:1234:fe0b:3596/64
50a8555e
KY
757 </para>
758 </listitem>
759 </varlistentry>
fb261f53 760
50a8555e
KY
761 <varlistentry>
762 <term>
7fa3f2e9 763 <option>lxc.net.[i].ipv6.gateway</option>
50a8555e
KY
764 </term>
765 <listitem>
766 <para>
fb261f53 767 <!--
2513f519
KY
768 Specify the ipv6 address to use as the gateway inside the
769 container. The address is in format x::y, eg. 2003:db8:1:0::1
fb261f53 770
50a8555e
KY
771 Can also have the special value <option>auto</option>,
772 which means to take the primary address from the bridge
773 interface (as specified by the
7fa3f2e9 774 <option>lxc.net.[i].link</option> option) and use that as
50a8555e
KY
775 the gateway. <option>auto</option> is only available when
776 using the <option>veth</option> and
777 <option>macvlan</option> network types.
fb261f53 778 -->
2513f519 779 コンテナでゲートウェイとして使う IPv6 アドレスを指定します。アドレスは x::y というフォーマットです。例) 2003:db8:1:0::1
7fa3f2e9 780 <option>auto</option> という特別な値を記述する事も可能です。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。
50a8555e
KY
781 </para>
782 </listitem>
783 </varlistentry>
784
785 <varlistentry>
786 <term>
7fa3f2e9 787 <option>lxc.net.[i].script.up</option>
50a8555e
KY
788 </term>
789 <listitem>
790 <para>
791 <!--
792 add a configuration option to specify a script to be
793 executed after creating and configuring the network used
794 from the host side. The following arguments are passed
795 to the script: container name and config section name
796 (net) Additional arguments depend on the config section
797 employing a script hook; the following are used by the
798 network system: execution context (up), network type
799 (empty/veth/macvlan/phys), Depending on the network
800 type, other arguments may be passed:
801 veth/macvlan/phys. And finally (host-sided) device name.
fb261f53 802 -->
2513f519 803 ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。
50a8555e 804 その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)
dc421f3a 805 ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名
fb261f53 806 </para>
50a8555e 807 <para>
fb261f53 808 <!--
50a8555e
KY
809 Standard output from the script is logged at debug level.
810 Standard error is not logged, but can be captured by the
811 hook redirecting its standard error to standard output.
fb261f53 812 -->
2513f519 813 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
50a8555e
KY
814 </para>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry>
819 <term>
7fa3f2e9 820 <option>lxc.net.[i].script.down</option>
50a8555e
KY
821 </term>
822 <listitem>
823 <para>
824 <!--
825 add a configuration option to specify a script to be
826 executed before destroying the network used from the
827 host side. The following arguments are passed to the
828 script: container name and config section name (net)
829 Additional arguments depend on the config section
830 employing a script hook; the following are used by the
831 network system: execution context (down), network type
832 (empty/veth/macvlan/phys), Depending on the network
833 type, other arguments may be passed:
834 veth/macvlan/phys. And finally (host-sided) device name.
fb261f53 835 -->
2513f519
KY
836 ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。
837 その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)。
dc421f3a 838 ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys。そして最後に (ホスト側の) デバイス名が渡されます。
fb261f53 839 </para>
50a8555e 840 <para>
fb261f53 841 <!--
50a8555e
KY
842 Standard output from the script is logged at debug level.
843 Standard error is not logged, but can be captured by the
844 hook redirecting its standard error to standard output.
fb261f53 845 -->
2513f519 846 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
50a8555e
KY
847 </para>
848 </listitem>
849 </varlistentry>
fb261f53
KY
850 </variablelist>
851
852 </refsect2>
853
854 <refsect2>
855 <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title>
856 <para>
857 <!--
50a8555e
KY
858 For stricter isolation the container can have its own private
859 instance of the pseudo tty.
fb261f53 860 -->
dc421f3a 861 さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。
fb261f53
KY
862 </para>
863 <variablelist>
50a8555e
KY
864 <varlistentry>
865 <term>
866 <option>lxc.pts</option>
867 </term>
868 <listitem>
869 <para>
870 <!--
871 If set, the container will have a new pseudo tty
872 instance, making this private to it. The value specifies
fb261f53
KY
873 the maximum number of pseudo ttys allowed for a pts
874 instance (this limitation is not implemented yet).
875 -->
ec64264d 876 もし設定された場合、コンテナは新しい pseudo tty インスタンスを持ち、それを自身のプライベートとします。
dc421f3a 877 この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。
50a8555e
KY
878 </para>
879 </listitem>
880 </varlistentry>
fb261f53
KY
881 </variablelist>
882 </refsect2>
883
884 <refsect2>
885 <title><!-- Container system console -->コンテナのシステムコンソール</title>
886 <para>
887 <!--
50a8555e
KY
888 If the container is configured with a root filesystem and the
889 inittab file is setup to use the console, you may want to specify
890 where the output of this console goes.
fb261f53 891 -->
dc421f3a 892 コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。
fb261f53
KY
893 </para>
894 <variablelist>
50a8555e
KY
895 <varlistentry>
896 <term>
897 <option>lxc.console.logfile</option>
898 </term>
899 <listitem>
900 <para>
fb261f53 901 <!--
50a8555e
KY
902 Specify a path to a file where the console output will
903 be written.
48e60dfe
KY
904 -->
905 コンソール出力を書き込むファイルのパスを指定します。
50a8555e
KY
906 </para>
907 </listitem>
908 </varlistentry>
909 <varlistentry>
910 <term>
911 <option>lxc.console</option>
912 </term>
913 <listitem>
7a534f67 914 <para>
48e60dfe 915 <!--
7a534f67
KY
916 Specify a path to a device to which the console will be
917 attached. The keyword 'none' will simply disable the
918 console. Note, when specifying 'none' and creating a device node
919 for the console in the container at /dev/console or bind-mounting
920 the hosts's /dev/console into the container at /dev/console the
921 container will have direct access to the hosts's /dev/console.
922 This is dangerous when the container has write access to the
923 device and should thus be used with caution.
924 -->
48e60dfe 925 コンソールを割り当てるデバイスのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。
7a534f67
KY
926 'none' を指定し、コンテナ内のコンソールに対するデバイスノードを /dev/console に作成するか、もしくはホストの /dev/console をコンテナ内の /dev/console に bind mount する場合、そのコンテナはホストの /dev/console へ直接アクセスを行うことに注意が必要です。
927 そのコンテナがデバイスへの書き込み権を持っている場合は危険ですので、注意してこの指定を使用する必要があります。
928 </para>
50a8555e
KY
929 </listitem>
930 </varlistentry>
fb261f53
KY
931 </variablelist>
932 </refsect2>
933
934 <refsect2>
935 <title><!-- Console through the ttys -->tty を通したコンソール</title>
936 <para>
937 <!--
50a8555e
KY
938 This option is useful if the container is configured with a root
939 filesystem and the inittab file is setup to launch a getty on the
940 ttys. The option specifies the number of ttys to be available for
941 the container. The number of gettys in the inittab file of the
942 container should not be greater than the number of ttys specified
943 in this option, otherwise the excess getty sessions will die and
944 respawn indefinitely giving annoying messages on the console or in
945 <filename>/var/log/messages</filename>.
fb261f53 946 -->
dc421f3a
KY
947 このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。
948 このオプションはコンテナで利用できる tty の数を指定します。
949 inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。
950 さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。
fb261f53
KY
951 </para>
952 <variablelist>
50a8555e
KY
953 <varlistentry>
954 <term>
955 <option>lxc.tty</option>
956 </term>
957 <listitem>
958 <para>
fb261f53 959 <!--
50a8555e
KY
960 Specify the number of tty to make available to the
961 container.
fb261f53 962 -->
dc421f3a 963 コンテナに作成出来る tty の数を指定します。
50a8555e
KY
964 </para>
965 </listitem>
966 </varlistentry>
fb261f53
KY
967 </variablelist>
968 </refsect2>
969
970 <refsect2>
971 <title><!-- Console devices location -->コンソールデバイスの位置</title>
972 <para>
973 <!--
974 LXC consoles are provided through Unix98 PTYs created on the
50a8555e
KY
975 host and bind-mounted over the expected devices in the container.
976 By default, they are bind-mounted over <filename>/dev/console</filename>
977 and <filename>/dev/ttyN</filename>. This can prevent package upgrades
978 in the guest. Therefore you can specify a directory location (under
979 <filename>/dev</filename> under which LXC will create the files and
980 bind-mount over them. These will then be symbolically linked to
981 <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>.
982 A package upgrade can then succeed as it is able to remove and replace
983 the symbolic links.
fb261f53 984 -->
dc421f3a
KY
985 LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。
986 デフォルトでは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> に bind マウントされます。
987 これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。
988 なので <filename>/dev</filename> 以下のディレクトリを指定することができます。
989 LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。
990 そして、これらの (作成された) ファイルは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> にシンボリックリンクされます。
991 シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。
fb261f53
KY
992 </para>
993 <variablelist>
50a8555e
KY
994 <varlistentry>
995 <term>
996 <option>lxc.devttydir</option>
997 </term>
998 <listitem>
7a534f67 999 <para>
fb261f53 1000 <!--
7a534f67
KY
1001 Specify a directory under <filename>/dev</filename>
1002 under which to create the container console devices. Note that LXC
1003 will move any bind-mounts or device nodes for /dev/console into
1004 this directory.
1005 -->
dc421f3a 1006 コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。
7a534f67
KY
1007 LXC は /dev/console に対する bind mount や /dev/console デバイスノードをこのディレクトリ以下に移動することに注意が必要です。
1008 </para>
50a8555e
KY
1009 </listitem>
1010 </varlistentry>
fb261f53
KY
1011 </variablelist>
1012 </refsect2>
1013
1014 <refsect2>
1015 <title><!-- /dev directory -->/dev ディレクトリ</title>
1016 <para>
1017 <!--
50a8555e
KY
1018 By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr)
1019 in the container's <filename>/dev</filename> directory but does not
1020 automatically create device node entries. This allows the container's
1021 <filename>/dev</filename> to be set up as needed in the container
1022 rootfs. If lxc.autodev is set to 1, then after mounting the container's
1023 rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename>
1024 (limited to 500k) and fill in a minimal set of initial devices.
fb261f53
KY
1025 This is generally required when starting a container containing
1026 a "systemd" based "init" but may be optional at other times. Additional
1027 devices in the containers /dev directory may be created through the
1028 use of the <option>lxc.hook.autodev</option> hook.
1029 -->
dc421f3a
KY
1030 デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。
1031 これは、コンテナの rootfs で必要な設定を行えるようにするものです。
c35d2909 1032 lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (500k 制限の)。
dc421f3a
KY
1033 そして初期デバイスの最小限のセットを作成します。
1034 これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。
1035 コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。
fb261f53
KY
1036 </para>
1037 <variablelist>
50a8555e
KY
1038 <varlistentry>
1039 <term>
1040 <option>lxc.autodev</option>
1041 </term>
1042 <listitem>
1043 <para>
fb261f53 1044 <!--
a9516fe5
KY
1045 Set this to 0 to stop LXC from mounting and populating a minimal
1046 <filename>/dev</filename> when starting the container.
fb261f53 1047 -->
a9516fe5 1048 コンテナの起動時に LXC が /dev をマウントして最小限の /dev を作成するのを止めるには、この値を 0 に設定してください。
50a8555e
KY
1049 </para>
1050 </listitem>
1051 </varlistentry>
fb261f53
KY
1052 </variablelist>
1053 </refsect2>
1054
1055 <refsect2>
1056 <title><!-- Enable kmsg symlink -->kmsg のシンボリックリンクの有効化</title>
1057 <para>
1058 <!--
a9516fe5
KY
1059 Enable creating /dev/kmsg as symlink to /dev/console. This defaults to 0.
1060 -->
1061 /dev/console へのシンボリックリンクとして /dev/kmsg を作成することを有効にします。デフォルトは 0 です。
fb261f53
KY
1062 </para>
1063 <variablelist>
1064 <varlistentry>
1065 <term>
1066 <option>lxc.kmsg</option>
1067 </term>
1068 <listitem>
1069 <para>
1070 <!--
a9516fe5 1071 Set this to 1 to enable /dev/kmsg symlinking.
fb261f53 1072 -->
a9516fe5 1073 /dev/kmsg へのシンボリックリンクを有効にするには 1 を設定してください。
fb261f53
KY
1074 </para>
1075 </listitem>
1076 </varlistentry>
1077 </variablelist>
1078 </refsect2>
1079
1080 <refsect2>
1081 <title><!-- Mount points -->マウントポイント</title>
1082 <para>
1083 <!--
50a8555e
KY
1084 The mount points section specifies the different places to be
1085 mounted. These mount points will be private to the container
1086 and won't be visible by the processes running outside of the
1087 container. This is useful to mount /etc, /var or /home for
1088 examples.
fb261f53 1089 -->
dc421f3a
KY
1090 マウントポイントセクションは、マウントするための区別された場所を指定します。
1091 これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。
1092 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。
fb261f53 1093 </para>
2c79e91b 1094 <para>
50a8555e
KY
1095 <!--
1096 NOTE - LXC will generally ensure that mount targets and relative
1097 bind-mount sources are properly confined under the container
1098 root, to avoid attacks involving over-mounting host directories
1099 and files. (Symbolic links in absolute mount sources are ignored)
1100 However, if the container configuration first mounts a directory which
1101 is under the control of the container user, such as /home/joe, into
2c79e91b
KY
1102 the container at some <filename>path</filename>, and then mounts
1103 under <filename>path</filename>, then a TOCTTOU attack would be
1104 possible where the container user modifies a symbolic link under
1105 his home directory at just the right time.
50a8555e
KY
1106 -->
1107 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。
1108 これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。)
1109 しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。
2c79e91b 1110 </para>
fb261f53 1111 <variablelist>
50a8555e
KY
1112 <varlistentry>
1113 <term>
1114 <option>lxc.mount</option>
1115 </term>
1116 <listitem>
1117 <para>
1118 <!--
1119 specify a file location in
1120 the <filename>fstab</filename> format, containing the
1121 mount information. The mount target location can and in
1122 most cases should be a relative path, which will become
1123 relative to the mounted container root. For instance,
e053b31e
KY
1124 -->
1125 マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。
1126 マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。
50a8555e 1127 </para>
2513f519
KY
1128 <programlisting>
1129 proc proc proc nodev,noexec,nosuid 0 0
1130 </programlisting>
50a8555e 1131 <para>
e053b31e 1132 <!--
50a8555e
KY
1133 Will mount a proc filesystem under the container's /proc,
1134 regardless of where the root filesystem comes from. This
1135 is resilient to block device backed filesystems as well as
1136 container cloning.
e053b31e 1137 -->
2513f519 1138 この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。
50a8555e
KY
1139 </para>
1140 <para>
e053b31e 1141 <!--
50a8555e
KY
1142 Note that when mounting a filesystem from an
1143 image file or block device the third field (fs_vfstype)
1144 cannot be auto as with
fb261f53 1145 <citerefentry>
50a8555e 1146 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1147 <manvolnum>8</manvolnum>
1148 </citerefentry>
1149 but must be explicitly specified.
1150 -->
dc421f3a 1151 ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は
fb261f53 1152 <citerefentry>
50a8555e 1153 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1154 <manvolnum>8</manvolnum>
1155 </citerefentry>
dc421f3a 1156 のように auto を指定することはできず、明確に指定しなければいけません。
50a8555e
KY
1157 </para>
1158 </listitem>
1159 </varlistentry>
fb261f53 1160
50a8555e
KY
1161 <varlistentry>
1162 <term>
1163 <option>lxc.mount.entry</option>
1164 </term>
1165 <listitem>
1166 <para>
fb261f53 1167 <!--
50a8555e
KY
1168 specify a mount point corresponding to a line in the
1169 fstab format.
fb261f53 1170 -->
dc421f3a 1171 fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。
b332333b
KY
1172
1173 <!--
1174 Moreover lxc add two options to mount.
1175 <option>optional</option> don't fail if mount does not work.
1176 <option>create=dir</option> or <option>create=file</option>
1177 to create dir (or file) when the point will be mounted.
1178 -->
1179 fstab フォーマットに加えて、LXC ではマウントに対して独自の 2 つのオプションが使えます。
1180 <option>optional</option> は、マウントが失敗しても失敗を返さずに無視します。
1181 <option>create=dir</option> と <option>create=file</option> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。
50a8555e
KY
1182 </para>
1183 </listitem>
1184 </varlistentry>
fb261f53 1185
50a8555e
KY
1186 <varlistentry>
1187 <term>
1188 <option>lxc.mount.auto</option>
1189 </term>
1190 <listitem>
1191 <para>
fb261f53 1192 <!--
50a8555e
KY
1193 specify which standard kernel file systems should be
1194 automatically mounted. This may dramatically simplify
1195 the configuration. The file systems are:
fb261f53 1196 -->
dc421f3a
KY
1197 標準のカーネルファイルシステムで自動的にマウントするものを指定します。
1198 これは劇的に設定を容易にする可能性があります。
50a8555e
KY
1199 </para>
1200 <itemizedlist>
1201 <listitem>
fb261f53 1202 <!--
50a8555e
KY
1203 <para>
1204 <option>proc:mixed</option> (or <option>proc</option>):
1205 mount <filename>/proc</filename> as read-write, but
1206 remount <filename>/proc/sys</filename> and
1207 <filename>/proc/sysrq-trigger</filename> read-only
1208 for security / container isolation purposes.
1209 </para>
fb261f53
KY
1210 -->
1211 <para>
1212 <option>proc:mixed</option> (or <option>proc</option>):
dc421f3a
KY
1213 <filename>/proc</filename> を読み書き可能でマウントします。
1214 ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。
fb261f53 1215 </para>
50a8555e
KY
1216 </listitem>
1217 <listitem>
fb261f53 1218 <!--
50a8555e
KY
1219 <para>
1220 <option>proc:rw</option>: mount
1221 <filename>/proc</filename> as read-write
1222 </para>
fb261f53
KY
1223 -->
1224 <para>
50a8555e 1225 <option>proc:rw</option>:
dc421f3a 1226 <filename>/proc</filename> を読み書き可能でマウントします。
fb261f53 1227 </para>
50a8555e
KY
1228 </listitem>
1229 <listitem>
1230 <!--
dd93ef87
KY
1231 <para>
1232 <option>sys:mixed</option> (or <option>sys</option>):
1233 mount <filename>/sys</filename> as read-only but with
1234 /sys/devices/virtual/net writable.
1235 </para>
50a8555e
KY
1236 -->
1237 <para>
1238 <option>sys:mixed</option> (or <option>sys</option>):
1239 /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。
1240 </para>
dd93ef87 1241 </listitem>
50a8555e 1242 <listitem>
fb261f53 1243 <!--
50a8555e
KY
1244 <para>
1245 <option>sys:ro</option>
1246 mount <filename>/sys</filename> as read-only
1247 for security / container isolation purposes.
1248 </para>
fb261f53
KY
1249 -->
1250 <para>
dd93ef87 1251 <option>sys:ro</option>:
dc421f3a 1252 <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。
fb261f53 1253 </para>
50a8555e
KY
1254 </listitem>
1255 <listitem>
fb261f53 1256 <!--
50a8555e
KY
1257 <para>
1258 <option>sys:rw</option>: mount
1259 <filename>/sys</filename> as read-write
1260 </para>
fb261f53
KY
1261 -->
1262 <para>
50a8555e 1263 <option>sys:rw</option>:
dc421f3a 1264 <filename>/sys</filename> を読み書き可能でマウントします。
fb261f53 1265 </para>
50a8555e
KY
1266 </listitem>
1267 <listitem>
fb261f53 1268 <!--
50a8555e
KY
1269 <para>
1270 <option>cgroup:mixed</option>:
1271 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1272 create directories for all hierarchies to which
1273 the container is added, create subdirectories
1274 there with the name of the cgroup, and bind-mount
1275 the container's own cgroup into that directory.
1276 The container will be able to write to its own
1277 cgroup directory, but not the parents, since they
1278 will be remounted read-only
1279 </para>
fb261f53
KY
1280 -->
1281 <para>
50a8555e 1282 <option>cgroup:mixed</option>:
dc421f3a
KY
1283 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。
1284 コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。
fb261f53 1285 </para>
50a8555e
KY
1286 </listitem>
1287 <listitem>
fb261f53 1288 <!--
50a8555e
KY
1289 <para>
1290 <option>cgroup:ro</option>: similar to
1291 <option>cgroup:mixed</option>, but everything will
1292 be mounted read-only.
1293 </para>
fb261f53
KY
1294 -->
1295 <para>
50a8555e 1296 <option>cgroup:ro</option>:
dc421f3a 1297 <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1298 </para>
50a8555e
KY
1299 </listitem>
1300 <listitem>
fb261f53 1301 <!--
50a8555e
KY
1302 <para>
1303 <option>cgroup:rw</option>: similar to
1304 <option>cgroup:mixed</option>, but everything will
1305 be mounted read-write. Note that the paths leading
1306 up to the container's own cgroup will be writable,
1307 but will not be a cgroup filesystem but just part
1308 of the tmpfs of <filename>/sys/fs/cgroup</filename>
1309 </para>
fb261f53
KY
1310 -->
1311 <para>
50a8555e 1312 <option>cgroup:rw</option>:
dc421f3a
KY
1313 <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。
1314 コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、
1315 <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。
fb261f53 1316 </para>
50a8555e
KY
1317 </listitem>
1318 <listitem>
1319 <para>
aafea1f7 1320 <!--
50a8555e
KY
1321 <option>cgroup</option> (without specifier):
1322 defaults to <option>cgroup:rw</option> if the
1323 container retains the CAP_SYS_ADMIN capability,
1324 <option>cgroup:mixed</option> otherwise.
aafea1f7 1325 -->
50a8555e 1326 <option>cgroup</option> (マウントオプションなしの場合):
aafea1f7 1327 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。
50a8555e
KY
1328 </para>
1329 </listitem>
1330 <listitem>
fb261f53 1331 <!--
50a8555e
KY
1332 <para>
1333 <option>cgroup-full:mixed</option>:
1334 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1335 create directories for all hierarchies to which
1336 the container is added, bind-mount the hierarchies
1337 from the host to the container and make everything
1338 read-only except the container's own cgroup. Note
1339 that compared to <option>cgroup</option>, where
1340 all paths leading up to the container's own cgroup
1341 are just simple directories in the underlying
1342 tmpfs, here
1343 <filename>/sys/fs/cgroup/$hierarchy</filename>
1344 will contain the host's full cgroup hierarchy,
1345 albeit read-only outside the container's own cgroup.
1346 This may leak quite a bit of information into the
1347 container.
1348 </para>
fb261f53
KY
1349 -->
1350 <para>
50a8555e 1351 <option>cgroup-full:mixed</option>:
dc421f3a
KY
1352 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。
1353 <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。
1354 これにより、コンテナにはかなりの情報が漏洩します。
fb261f53 1355 </para>
50a8555e
KY
1356 </listitem>
1357 <listitem>
fb261f53 1358 <!--
50a8555e
KY
1359 <para>
1360 <option>cgroup-full:ro</option>: similar to
1361 <option>cgroup-full:mixed</option>, but everything
1362 will be mounted read-only.
1363 </para>
fb261f53
KY
1364 -->
1365 <para>
50a8555e 1366 <option>cgroup-full:ro</option>:
dc421f3a 1367 <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1368 </para>
50a8555e
KY
1369 </listitem>
1370 <listitem>
fb261f53 1371 <!--
50a8555e
KY
1372 <para>
1373 <option>cgroup-full:rw</option>: similar to
1374 <option>cgroup-full:mixed</option>, but everything
1375 will be mounted read-write. Note that in this case,
1376 the container may escape its own cgroup. (Note also
1377 that if the container has CAP_SYS_ADMIN support
1378 and can mount the cgroup filesystem itself, it may
1379 do so anyway.)
1380 </para>
fb261f53
KY
1381 -->
1382 <para>
50a8555e
KY
1383 <option>cgroup-full:rw</option>:
1384 <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。
dc421f3a 1385 この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。
fb261f53 1386 </para>
50a8555e
KY
1387 </listitem>
1388 <listitem>
1389 <para>
aafea1f7 1390 <!--
50a8555e
KY
1391 <option>cgroup-full</option> (without specifier):
1392 defaults to <option>cgroup-full:rw</option> if the
1393 container retains the CAP_SYS_ADMIN capability,
1394 <option>cgroup-full:mixed</option> otherwise.
aafea1f7 1395 -->
50a8555e 1396 <option>cgroup-full</option> (マウントオプションなしの場合):
aafea1f7 1397 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。
50a8555e
KY
1398 </para>
1399 </listitem>
1400 </itemizedlist>
1401 <para>
1402 <!--
1403 If cgroup namespaces are enabled, then any <option>cgroup</option>
1404 auto-mounting request will be ignored, since the container can
1405 mount the filesystems itself, and automounting can confuse the
1406 container init.
1407 -->
1408 cgroup 名前空間が有効の場合、<option>cgroup</option> の自動マウントの指定はどれも無視されます。これは、コンテナが自身でファイルシステムをマウントするため、自動マウントがコンテナの init を混乱させる可能性があるためです。
1409 </para>
1410 <para>
1411 <!--
1412 Note that if automatic mounting of the cgroup filesystem
1413 is enabled, the tmpfs under
1414 <filename>/sys/fs/cgroup</filename> will always be
1415 mounted read-write (but for the <option>:mixed</option>
1416 and <option>:ro</option> cases, the individual
1417 hierarchies,
1418 <filename>/sys/fs/cgroup/$hierarchy</filename>, will be
1419 read-only). This is in order to work around a quirk in
1420 Ubuntu's
1421 <citerefentry>
1422 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1423 <manvolnum>8</manvolnum>
1424 </citerefentry>
50a8555e
KY
1425 command that will cause containers to wait for user
1426 input at boot if
1427 <filename>/sys/fs/cgroup</filename> is mounted read-only
1428 and the container can't remount it read-write due to a
1429 lack of CAP_SYS_ADMIN.
cf5f3128
KY
1430 -->
1431 cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の
1432 <citerefentry>
50a8555e 1433 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1434 <manvolnum>8</manvolnum>
1435 </citerefentry>
1436 コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。
50a8555e
KY
1437 </para>
1438 <para>
fb261f53 1439 <!--
50a8555e 1440 Examples:
fb261f53
KY
1441 -->
1442 例:
50a8555e
KY
1443 </para>
1444 <programlisting>
1445 lxc.mount.auto = proc sys cgroup
1446 lxc.mount.auto = proc:rw sys:rw cgroup-full:rw
1447 </programlisting>
1448 </listitem>
1449 </varlistentry>
fb261f53
KY
1450
1451 </variablelist>
1452 </refsect2>
1453
1454 <refsect2>
1455 <title><!-- Root file system -->ルートファイルシステム</title>
1456 <para>
1457 <!--
50a8555e
KY
1458 The root file system of the container can be different than that
1459 of the host system.
fb261f53 1460 -->
dc421f3a 1461 コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。
fb261f53
KY
1462 </para>
1463 <variablelist>
50a8555e
KY
1464 <varlistentry>
1465 <term>
1466 <option>lxc.rootfs</option>
1467 </term>
1468 <listitem>
1469 <para>
1470 <!--
1471 specify the root file system for the container. It can
1472 be an image file, a directory or a block device. If not
1473 specified, the container shares its root file system
1474 with the host.
fb261f53 1475 -->
8b3374e5 1476 コンテナのルートファイルシステムを指定します。
dc421f3a
KY
1477 この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。
1478 もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。
50a8555e
KY
1479 </para>
1480 <para>
a4dbc45f
KY
1481 <!--
1482 For directory or simple block-device backed containers,
1483 a pathname can be used. If the rootfs is backed by a nbd
1484 device, then <filename>nbd:file:1</filename> specifies that
1485 <filename>file</filename> should be attached to a nbd device,
1486 and partition 1 should be mounted as the rootfs.
1487 <filename>nbd:file</filename> specifies that the nbd device
1488 itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
1489 specifies that the rootfs should be an overlay with <filename>/upper</filename>
1490 being mounted read-write over a read-only mount of <filename>/lower</filename>.
1491 <filename>aufs:/lower:/upper</filename> does the same using aufs in place
ddf81220
KY
1492 of overlayfs. For both <filename>overlayfs</filename> and
1493 <filename>aufs</filename> multiple <filename>/lower</filename>
1494 directories can be specified. <filename>loop:/file</filename> tells lxc to attach
a4dbc45f
KY
1495 <filename>/file</filename> to a loop device and mount the loop device.
1496 -->
1497 ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。
1498 もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。
1499 <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。
1500 <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。
ddf81220 1501 <filename>aufs:/lower:/upper</filename> は overlayfs で指定している部分を aufs と指定すれば同じことになります。<filename>overlayfs</filename> と <filename>aufs</filename> は両方とも、複数の <filename>/lower</filename> ディレクトリを指定できます。
a4dbc45f 1502 <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。
50a8555e
KY
1503 </para>
1504 </listitem>
1505 </varlistentry>
1506
1507 <varlistentry>
1508 <term>
1509 <option>lxc.rootfs.mount</option>
1510 </term>
1511 <listitem>
1512 <para>
1513 <!--
1514 where to recursively bind <option>lxc.rootfs</option>
1515 before pivoting. This is to ensure success of the
1516 <citerefentry>
1517 <refentrytitle><command>pivot_root</command></refentrytitle>
1518 <manvolnum>8</manvolnum>
1519 </citerefentry>
1520 syscall. Any directory suffices, the default should
1521 generally work.
fb261f53 1522 -->
dc421f3a 1523 root ファイルシステムの変更の前に、<option>lxc.rootfs</option> を再帰的にどこにバインドするのかを指定します。これは
50a8555e
KY
1524 <citerefentry>
1525 <refentrytitle><command>pivot_root</command></refentrytitle>
1526 <manvolnum>8</manvolnum>
1527 </citerefentry>
dc421f3a
KY
1528 システムコールが確実に成功する事を保証します。
1529 どんなディレクトリでも良く、デフォルトでも通常は動くはずです。
50a8555e
KY
1530 </para>
1531 </listitem>
1532 </varlistentry>
fb261f53 1533
50a8555e
KY
1534 <varlistentry>
1535 <term>
1536 <option>lxc.rootfs.options</option>
1537 </term>
1538 <listitem>
1539 <para>
b4c66de1 1540 <!--
50a8555e 1541 extra mount options to use when mounting the rootfs.
b4c66de1 1542 -->
dc421f3a 1543 rootfs をマウントするときに追加したいマウントオプション。
50a8555e
KY
1544 </para>
1545 </listitem>
1546 </varlistentry>
b4c66de1 1547
fb261f53
KY
1548 </variablelist>
1549 </refsect2>
1550
1551 <refsect2>
1552 <title>Control group</title>
1553 <para>
1554 <!--
50a8555e
KY
1555 The control group section contains the configuration for the
1556 different subsystem. <command>lxc</command> does not check the
1557 correctness of the subsystem name. This has the disadvantage
1558 of not detecting configuration errors until the container is
1559 started, but has the advantage of permitting any future
1560 subsystem.
fb261f53 1561 -->
dc421f3a
KY
1562 CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。
1563 <command>lxc</command> は、このサブシステム名の正しさはチェックしません。
1564 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。
fb261f53
KY
1565 </para>
1566 <variablelist>
50a8555e
KY
1567 <varlistentry>
1568 <term>
1569 <option>lxc.cgroup.[subsystem name]</option>
1570 </term>
1571 <listitem>
1572 <para>
1573 <!--
1574 specify the control group value to be set. The
1575 subsystem name is the literal name of the control group
1576 subsystem. The permitted names and the syntax of their
1577 values is not dictated by LXC, instead it depends on the
1578 features of the Linux kernel running at the time the
1579 container is started,
1580 eg. <option>lxc.cgroup.cpuset.cpus</option>
fb261f53 1581 -->
dc421f3a
KY
1582 設定する control group の値を指定します。
1583 サブシステム名は、control group のそのままの名前です。
1584 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
fb261f53 1585 例えば <option>lxc.cgroup.cpuset.cpus</option>
50a8555e
KY
1586 </para>
1587 </listitem>
1588 </varlistentry>
fb261f53
KY
1589 </variablelist>
1590 </refsect2>
1591
1592 <refsect2>
1593 <title><!-- Capabilities -->ケーパビリティ</title>
1594 <para>
1595 <!--
50a8555e
KY
1596 The capabilities can be dropped in the container if this one
1597 is run as root.
fb261f53 1598 -->
dc421f3a 1599 コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。
fb261f53
KY
1600 </para>
1601 <variablelist>
50a8555e
KY
1602 <varlistentry>
1603 <term>
1604 <option>lxc.cap.drop</option>
1605 </term>
1606 <listitem>
1607 <para>
1608 <!--
1609 Specify the capability to be dropped in the container. A
1610 single line defining several capabilities with a space
1611 separation is allowed. The format is the lower case of
1612 the capability definition without the "CAP_" prefix,
1613 eg. CAP_SYS_MODULE should be specified as
1614 sys_module. See
1615 <citerefentry>
1616 <refentrytitle><command>capabilities</command></refentrytitle>
1617 <manvolnum>7</manvolnum>
1618 </citerefentry>,
9c3f2966
KY
1619 If used with no value, lxc will clear any drop capabilities
1620 specified up to this point.
fb261f53 1621 -->
dc421f3a
KY
1622 コンテナ内で削除するケーパビリティ (capability) を指定します。
1623 一行でスペース区切りで複数のケーパビリティを指定することも可能です。
1624 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。
1625 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。
1626 詳しくは以下を参照してください。
50a8555e
KY
1627 <citerefentry>
1628 <refentrytitle><command>capabilities</command></refentrytitle>
1629 <manvolnum>7</manvolnum>
1630 </citerefentry>
1631 この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。
1632 </para>
1633 </listitem>
1634 </varlistentry>
1635 <varlistentry>
1636 <term>
1637 <option>lxc.cap.keep</option>
1638 </term>
1639 <listitem>
1640 <para>
1641 <!--
1642 Specify the capability to be kept in the container. All other
1643 capabilities will be dropped. When a special value of "none" is
1644 encountered, lxc will clear any keep capabilities specified up
1645 to this point. A value of "none" alone can be used to drop all
1646 capabilities.
fb261f53 1647 -->
f36062dc
KY
1648 コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。
1649 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。
50a8555e
KY
1650 </para>
1651 </listitem>
1652 </varlistentry>
fb261f53
KY
1653 </variablelist>
1654 </refsect2>
1655
e7267b53
KY
1656 <refsect2>
1657 <title>リソース制限 <!-- Resource limits --></title>
1658 <para>
50a8555e 1659 <!--
e7267b53
KY
1660 The soft and hard resource limits for the container can be changed.
1661 Unprivileged containers can only lower them. Resources which are not
1662 explicitly specified will be inherited.
50a8555e
KY
1663 -->
1664 コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。
e7267b53
KY
1665 </para>
1666 <variablelist>
1667 <varlistentry>
1668 <term>
240d4b74 1669 <option>lxc.prlimit.[limit name]</option>
e7267b53
KY
1670 </term>
1671 <listitem>
1672 <para>
1673 <!--
1674 Specify the resource limit to be set. A limit is specified as two
1675 colon separated values which are either numeric or the word
1676 'unlimited'. A single value can be used as a shortcut to set both
1677 soft and hard limit to the same value. The permitted names the
1678 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
1679 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
1680 <citerefentry>
1681 <refentrytitle><command>setrlimit</command></refentrytitle>
1682 <manvolnum>2</manvolnum>
1683 </citerefentry>.
1684 If used with no value, lxc will clear the resource limit
1685 specified up to this point. A resource with no explicitly
1686 configured limitation will be inherited from the process starting
1687 up the container.
1688 -->
1689 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは
1690 <citerefentry>
1691 <refentrytitle><command>setrlimit</command></refentrytitle>
1692 <manvolnum>2</manvolnum>
1693 </citerefentry> を参照してください。
1694 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。
1695 </para>
1696 </listitem>
1697 </varlistentry>
1698 </variablelist>
1699 </refsect2>
1700
fb261f53
KY
1701 <refsect2>
1702 <title><!-- Apparmor profile -->Apparmor プロファイル</title>
1703 <para>
1704 <!--
50a8555e
KY
1705 If lxc was compiled and installed with apparmor support, and the host
1706 system has apparmor enabled, then the apparmor profile under which the
1707 container should be run can be specified in the container
9d101b3d 1708 configuration. The default is <command>lxc-container-default-cgns</command>
50a8555e
KY
1709 if the host kernel is cgroup namespace aware, or
1710 <command>lxc-container-default</command> othewise.
fb261f53 1711 -->
dc421f3a 1712 lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。
cd548c9d 1713 デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。
fb261f53
KY
1714 </para>
1715 <variablelist>
50a8555e
KY
1716 <varlistentry>
1717 <term>
1718 <option>lxc.aa_profile</option>
1719 </term>
1720 <listitem>
1721 <para>
fb261f53 1722 <!--
50a8555e
KY
1723 Specify the apparmor profile under which the container should
1724 be run. To specify that the container should be unconfined,
1725 use
fb261f53 1726 -->
dc421f3a
KY
1727 コンテナが従うべき apparmor プロファイルを指定します。
1728 コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。
50a8555e
KY
1729 </para>
1730 <programlisting>lxc.aa_profile = unconfined</programlisting>
9d101b3d 1731 <para>
50a8555e 1732 <!--
9d101b3d 1733 If the apparmor profile should remain unchanged (i.e. if you
50a8555e
KY
1734 are nesting containers and are already confined), then use
1735 -->
1736 もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。
9d101b3d
KY
1737 </para>
1738 <programlisting>lxc.aa_profile = unchanged</programlisting>
50a8555e
KY
1739 </listitem>
1740 </varlistentry>
1741 <varlistentry>
1742 <term>
1743 <option>lxc.aa_allow_incomplete</option>
1744 </term>
1745 <listitem>
1746 <para>
1747 <!--
1748 Apparmor profiles are pathname based. Therefore many file
1749 restrictions require mount restrictions to be effective against
1750 a determined attacker. However, these mount restrictions are not
1751 yet implemented in the upstream kernel. Without the mount
1752 restrictions, the apparmor profiles still protect against accidental
1753 damager.
edf3a692
KY
1754 -->
1755 apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。
1756 しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。
50a8555e
KY
1757 </para>
1758 <para>
edf3a692 1759 <!--
50a8555e
KY
1760 If this flag is 0 (default), then the container will not be
1761 started if the kernel lacks the apparmor mount features, so that a
1762 regression after a kernel upgrade will be detected. To start the
1763 container under partial apparmor protection, set this flag to 1.
edf3a692
KY
1764 -->
1765 このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。
1766 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。
50a8555e
KY
1767 </para>
1768 </listitem>
1769 </varlistentry>
fb261f53
KY
1770 </variablelist>
1771 </refsect2>
1772
1773 <refsect2>
1774 <title><!-- SELinux context -->SELinux コンテキスト</title>
1775 <para>
1776 <!--
50a8555e
KY
1777 If lxc was compiled and installed with SELinux support, and the host
1778 system has SELinux enabled, then the SELinux context under which the
1779 container should be run can be specified in the container
1780 configuration. The default is <command>unconfined_t</command>,
1781 which means that lxc will not attempt to change contexts.
1782 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
1783 information.
fb261f53 1784 -->
dc421f3a
KY
1785 lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。
1786 デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。
03c315af 1787 ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。
fb261f53
KY
1788 </para>
1789 <variablelist>
50a8555e
KY
1790 <varlistentry>
1791 <term>
1792 <option>lxc.se_context</option>
1793 </term>
1794 <listitem>
1795 <para>
fb261f53 1796 <!--
50a8555e
KY
1797 Specify the SELinux context under which the container should
1798 be run or <command>unconfined_t</command>. For example
fb261f53 1799 -->
dc421f3a 1800 コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。
50a8555e
KY
1801 </para>
1802 <programlisting>lxc.se_context = system_u:system_r:lxc_t:s0:c22</programlisting>
1803 </listitem>
1804 </varlistentry>
fb261f53
KY
1805 </variablelist>
1806 </refsect2>
1807
1808 <refsect2>
1809 <title><!-- Seccomp configuration -->Seccomp の設定</title>
1810 <para>
1811 <!--
1812 A container can be started with a reduced set of available
50a8555e
KY
1813 system calls by loading a seccomp profile at startup. The
1814 seccomp configuration file must begin with a version number
1815 on the first line, a policy type on the second line, followed
1816 by the configuration.
fb261f53 1817 -->
dc421f3a
KY
1818 コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。
1819 seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。
fb261f53 1820 </para>
4473e38b
KY
1821 <para>
1822 <!--
1823 Versions 1 and 2 are currently supported. In version 1, the
50a8555e
KY
1824 policy is a simple whitelist. The second line therefore must
1825 read "whitelist", with the rest of the file containing one (numeric)
1826 sycall number per line. Each syscall number is whitelisted,
1827 while every unlisted number is blacklisted for use in the container
4473e38b 1828 -->
dc421f3a
KY
1829 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。
1830 そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。
4473e38b
KY
1831 </para>
1832
1833 <para>
1834 <!--
1835 In version 2, the policy may be blacklist or whitelist,
1836 supports per-rule and per-policy default actions, and supports
1837 per-architecture system call resolution from textual names.
1838 -->
dc421f3a 1839 バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。
4473e38b
KY
1840 </para>
1841 <para>
1842 <!--
1843 An example blacklist policy, in which all system calls are
1844 allowed except for mknod, which will simply do nothing and
1845 return 0 (success), looks like:
1846 -->
dc421f3a 1847 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。
4473e38b 1848 </para>
2513f519
KY
1849
1850 <programlisting>
1851 2
1852 blacklist
1853 mknod errno 0
1854 </programlisting>
1855
fb261f53 1856 <variablelist>
50a8555e
KY
1857 <varlistentry>
1858 <term>
1859 <option>lxc.seccomp</option>
1860 </term>
1861 <listitem>
1862 <para>
fb261f53 1863 <!--
50a8555e
KY
1864 Specify a file containing the seccomp configuration to
1865 load before the container starts.
fb261f53 1866 -->
dc421f3a 1867 コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。
50a8555e
KY
1868 </para>
1869 </listitem>
1870 </varlistentry>
fb261f53
KY
1871 </variablelist>
1872 </refsect2>
1873
16e58f07
KY
1874 <refsect2>
1875 <title>PR_SET_NO_NEW_PRIVS</title>
1876 <para>
1877 <!--
1878 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
1879 privileges to do anything that could not have been done without
1880 the execve() call (for example, rendering the set-user-ID and
1881 set-group-ID mode bits, and file capabilities non-functional).
1882 Once set, this bit cannot be unset. The setting of this bit is
1883 inherited by children created by fork() and clone(), and preserved
1884 across execve().
1885 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
1886 changed into its intended AppArmor profile or SElinux context.
1887 -->
1888 PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。
1889 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。
1890 PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。
1891 </para>
1892 <variablelist>
1893 <varlistentry>
1894 <term>
1895 <option>lxc.no_new_privs</option>
1896 </term>
1897 <listitem>
1898 <para>
50a8555e 1899 <!--
16e58f07
KY
1900 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
1901 container. Set to 1 to activate.
50a8555e
KY
1902 -->
1903 コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。
16e58f07
KY
1904 </para>
1905 </listitem>
1906 </varlistentry>
1907 </variablelist>
1908 </refsect2>
1909
fb261f53
KY
1910 <refsect2>
1911 <title><!-- UID mappings -->UID のマッピング</title>
1912 <para>
1913 <!--
1914 A container can be started in a private user namespace with
50a8555e
KY
1915 user and group id mappings. For instance, you can map userid
1916 0 in the container to userid 200000 on the host. The root
1917 user in the container will be privileged in the container,
1918 but unprivileged on the host. Normally a system container
1919 will want a range of ids, so you would map, for instance,
1920 user and group ids 0 through 20,000 in the container to the
1921 ids 200,000 through 220,000.
fb261f53 1922 -->
dc421f3a
KY
1923 コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。
1924 たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。
1925 コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。
1926 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。
1927 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。
fb261f53
KY
1928 </para>
1929 <variablelist>
50a8555e
KY
1930 <varlistentry>
1931 <term>
1932 <option>lxc.id_map</option>
1933 </term>
1934 <listitem>
1935 <para>
1936 <!--
1937 Four values must be provided. First a character, either
1938 'u', or 'g', to specify whether user or group ids are
1939 being mapped. Next is the first userid as seen in the
1940 user namespace of the container. Next is the userid as
1941 seen on the host. Finally, a range indicating the number
1942 of consecutive ids to map.
fb261f53 1943 -->
dc421f3a
KY
1944 4 つの値を記述する必要があります。
1945 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。
1946 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。
1947 その次は、そのユーザ ID のホスト上での値です。
1948 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。
50a8555e
KY
1949 </para>
1950 </listitem>
1951 </varlistentry>
fb261f53
KY
1952 </variablelist>
1953 </refsect2>
1954
1955 <refsect2>
1956 <title><!-- Container hooks -->コンテナのフック</title>
1957 <para>
1958 <!--
1959 Container hooks are programs or scripts which can be executed
50a8555e 1960 at various times in a container's lifetime.
fb261f53 1961 -->
dc421f3a 1962 コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。
fb261f53
KY
1963 </para>
1964 <para>
1965 <!--
1966 When a container hook is executed, information is passed both
50a8555e
KY
1967 as command line arguments and through environment variables.
1968 The arguments are:
1969 <itemizedlist>
1970 <listitem><para> Container name. </para></listitem>
1971 <listitem><para> Section (always 'lxc'). </para></listitem>
1972 <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
1973 <listitem><para> Additional arguments. In the
1974 case of the clone hook, any extra arguments passed to
d0b2a434
KY
1975 lxc-clone will appear as further arguments to the hook.
1976 In the case of the stop hook, paths to filedescriptors
1977 for each of the container's namespaces along with their types
1978 are passed. </para></listitem>
50a8555e
KY
1979 </itemizedlist>
1980 The following environment variables are set:
1981 <itemizedlist>
1982 <listitem><para> LXC_NAME: is the container's name. </para></listitem>
1983 <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
1984 <listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem>
1985 <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
1986 <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs entry for the container. Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem>
1987 </itemizedlist>
fb261f53 1988 -->
dc421f3a 1989 コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は:
50a8555e
KY
1990 <itemizedlist>
1991 <listitem><para>コンテナ名</para></listitem>
1992 <listitem><para>セクション (常に 'lxc')</para></listitem>
1993 <listitem><para>フックのタイプ ('clone' や 'pre-mount' など)</para></listitem>
1994 <listitem><para>追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。</para></listitem>
1995 </itemizedlist>
dc421f3a 1996 以下の環境変数がセットされます。
50a8555e
KY
1997 <itemizedlist>
1998 <listitem><para> LXC_NAME: コンテナ名</para></listitem>
1999 <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス</para></listitem>
2000 <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス </para></listitem>
2001 <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前</para></listitem>
2002 <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。</para></listitem>
fb261f53
KY
2003 </itemizedlist>
2004 </para>
2005 <para>
2006 <!--
2007 Standard output from the hooks is logged at debug level.
2008 Standard error is not logged, but can be captured by the
2009 hook redirecting its standard error to standard output.
2010 -->
dc421f3a
KY
2011 スクリプトからの標準出力は debug レベルでロギングされます。
2012 標準エラー出力はロギングされません。
2013 しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
fb261f53
KY
2014 </para>
2015 <variablelist>
50a8555e
KY
2016 <varlistentry>
2017 <term>
2018 <option>lxc.hook.pre-start</option>
2019 </term>
2020 <listitem>
2021 <para>
fb261f53 2022 <!--
50a8555e
KY
2023 A hook to be run in the host's namespace before the
2024 container ttys, consoles, or mounts are up.
fb261f53 2025 -->
dc421f3a 2026 コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。
50a8555e
KY
2027 </para>
2028 </listitem>
2029 </varlistentry>
fb261f53
KY
2030 </variablelist>
2031 <variablelist>
50a8555e
KY
2032 <varlistentry>
2033 <term>
2034 <option>lxc.hook.pre-mount</option>
2035 </term>
2036 <listitem>
2037 <para>
2038 <!--
2039 A hook to be run in the container's fs namespace but before
2040 the rootfs has been set up. This allows for manipulation
2041 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
2042 done in this hook will not be reflected on the host (apart from
2043 mounts propagation), so they will be automatically cleaned up
2044 when the container shuts down.
fb261f53 2045 -->
dc421f3a
KY
2046 コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。
2047 これにより rootfs の操作が可能になります。
2048 例えば、暗号化されたファイルシステムのマウントなどです。
2049 このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。
2050 なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。
50a8555e
KY
2051 </para>
2052 </listitem>
2053 </varlistentry>
fb261f53
KY
2054 </variablelist>
2055 <variablelist>
50a8555e
KY
2056 <varlistentry>
2057 <term>
2058 <option>lxc.hook.mount</option>
2059 </term>
2060 <listitem>
2061 <para>
fb261f53 2062 <!--
50a8555e
KY
2063 A hook to be run in the container's namespace after
2064 mounting has been done, but before the pivot_root.
fb261f53 2065 -->
dc421f3a 2066 マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。
50a8555e
KY
2067 </para>
2068 </listitem>
2069 </varlistentry>
fb261f53
KY
2070 </variablelist>
2071 <variablelist>
50a8555e
KY
2072 <varlistentry>
2073 <term>
2074 <option>lxc.hook.autodev</option>
2075 </term>
2076 <listitem>
2077 <para>
2078 <!--
2079 A hook to be run in the container's namespace after
2080 mounting has been done and after any mount hooks have
2081 run, but before the pivot_root, if
2082 <option>lxc.autodev</option> == 1.
2083 The purpose of this hook is to assist in populating the
2084 /dev directory of the container when using the autodev
2085 option for systemd based containers. The container's /dev
2086 directory is relative to the
2087 ${<option>LXC_ROOTFS_MOUNT</option>} environment
2088 variable available when the hook is run.
fb261f53 2089 -->
dc421f3a
KY
2090 <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。
2091 このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。
50a8555e
KY
2092 </para>
2093 </listitem>
2094 </varlistentry>
fb261f53
KY
2095 </variablelist>
2096 <variablelist>
50a8555e
KY
2097 <varlistentry>
2098 <term>
2099 <option>lxc.hook.start</option>
2100 </term>
2101 <listitem>
2102 <para>
fb261f53 2103 <!--
50a8555e
KY
2104 A hook to be run in the container's namespace immediately
2105 before executing the container's init. This requires the
2106 program to be available in the container.
fb261f53 2107 -->
dc421f3a
KY
2108 コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。
2109 コンテナ内で利用可能なプログラムである必要があります。
50a8555e
KY
2110 </para>
2111 </listitem>
2112 </varlistentry>
fb261f53 2113 </variablelist>
d0b2a434
KY
2114 <variablelist>
2115 <varlistentry>
2116 <term>
2117 <option>lxc.hook.stop</option>
2118 </term>
2119 <listitem>
2120 <para>
50a8555e 2121 <!--
d0b2a434
KY
2122 A hook to be run in the host's namespace with references
2123 to the container's namespaces after the container has been shut
2124 down. For each namespace an extra argument is passed to the hook
2125 containing the namespace's type and a filename that can be used to
2126 obtain a file descriptor to the corresponding namespace, separated
2127 by a colon. The type is the name as it would appear in the
2128 <filename>/proc/PID/ns</filename> directory.
2129 For instance for the mount namespace the argument usually looks
2130 like <filename>mnt:/proc/PID/fd/12</filename>.
50a8555e
KY
2131 -->
2132 コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。
2133 それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。
2134 タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。
2135 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。
d0b2a434
KY
2136 </para>
2137 </listitem>
2138 </varlistentry>
2139 </variablelist>
fb261f53 2140 <variablelist>
50a8555e
KY
2141 <varlistentry>
2142 <term>
2143 <option>lxc.hook.post-stop</option>
2144 </term>
2145 <listitem>
2146 <para>
fb261f53 2147 <!--
50a8555e
KY
2148 A hook to be run in the host's namespace after the
2149 container has been shut down.
fb261f53 2150 -->
dc421f3a 2151 コンテナがシャットダウンされた後にホストの名前空間で実行するフック。
50a8555e
KY
2152 </para>
2153 </listitem>
2154 </varlistentry>
fb261f53
KY
2155 </variablelist>
2156 <variablelist>
50a8555e
KY
2157 <varlistentry>
2158 <term>
2159 <option>lxc.hook.clone</option>
2160 </term>
2161 <listitem>
2162 <para>
fb261f53 2163 <!--
50a8555e
KY
2164 A hook to be run when the container is cloned to a new one.
2165 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2166 <manvolnum>1</manvolnum></citerefentry> for more information.
fb261f53 2167 -->
dc421f3a 2168 コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは
fb261f53
KY
2169 <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2170 <manvolnum>1</manvolnum></citerefentry>
dc421f3a 2171 を参照してください。
50a8555e
KY
2172 </para>
2173 </listitem>
2174 </varlistentry>
fb261f53 2175 </variablelist>
de0dc533
KY
2176 <variablelist>
2177 <varlistentry>
2178 <term>
2179 <option>lxc.hook.destroy</option>
2180 </term>
2181 <listitem>
2182 <para>
2183 <!--
2184 A hook to be run when the container is destroyed.
2185 -->
2186 コンテナを破壊する際に実行されるフックです。
2187 </para>
2188 </listitem>
2189 </varlistentry>
2190 </variablelist>
fb261f53
KY
2191 </refsect2>
2192
2193 <refsect2>
2194 <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title>
2195 <para>
2196 <!--
2197 A number of environment variables are made available to the startup
2198 hooks to provide configuration information and assist in the
2199 functioning of the hooks. Not all variables are valid in all
2200 contexts. In particular, all paths are relative to the host system
2201 and, as such, not valid during the <option>lxc.hook.start</option> hook.
2202 -->
dc421f3a
KY
2203 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。
2204 全ての変数が全てのコンテキストで利用可能なわけではありません。
2205 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。
fb261f53
KY
2206 </para>
2207 <variablelist>
50a8555e
KY
2208 <varlistentry>
2209 <term>
2210 <option>LXC_NAME</option>
2211 </term>
2212 <listitem>
2213 <para>
fb261f53 2214 <!--
50a8555e
KY
2215 The LXC name of the container. Useful for logging messages
2216 in common log environments. [<option>-n</option>]
fb261f53 2217 -->
dc421f3a 2218 LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>]
50a8555e
KY
2219 </para>
2220 </listitem>
2221 </varlistentry>
fb261f53
KY
2222 </variablelist>
2223 <variablelist>
50a8555e
KY
2224 <varlistentry>
2225 <term>
2226 <option>LXC_CONFIG_FILE</option>
2227 </term>
2228 <listitem>
2229 <para>
2230 <!--
2231 Host relative path to the container configuration file. This
2232 gives the container to reference the original, top level,
2233 configuration file for the container in order to locate any
2234 additional configuration information not otherwise made
2235 available. [<option>-f</option>]
fb261f53 2236 -->
dc421f3a
KY
2237 コンテナの設定ファイルのホスト上でのパス。
2238 これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>]
50a8555e
KY
2239 </para>
2240 </listitem>
2241 </varlistentry>
fb261f53
KY
2242 </variablelist>
2243 <variablelist>
50a8555e
KY
2244 <varlistentry>
2245 <term>
2246 <option>LXC_CONSOLE</option>
2247 </term>
2248 <listitem>
2249 <para>
fb261f53 2250 <!--
50a8555e
KY
2251 The path to the console output of the container if not NULL.
2252 [<option>-c</option>] [<option>lxc.console</option>]
fb261f53 2253 -->
dc421f3a 2254 設定されている場合のコンテナのコンソール出力のパス。
50a8555e
KY
2255 [<option>-c</option>] [<option>lxc.console</option>]
2256 </para>
2257 </listitem>
2258 </varlistentry>
fb261f53
KY
2259 </variablelist>
2260 <variablelist>
50a8555e
KY
2261 <varlistentry>
2262 <term>
2263 <option>LXC_CONSOLE_LOGPATH</option>
2264 </term>
2265 <listitem>
2266 <para>
fb261f53 2267 <!--
50a8555e
KY
2268 The path to the console log output of the container if not NULL.
2269 [<option>-L</option>]
fb261f53 2270 -->
dc421f3a 2271 設定されている場合のコンテナのコンソールログ出力のパス。
50a8555e
KY
2272 [<option>-L</option>]
2273 </para>
2274 </listitem>
2275 </varlistentry>
fb261f53
KY
2276 </variablelist>
2277 <variablelist>
50a8555e
KY
2278 <varlistentry>
2279 <term>
2280 <option>LXC_ROOTFS_MOUNT</option>
2281 </term>
2282 <listitem>
2283 <para>
2284 <!--
2285 The mount location to which the container is initially bound.
2286 This will be the host relative path to the container rootfs
2287 for the container instance being started and is where changes
2288 should be made for that instance.
2289 [<option>lxc.rootfs.mount</option>]
fb261f53 2290 -->
dc421f3a
KY
2291 初期にコンテナがマウントされる場所。
2292 これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。
50a8555e
KY
2293 [<option>lxc.rootfs.mount</option>]
2294 </para>
2295 </listitem>
2296 </varlistentry>
fb261f53
KY
2297 </variablelist>
2298 <variablelist>
50a8555e
KY
2299 <varlistentry>
2300 <term>
2301 <option>LXC_ROOTFS_PATH</option>
2302 </term>
2303 <listitem>
2304 <para>
fb261f53 2305 <!--
50a8555e
KY
2306 The host relative path to the container root which has been
2307 mounted to the rootfs.mount location.
2308 [<option>lxc.rootfs</option>]
fb261f53 2309 -->
dc421f3a 2310 rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。
50a8555e
KY
2311 [<option>lxc.rootfs</option>]
2312 </para>
2313 </listitem>
2314 </varlistentry>
fb261f53 2315 </variablelist>
07945418
KY
2316 <variablelist>
2317 <varlistentry>
2318 <term>
2319 <option>LXC_SRC_NAME</option>
2320 </term>
2321 <listitem>
2322 <para>
2323 <!--
2324 Only for the clone hook. Is set to the original container name.
2325 -->
2326 clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。
2327 </para>
2328 </listitem>
2329 </varlistentry>
2330 </variablelist>
3c08e893
KY
2331 <variablelist>
2332 <varlistentry>
2333 <term>
2334 <option>LXC_TARGET</option>
2335 </term>
2336 <listitem>
2337 <para>
50a8555e 2338 <!--
3c08e893
KY
2339 Only for the stop hook. Is set to "stop" for a container
2340 shutdown or "reboot" for a container reboot.
50a8555e
KY
2341 -->
2342 stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。
3c08e893
KY
2343 </para>
2344 </listitem>
2345 </varlistentry>
2346 </variablelist>
63f2635d
KY
2347 <variablelist>
2348 <varlistentry>
2349 <term>
2350 <option>LXC_CGNS_AWARE</option>
2351 </term>
2352 <listitem>
2353 <para>
2354 <!--
2355 If unset, then this version of lxc is not aware of cgroup
2356 namespaces. If set, it will be set to 1, and lxc is aware
2357 of cgroup namespaces. Note this does not guarantee that
2358 cgroup namespaces are enabled in the kernel. This is used
2359 by the lxcfs mount hook.
2360 -->
cd548c9d
KY
2361 この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。
2362 この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。
63f2635d
KY
2363 </para>
2364 </listitem>
2365 </varlistentry>
2366 </variablelist>
fb261f53
KY
2367 </refsect2>
2368
2369 <refsect2>
2370 <title><!-- Logging -->ロギング</title>
2371 <para>
2372 <!--
2373 Logging can be configured on a per-container basis. By default,
2374 depending upon how the lxc package was compiled, container startup
2375 is logged only at the ERROR level, and logged to a file named after
2376 the container (with '.log' appended) either under the container path,
2377 or under @LOGPATH@.
2378 -->
dc421f3a
KY
2379 ロギングはコンテナごとに設定することが可能です。
2380 デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。
fb261f53
KY
2381 </para>
2382 <para>
2383 <!--
2384 Both the default log level and the log file can be specified in the
2385 container configuration file, overriding the default behavior. Note
2386 that the configuration file entries can in turn be overridden by the
2387 command line options to <command>lxc-start</command>.
2388 -->
dc421f3a
KY
2389 デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。
2390 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。
fb261f53
KY
2391 </para>
2392 <variablelist>
50a8555e
KY
2393 <varlistentry>
2394 <term>
46cc906d 2395 <option>lxc.log.level</option>
50a8555e
KY
2396 </term>
2397 <listitem>
2398 <para>
2399 <!--
2400 The level at which to log. The log level is an integer in
2401 the range of 0..8 inclusive, where a lower number means more
2402 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
2403 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
2404 alert, and 8 = fatal. If unspecified, the level defaults
2405 to 5 (error), so that only errors and above are logged.
fb261f53 2406 -->
dc421f3a
KY
2407 ログを取得するレベル。
2408 ログレベルは 0..8 の範囲の整数です。
2409 数字が小さいほど冗長なデバッグを意味します。
2410 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。
2411 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。
50a8555e
KY
2412 </para>
2413 <para>
fb261f53 2414 <!--
50a8555e
KY
2415 Note that when a script (such as either a hook script or a
2416 network interface up or down script) is called, the script's
2417 standard output is logged at level 1, debug.
fb261f53 2418 -->
dc421f3a 2419 (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。
50a8555e
KY
2420 </para>
2421 </listitem>
2422 </varlistentry>
2423 <varlistentry>
2424 <term>
46cc906d 2425 <option>lxc.log</option>
50a8555e
KY
2426 </term>
2427 <listitem>
2428 <para>
2429 <!--
2430 The file to which logging info should be written.
fb261f53 2431 -->
dc421f3a 2432 ログ情報を書き込むファイル。
50a8555e
KY
2433 </para>
2434 </listitem>
2435 </varlistentry>
917420dd
KY
2436 <varlistentry>
2437 <term>
46cc906d 2438 <option>lxc.log.syslog</option>
917420dd
KY
2439 </term>
2440 <listitem>
2441 <para>
50a8555e 2442 <!--
917420dd 2443 Send logging info to syslog. It respects the log level defined in
46cc906d 2444 <command>lxc.log.level</command>. The argument should be the syslog
917420dd
KY
2445 facility to use, valid ones are: daemon, local0, local1, local2,
2446 local3, local4, local5, local5, local7.
50a8555e 2447 -->
46cc906d 2448 ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
917420dd
KY
2449 </para>
2450 </listitem>
2451 </varlistentry>
fb261f53
KY
2452 </variablelist>
2453 </refsect2>
2454
2455 <refsect2>
2456 <title><!-- Autostart -->自動起動</title>
2457 <para>
2458 <!--
2459 The autostart options support marking which containers should be
2460 auto-started and in what order. These options may be used by LXC tools
2461 directly or by external tooling provided by the distributions.
2462 -->
dc421f3a
KY
2463 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。
2464 このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。
fb261f53
KY
2465 </para>
2466
2467 <variablelist>
2468 <varlistentry>
2469 <term>
2470 <option>lxc.start.auto</option>
2471 </term>
2472 <listitem>
2473 <para>
2474 <!--
2475 Whether the container should be auto-started.
2476 Valid values are 0 (off) and 1 (on).
2477 -->
dc421f3a
KY
2478 コンテナを自動起動させるかどうかを設定します。
2479 有効な値は 0(オフ) か 1(オン) です。
fb261f53
KY
2480 </para>
2481 </listitem>
2482 </varlistentry>
2483 <varlistentry>
2484 <term>
2485 <option>lxc.start.delay</option>
2486 </term>
2487 <listitem>
2488 <para>
2489 <!--
2490 How long to wait (in seconds) after the container is
2491 started before starting the next one.
2492 -->
dc421f3a 2493 コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。
fb261f53
KY
2494 </para>
2495 </listitem>
2496 </varlistentry>
2497 <varlistentry>
2498 <term>
2499 <option>lxc.start.order</option>
2500 </term>
2501 <listitem>
2502 <para>
2503 <!--
2504 An integer used to sort the containers when auto-starting
2505 a series of containers at once.
2506 -->
dc421f3a 2507 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。
fb261f53
KY
2508 </para>
2509 </listitem>
2510 </varlistentry>
86b484e9
KY
2511 <varlistentry>
2512 <term>
2513 <option>lxc.monitor.unshare</option>
2514 </term>
2515 <listitem>
2516 <para>
2517 <!--
2518 If not zero the mount namespace will be unshared from the host
2519 before initializing the container (before running any pre-start
2520 hooks). This requires the CAP_SYS_ADMIN capability at startup.
2521 Default is 0.
2522 -->
2523 この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。
2524 </para>
2525 </listitem>
2526 </varlistentry>
fb261f53
KY
2527 <varlistentry>
2528 <term>
2529 <option>lxc.group</option>
2530 </term>
2531 <listitem>
2532 <para>
2533 <!--
2534 A multi-value key (can be used multiple times) to put the
2535 container in a container group. Those groups can then be
2536 used (amongst other things) to start a series of related
2537 containers.
2538 -->
dc421f3a 2539 コンテナを追加したいコンテナグループ名を指定します。
4db216f7 2540 複数の値を設定でき、複数回指定することもできます。
dc421f3a 2541 設定されたグループは、関連する一連のコンテナを起動させるために使われます。
fb261f53
KY
2542 </para>
2543 </listitem>
2544 </varlistentry>
2545 </variablelist>
2546 </refsect2>
2547
f57517ef
KY
2548 <refsect2>
2549 <title><!-- Autostart and System Boot -->自動起動とシステムブート</title>
2550 <para>
2551 <!--
2552 Each container can be part of any number of groups or no group at all.
2553 Two groups are special. One is the NULL group, i.e. the container does
2554 not belong to any group. The other group is the "onboot" group.
2555 -->
2556 コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。
2557 </para>
2558
2559 <para>
2560 <!--
2561 When the system boots with the LXC service enabled, it will first
2562 attempt to boot any containers with lxc.start.auto == 1 that is a member
2563 of the "onboot" group. The startup will be in order of lxc.start.order.
2564 If an lxc.start.delay has been specified, that delay will be honored
2565 before attempting to start the next container to give the current
2566 container time to begin initialization and reduce overloading the host
2567 system. After starting the members of the "onboot" group, the LXC system
2568 will proceed to boot containers with lxc.start.auto == 1 which are not
2569 members of any group (the NULL group) and proceed as with the onboot
2570 group.
2571 -->
2572 LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。
2573 lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。
2574 "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。
2575 </para>
2576
2577 </refsect2>
9231d3a4
KY
2578
2579 <refsect2>
2580 <title><!-- Container Environment -->コンテナの環境変数</title>
2581 <para>
2582 <!--
50a8555e
KY
2583 If you want to pass environment variables into the container (that
2584 is, environment variables which will be available to init and all of
2585 its descendents), you can use <command>lxc.environment</command>
2586 parameters to do so. Be careful that you do not pass in anything
2587 sensitive; any process in the container which doesn't have its
2588 environment scrubbed will have these variables available to it, and
2589 environment variables are always available via
2590 <command>/proc/PID/environ</command>.
9231d3a4
KY
2591 -->
2592 コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。
2593 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。
2594 </para>
2595
2596 <para>
2597 <!--
2598 This configuration parameter can be specified multiple times; once
2599 for each environment variable you wish to configure.
2600 -->
2601 この設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。
2602 </para>
2603
2604 <variablelist>
50a8555e
KY
2605 <varlistentry>
2606 <term>
2607 <option>lxc.environment</option>
2608 </term>
2609 <listitem>
2610 <para>
9231d3a4 2611 <!--
50a8555e
KY
2612 Specify an environment variable to pass into the container.
2613 Example:
9231d3a4
KY
2614 -->
2615 コンテナに渡したい環境変数を指定します。
2616 例:
50a8555e
KY
2617 </para>
2618 <programlisting>
2619 lxc.environment = APP_ENV=production
2620 lxc.environment = SYSLOG_SERVER=192.0.2.42
2621 </programlisting>
2622 </listitem>
2623 </varlistentry>
9231d3a4
KY
2624 </variablelist>
2625 </refsect2>
2626
fb261f53
KY
2627 </refsect1>
2628
2629 <refsect1>
2630 <title><!-- Examples -->例</title>
2631 <para>
2632 <!--
50a8555e
KY
2633 In addition to the few examples given below, you will find
2634 some other examples of configuration file in @DOCDIR@/examples
fb261f53 2635 -->
dc421f3a 2636 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。
fb261f53
KY
2637 </para>
2638 <refsect2>
2639 <title><!-- Network -->ネットワーク</title>
2640 <para>
2641 <!--
2642 This configuration sets up a container to use a veth pair
50a8555e
KY
2643 device with one side plugged to a bridge br0 (which has been
2644 configured before on the system by the administrator). The
2645 virtual network device visible in the container is renamed to
2646 eth0.
fb261f53 2647 -->
dc421f3a
KY
2648 この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。
2649 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。
fb261f53
KY
2650 </para>
2651 <programlisting>
b67771bc 2652 lxc.uts.name = myhostname
7fa3f2e9 2653 lxc.net.0.type = veth
2654 lxc.net.0.flags = up
2655 lxc.net.0.link = br0
2656 lxc.net.0.name = eth0
2657 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2658 lxc.net.0.ipv4 = 1.2.3.5/24 1.2.3.255
2659 lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
fb261f53
KY
2660 </programlisting>
2661 </refsect2>
2662
2663 <refsect2>
2664 <title><!-- UID/GID mapping -->UID/GID のマッピング</title>
2665 <para><!-- This configuration will map both user and group ids in the
2666 range 0-9999 in the container to the ids 100000-109999 on the host. -->
dc421f3a 2667 この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。
fb261f53
KY
2668 </para>
2669 <programlisting>
50a8555e
KY
2670 lxc.id_map = u 0 100000 10000
2671 lxc.id_map = g 0 100000 10000
fb261f53
KY
2672 </programlisting>
2673 </refsect2>
2674
2675 <refsect2>
2676 <title>Control group</title>
2677 <para>
2678 <!-- This configuration will setup several control groups for
2679 the application, cpuset.cpus restricts usage of the defined cpu,
2680 cpus.share prioritize the control group, devices.allow makes
2681 usable the specified devices.-->
dc421f3a
KY
2682 この設定は、アプリケーションのための control group をいくつか設定します。
2683 cpuset.cpus は定義された cpu のみ使用できるように制限します。
2684 cpus.share は、control group の (cpu) 優先度を指定します。
2685 devices.allow は、特定のデバイスを使用可能にします。
fb261f53
KY
2686 </para>
2687 <programlisting>
50a8555e
KY
2688 lxc.cgroup.cpuset.cpus = 0,1
2689 lxc.cgroup.cpu.shares = 1234
2690 lxc.cgroup.devices.deny = a
2691 lxc.cgroup.devices.allow = c 1:3 rw
2692 lxc.cgroup.devices.allow = b 8:0 rw
fb261f53
KY
2693 </programlisting>
2694 </refsect2>
2695
2696 <refsect2>
2697 <title><!-- Complex configuration -->複雑な設定</title>
2698 <para>
2699 <!-- This example show a complex configuration making a complex
2700 network stack, using the control groups, setting a new hostname,
2701 mounting some locations and a changing root file system. -->
dc421f3a 2702 この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。
fb261f53
KY
2703 </para>
2704 <programlisting>
b67771bc 2705 lxc.uts.name = complex
7fa3f2e9 2706 lxc.net.0.type = veth
2707 lxc.net.0.flags = up
2708 lxc.net.0.link = br0
2709 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2710 lxc.net.0.ipv4 = 10.2.3.5/24 10.2.3.255
2711 lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
2712 lxc.net.0.ipv6 = 2003:db8:1:0:214:5432:feab:3588
2713 lxc.net.1.type = macvlan
2714 lxc.net.1.flags = up
2715 lxc.net.1.link = eth0
2716 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
2717 lxc.net.1.ipv4 = 10.2.3.4/24
2718 lxc.net.1.ipv4 = 192.168.10.125/24
2719 lxc.net.1.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596
2720 lxc.net.2.type = phys
2721 lxc.net.2.flags = up
2722 lxc.net.2.link = dummy0
2723 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
2724 lxc.net.2.ipv4 = 10.2.3.6/24
2725 lxc.net.2.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297
2513f519
KY
2726 lxc.cgroup.cpuset.cpus = 0,1
2727 lxc.cgroup.cpu.shares = 1234
2728 lxc.cgroup.devices.deny = a
2729 lxc.cgroup.devices.allow = c 1:3 rw
2730 lxc.cgroup.devices.allow = b 8:0 rw
2731 lxc.mount = /etc/fstab.complex
2732 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
2733 lxc.rootfs = /mnt/rootfs.complex
2734 lxc.cap.drop = sys_module mknod setuid net_raw
2735 lxc.cap.drop = mac_override
fb261f53
KY
2736 </programlisting>
2737 </refsect2>
2738
2739 </refsect1>
2740
2741 <refsect1>
2742 <title>See Also</title>
2743 <simpara>
2744 <citerefentry>
50a8555e
KY
2745 <refentrytitle><command>chroot</command></refentrytitle>
2746 <manvolnum>1</manvolnum>
fb261f53
KY
2747 </citerefentry>,
2748
2749 <citerefentry>
50a8555e
KY
2750 <refentrytitle><command>pivot_root</command></refentrytitle>
2751 <manvolnum>8</manvolnum>
fb261f53
KY
2752 </citerefentry>,
2753
2754 <citerefentry>
50a8555e
KY
2755 <refentrytitle><filename>fstab</filename></refentrytitle>
2756 <manvolnum>5</manvolnum>
fb261f53
KY
2757 </citerefentry>
2758
2759 <citerefentry>
50a8555e
KY
2760 <refentrytitle><filename>capabilities</filename></refentrytitle>
2761 <manvolnum>7</manvolnum>
fb261f53
KY
2762 </citerefentry>
2763
2764 </simpara>
2765 </refsect1>
2766
2767 &seealso;
2768
2769 <refsect1>
2770 <title><!-- Author -->作者</title>
2771 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
2772 </refsect1>
2773
2774</refentry>
2775
2776<!-- Keep this comment at the end of the file
2777Local variables:
2778mode: sgml
2779sgml-omittag:t
2780sgml-shorttag:t
2781sgml-minimize-attributes:nil
2782sgml-always-quote-attributes:t
2783sgml-indent-step:2
2784sgml-indent-data:t
2785sgml-parent-document:nil
2786sgml-default-dtd-file:nil
2787sgml-exposed-tags:nil
2788sgml-local-catalogs:nil
2789sgml-local-ecat-files:nil
2790End:
2791-->