]> git.proxmox.com Git - mirror_lxc.git/blame - doc/ja/lxc.container.conf.sgml.in
doc: s/aa_allow_incomplete/apparmor.allow_incomplete/g
[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>,
e71b47b2 131 <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and
2513f519 132 others for even more fine-grained configuration.
fb261f53 133 -->
e71b47b2 134 LXC は、シングルドットを使って設定キーの名前空間を表します。<option>lxc.net.0</option> のような複雑な設定キーは、<option>lxc.net.0.type</option>、<option>lxc.net.0.link</option>、<option>lxc.net.0.ipv6.address</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>
e71b47b2 705 <option>lxc.net.[i].ipv4.address</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>
e71b47b2 746 <option>lxc.net.[i].ipv6.address</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>
e71b47b2 866 <option>lxc.pty.max</option>
50a8555e
KY
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>
e71b47b2 911 <option>lxc.console.path</option>
50a8555e
KY
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>
e71b47b2 955 <option>lxc.tty.max</option>
50a8555e
KY
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>
e71b47b2 996 <option>lxc.tty.dir</option>
50a8555e
KY
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
fb261f53
KY
1055 <refsect2>
1056 <title><!-- Mount points -->マウントポイント</title>
1057 <para>
1058 <!--
50a8555e
KY
1059 The mount points section specifies the different places to be
1060 mounted. These mount points will be private to the container
1061 and won't be visible by the processes running outside of the
1062 container. This is useful to mount /etc, /var or /home for
1063 examples.
fb261f53 1064 -->
dc421f3a
KY
1065 マウントポイントセクションは、マウントするための区別された場所を指定します。
1066 これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。
1067 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。
fb261f53 1068 </para>
2c79e91b 1069 <para>
50a8555e
KY
1070 <!--
1071 NOTE - LXC will generally ensure that mount targets and relative
1072 bind-mount sources are properly confined under the container
1073 root, to avoid attacks involving over-mounting host directories
1074 and files. (Symbolic links in absolute mount sources are ignored)
1075 However, if the container configuration first mounts a directory which
1076 is under the control of the container user, such as /home/joe, into
2c79e91b
KY
1077 the container at some <filename>path</filename>, and then mounts
1078 under <filename>path</filename>, then a TOCTTOU attack would be
1079 possible where the container user modifies a symbolic link under
1080 his home directory at just the right time.
50a8555e
KY
1081 -->
1082 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。
1083 これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。)
1084 しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。
2c79e91b 1085 </para>
fb261f53 1086 <variablelist>
50a8555e
KY
1087 <varlistentry>
1088 <term>
e71b47b2 1089 <option>lxc.mount.fstab</option>
50a8555e
KY
1090 </term>
1091 <listitem>
1092 <para>
1093 <!--
1094 specify a file location in
1095 the <filename>fstab</filename> format, containing the
1096 mount information. The mount target location can and in
1097 most cases should be a relative path, which will become
1098 relative to the mounted container root. For instance,
e053b31e
KY
1099 -->
1100 マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。
1101 マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。
50a8555e 1102 </para>
2513f519
KY
1103 <programlisting>
1104 proc proc proc nodev,noexec,nosuid 0 0
1105 </programlisting>
50a8555e 1106 <para>
e053b31e 1107 <!--
50a8555e
KY
1108 Will mount a proc filesystem under the container's /proc,
1109 regardless of where the root filesystem comes from. This
1110 is resilient to block device backed filesystems as well as
1111 container cloning.
e053b31e 1112 -->
2513f519 1113 この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。
50a8555e
KY
1114 </para>
1115 <para>
e053b31e 1116 <!--
50a8555e
KY
1117 Note that when mounting a filesystem from an
1118 image file or block device the third field (fs_vfstype)
1119 cannot be auto as with
fb261f53 1120 <citerefentry>
50a8555e 1121 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1122 <manvolnum>8</manvolnum>
1123 </citerefentry>
1124 but must be explicitly specified.
1125 -->
dc421f3a 1126 ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は
fb261f53 1127 <citerefentry>
50a8555e 1128 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1129 <manvolnum>8</manvolnum>
1130 </citerefentry>
dc421f3a 1131 のように auto を指定することはできず、明確に指定しなければいけません。
50a8555e
KY
1132 </para>
1133 </listitem>
1134 </varlistentry>
fb261f53 1135
50a8555e
KY
1136 <varlistentry>
1137 <term>
1138 <option>lxc.mount.entry</option>
1139 </term>
1140 <listitem>
1141 <para>
fb261f53 1142 <!--
50a8555e
KY
1143 specify a mount point corresponding to a line in the
1144 fstab format.
fb261f53 1145 -->
dc421f3a 1146 fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。
b332333b
KY
1147
1148 <!--
1149 Moreover lxc add two options to mount.
1150 <option>optional</option> don't fail if mount does not work.
1151 <option>create=dir</option> or <option>create=file</option>
1152 to create dir (or file) when the point will be mounted.
1153 -->
1154 fstab フォーマットに加えて、LXC ではマウントに対して独自の 2 つのオプションが使えます。
1155 <option>optional</option> は、マウントが失敗しても失敗を返さずに無視します。
1156 <option>create=dir</option> と <option>create=file</option> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。
50a8555e
KY
1157 </para>
1158 </listitem>
1159 </varlistentry>
fb261f53 1160
50a8555e
KY
1161 <varlistentry>
1162 <term>
1163 <option>lxc.mount.auto</option>
1164 </term>
1165 <listitem>
1166 <para>
fb261f53 1167 <!--
50a8555e
KY
1168 specify which standard kernel file systems should be
1169 automatically mounted. This may dramatically simplify
1170 the configuration. The file systems are:
fb261f53 1171 -->
dc421f3a
KY
1172 標準のカーネルファイルシステムで自動的にマウントするものを指定します。
1173 これは劇的に設定を容易にする可能性があります。
50a8555e
KY
1174 </para>
1175 <itemizedlist>
1176 <listitem>
fb261f53 1177 <!--
50a8555e
KY
1178 <para>
1179 <option>proc:mixed</option> (or <option>proc</option>):
1180 mount <filename>/proc</filename> as read-write, but
1181 remount <filename>/proc/sys</filename> and
1182 <filename>/proc/sysrq-trigger</filename> read-only
1183 for security / container isolation purposes.
1184 </para>
fb261f53
KY
1185 -->
1186 <para>
1187 <option>proc:mixed</option> (or <option>proc</option>):
dc421f3a
KY
1188 <filename>/proc</filename> を読み書き可能でマウントします。
1189 ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。
fb261f53 1190 </para>
50a8555e
KY
1191 </listitem>
1192 <listitem>
fb261f53 1193 <!--
50a8555e
KY
1194 <para>
1195 <option>proc:rw</option>: mount
1196 <filename>/proc</filename> as read-write
1197 </para>
fb261f53
KY
1198 -->
1199 <para>
50a8555e 1200 <option>proc:rw</option>:
dc421f3a 1201 <filename>/proc</filename> を読み書き可能でマウントします。
fb261f53 1202 </para>
50a8555e
KY
1203 </listitem>
1204 <listitem>
1205 <!--
dd93ef87
KY
1206 <para>
1207 <option>sys:mixed</option> (or <option>sys</option>):
1208 mount <filename>/sys</filename> as read-only but with
1209 /sys/devices/virtual/net writable.
1210 </para>
50a8555e
KY
1211 -->
1212 <para>
1213 <option>sys:mixed</option> (or <option>sys</option>):
1214 /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。
1215 </para>
dd93ef87 1216 </listitem>
50a8555e 1217 <listitem>
fb261f53 1218 <!--
50a8555e
KY
1219 <para>
1220 <option>sys:ro</option>
1221 mount <filename>/sys</filename> as read-only
1222 for security / container isolation purposes.
1223 </para>
fb261f53
KY
1224 -->
1225 <para>
dd93ef87 1226 <option>sys:ro</option>:
dc421f3a 1227 <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。
fb261f53 1228 </para>
50a8555e
KY
1229 </listitem>
1230 <listitem>
fb261f53 1231 <!--
50a8555e
KY
1232 <para>
1233 <option>sys:rw</option>: mount
1234 <filename>/sys</filename> as read-write
1235 </para>
fb261f53
KY
1236 -->
1237 <para>
50a8555e 1238 <option>sys:rw</option>:
dc421f3a 1239 <filename>/sys</filename> を読み書き可能でマウントします。
fb261f53 1240 </para>
50a8555e
KY
1241 </listitem>
1242 <listitem>
fb261f53 1243 <!--
50a8555e
KY
1244 <para>
1245 <option>cgroup:mixed</option>:
1246 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1247 create directories for all hierarchies to which
1248 the container is added, create subdirectories
1249 there with the name of the cgroup, and bind-mount
1250 the container's own cgroup into that directory.
1251 The container will be able to write to its own
1252 cgroup directory, but not the parents, since they
1253 will be remounted read-only
1254 </para>
fb261f53
KY
1255 -->
1256 <para>
50a8555e 1257 <option>cgroup:mixed</option>:
dc421f3a
KY
1258 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。
1259 コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。
fb261f53 1260 </para>
50a8555e
KY
1261 </listitem>
1262 <listitem>
fb261f53 1263 <!--
50a8555e
KY
1264 <para>
1265 <option>cgroup:ro</option>: similar to
1266 <option>cgroup:mixed</option>, but everything will
1267 be mounted read-only.
1268 </para>
fb261f53
KY
1269 -->
1270 <para>
50a8555e 1271 <option>cgroup:ro</option>:
dc421f3a 1272 <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1273 </para>
50a8555e
KY
1274 </listitem>
1275 <listitem>
fb261f53 1276 <!--
50a8555e
KY
1277 <para>
1278 <option>cgroup:rw</option>: similar to
1279 <option>cgroup:mixed</option>, but everything will
1280 be mounted read-write. Note that the paths leading
1281 up to the container's own cgroup will be writable,
1282 but will not be a cgroup filesystem but just part
1283 of the tmpfs of <filename>/sys/fs/cgroup</filename>
1284 </para>
fb261f53
KY
1285 -->
1286 <para>
50a8555e 1287 <option>cgroup:rw</option>:
dc421f3a
KY
1288 <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。
1289 コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、
1290 <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。
fb261f53 1291 </para>
50a8555e
KY
1292 </listitem>
1293 <listitem>
1294 <para>
aafea1f7 1295 <!--
50a8555e
KY
1296 <option>cgroup</option> (without specifier):
1297 defaults to <option>cgroup:rw</option> if the
1298 container retains the CAP_SYS_ADMIN capability,
1299 <option>cgroup:mixed</option> otherwise.
aafea1f7 1300 -->
50a8555e 1301 <option>cgroup</option> (マウントオプションなしの場合):
aafea1f7 1302 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。
50a8555e
KY
1303 </para>
1304 </listitem>
1305 <listitem>
fb261f53 1306 <!--
50a8555e
KY
1307 <para>
1308 <option>cgroup-full:mixed</option>:
1309 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1310 create directories for all hierarchies to which
1311 the container is added, bind-mount the hierarchies
1312 from the host to the container and make everything
1313 read-only except the container's own cgroup. Note
1314 that compared to <option>cgroup</option>, where
1315 all paths leading up to the container's own cgroup
1316 are just simple directories in the underlying
1317 tmpfs, here
1318 <filename>/sys/fs/cgroup/$hierarchy</filename>
1319 will contain the host's full cgroup hierarchy,
1320 albeit read-only outside the container's own cgroup.
1321 This may leak quite a bit of information into the
1322 container.
1323 </para>
fb261f53
KY
1324 -->
1325 <para>
50a8555e 1326 <option>cgroup-full:mixed</option>:
dc421f3a
KY
1327 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。
1328 <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。
1329 これにより、コンテナにはかなりの情報が漏洩します。
fb261f53 1330 </para>
50a8555e
KY
1331 </listitem>
1332 <listitem>
fb261f53 1333 <!--
50a8555e
KY
1334 <para>
1335 <option>cgroup-full:ro</option>: similar to
1336 <option>cgroup-full:mixed</option>, but everything
1337 will be mounted read-only.
1338 </para>
fb261f53
KY
1339 -->
1340 <para>
50a8555e 1341 <option>cgroup-full:ro</option>:
dc421f3a 1342 <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1343 </para>
50a8555e
KY
1344 </listitem>
1345 <listitem>
fb261f53 1346 <!--
50a8555e
KY
1347 <para>
1348 <option>cgroup-full:rw</option>: similar to
1349 <option>cgroup-full:mixed</option>, but everything
1350 will be mounted read-write. Note that in this case,
1351 the container may escape its own cgroup. (Note also
1352 that if the container has CAP_SYS_ADMIN support
1353 and can mount the cgroup filesystem itself, it may
1354 do so anyway.)
1355 </para>
fb261f53
KY
1356 -->
1357 <para>
50a8555e
KY
1358 <option>cgroup-full:rw</option>:
1359 <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。
dc421f3a 1360 この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。
fb261f53 1361 </para>
50a8555e
KY
1362 </listitem>
1363 <listitem>
1364 <para>
aafea1f7 1365 <!--
50a8555e
KY
1366 <option>cgroup-full</option> (without specifier):
1367 defaults to <option>cgroup-full:rw</option> if the
1368 container retains the CAP_SYS_ADMIN capability,
1369 <option>cgroup-full:mixed</option> otherwise.
aafea1f7 1370 -->
50a8555e 1371 <option>cgroup-full</option> (マウントオプションなしの場合):
aafea1f7 1372 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。
50a8555e
KY
1373 </para>
1374 </listitem>
1375 </itemizedlist>
1376 <para>
1377 <!--
1378 If cgroup namespaces are enabled, then any <option>cgroup</option>
1379 auto-mounting request will be ignored, since the container can
1380 mount the filesystems itself, and automounting can confuse the
1381 container init.
1382 -->
1383 cgroup 名前空間が有効の場合、<option>cgroup</option> の自動マウントの指定はどれも無視されます。これは、コンテナが自身でファイルシステムをマウントするため、自動マウントがコンテナの init を混乱させる可能性があるためです。
1384 </para>
1385 <para>
1386 <!--
1387 Note that if automatic mounting of the cgroup filesystem
1388 is enabled, the tmpfs under
1389 <filename>/sys/fs/cgroup</filename> will always be
1390 mounted read-write (but for the <option>:mixed</option>
1391 and <option>:ro</option> cases, the individual
1392 hierarchies,
1393 <filename>/sys/fs/cgroup/$hierarchy</filename>, will be
1394 read-only). This is in order to work around a quirk in
1395 Ubuntu's
1396 <citerefentry>
1397 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1398 <manvolnum>8</manvolnum>
1399 </citerefentry>
50a8555e
KY
1400 command that will cause containers to wait for user
1401 input at boot if
1402 <filename>/sys/fs/cgroup</filename> is mounted read-only
1403 and the container can't remount it read-write due to a
1404 lack of CAP_SYS_ADMIN.
cf5f3128
KY
1405 -->
1406 cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の
1407 <citerefentry>
50a8555e 1408 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1409 <manvolnum>8</manvolnum>
1410 </citerefentry>
1411 コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。
50a8555e
KY
1412 </para>
1413 <para>
fb261f53 1414 <!--
50a8555e 1415 Examples:
fb261f53
KY
1416 -->
1417 例:
50a8555e
KY
1418 </para>
1419 <programlisting>
1420 lxc.mount.auto = proc sys cgroup
1421 lxc.mount.auto = proc:rw sys:rw cgroup-full:rw
1422 </programlisting>
1423 </listitem>
1424 </varlistentry>
fb261f53
KY
1425
1426 </variablelist>
1427 </refsect2>
1428
1429 <refsect2>
1430 <title><!-- Root file system -->ルートファイルシステム</title>
1431 <para>
1432 <!--
50a8555e
KY
1433 The root file system of the container can be different than that
1434 of the host system.
fb261f53 1435 -->
dc421f3a 1436 コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。
fb261f53
KY
1437 </para>
1438 <variablelist>
50a8555e
KY
1439 <varlistentry>
1440 <term>
1441 <option>lxc.rootfs</option>
1442 </term>
1443 <listitem>
1444 <para>
1445 <!--
1446 specify the root file system for the container. It can
1447 be an image file, a directory or a block device. If not
1448 specified, the container shares its root file system
1449 with the host.
fb261f53 1450 -->
8b3374e5 1451 コンテナのルートファイルシステムを指定します。
dc421f3a
KY
1452 この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。
1453 もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。
50a8555e
KY
1454 </para>
1455 <para>
a4dbc45f
KY
1456 <!--
1457 For directory or simple block-device backed containers,
1458 a pathname can be used. If the rootfs is backed by a nbd
1459 device, then <filename>nbd:file:1</filename> specifies that
1460 <filename>file</filename> should be attached to a nbd device,
1461 and partition 1 should be mounted as the rootfs.
1462 <filename>nbd:file</filename> specifies that the nbd device
1463 itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
1464 specifies that the rootfs should be an overlay with <filename>/upper</filename>
1465 being mounted read-write over a read-only mount of <filename>/lower</filename>.
1466 <filename>aufs:/lower:/upper</filename> does the same using aufs in place
ddf81220
KY
1467 of overlayfs. For both <filename>overlayfs</filename> and
1468 <filename>aufs</filename> multiple <filename>/lower</filename>
1469 directories can be specified. <filename>loop:/file</filename> tells lxc to attach
a4dbc45f
KY
1470 <filename>/file</filename> to a loop device and mount the loop device.
1471 -->
1472 ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。
1473 もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。
1474 <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。
1475 <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。
ddf81220 1476 <filename>aufs:/lower:/upper</filename> は overlayfs で指定している部分を aufs と指定すれば同じことになります。<filename>overlayfs</filename> と <filename>aufs</filename> は両方とも、複数の <filename>/lower</filename> ディレクトリを指定できます。
a4dbc45f 1477 <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。
50a8555e
KY
1478 </para>
1479 </listitem>
1480 </varlistentry>
1481
1482 <varlistentry>
1483 <term>
1484 <option>lxc.rootfs.mount</option>
1485 </term>
1486 <listitem>
1487 <para>
1488 <!--
1489 where to recursively bind <option>lxc.rootfs</option>
1490 before pivoting. This is to ensure success of the
1491 <citerefentry>
1492 <refentrytitle><command>pivot_root</command></refentrytitle>
1493 <manvolnum>8</manvolnum>
1494 </citerefentry>
1495 syscall. Any directory suffices, the default should
1496 generally work.
fb261f53 1497 -->
dc421f3a 1498 root ファイルシステムの変更の前に、<option>lxc.rootfs</option> を再帰的にどこにバインドするのかを指定します。これは
50a8555e
KY
1499 <citerefentry>
1500 <refentrytitle><command>pivot_root</command></refentrytitle>
1501 <manvolnum>8</manvolnum>
1502 </citerefentry>
dc421f3a
KY
1503 システムコールが確実に成功する事を保証します。
1504 どんなディレクトリでも良く、デフォルトでも通常は動くはずです。
50a8555e
KY
1505 </para>
1506 </listitem>
1507 </varlistentry>
fb261f53 1508
50a8555e
KY
1509 <varlistentry>
1510 <term>
1511 <option>lxc.rootfs.options</option>
1512 </term>
1513 <listitem>
1514 <para>
b4c66de1 1515 <!--
50a8555e 1516 extra mount options to use when mounting the rootfs.
b4c66de1 1517 -->
dc421f3a 1518 rootfs をマウントするときに追加したいマウントオプション。
50a8555e
KY
1519 </para>
1520 </listitem>
1521 </varlistentry>
b4c66de1 1522
fb261f53
KY
1523 </variablelist>
1524 </refsect2>
1525
1526 <refsect2>
1527 <title>Control group</title>
1528 <para>
1529 <!--
50a8555e
KY
1530 The control group section contains the configuration for the
1531 different subsystem. <command>lxc</command> does not check the
1532 correctness of the subsystem name. This has the disadvantage
1533 of not detecting configuration errors until the container is
1534 started, but has the advantage of permitting any future
1535 subsystem.
fb261f53 1536 -->
dc421f3a
KY
1537 CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。
1538 <command>lxc</command> は、このサブシステム名の正しさはチェックしません。
1539 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。
fb261f53
KY
1540 </para>
1541 <variablelist>
50a8555e
KY
1542 <varlistentry>
1543 <term>
1544 <option>lxc.cgroup.[subsystem name]</option>
1545 </term>
1546 <listitem>
1547 <para>
1548 <!--
1549 specify the control group value to be set. The
1550 subsystem name is the literal name of the control group
1551 subsystem. The permitted names and the syntax of their
1552 values is not dictated by LXC, instead it depends on the
1553 features of the Linux kernel running at the time the
1554 container is started,
1555 eg. <option>lxc.cgroup.cpuset.cpus</option>
fb261f53 1556 -->
dc421f3a
KY
1557 設定する control group の値を指定します。
1558 サブシステム名は、control group のそのままの名前です。
1559 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
fb261f53 1560 例えば <option>lxc.cgroup.cpuset.cpus</option>
50a8555e
KY
1561 </para>
1562 </listitem>
1563 </varlistentry>
fb261f53
KY
1564 </variablelist>
1565 </refsect2>
1566
1567 <refsect2>
1568 <title><!-- Capabilities -->ケーパビリティ</title>
1569 <para>
1570 <!--
50a8555e
KY
1571 The capabilities can be dropped in the container if this one
1572 is run as root.
fb261f53 1573 -->
dc421f3a 1574 コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。
fb261f53
KY
1575 </para>
1576 <variablelist>
50a8555e
KY
1577 <varlistentry>
1578 <term>
1579 <option>lxc.cap.drop</option>
1580 </term>
1581 <listitem>
1582 <para>
1583 <!--
1584 Specify the capability to be dropped in the container. A
1585 single line defining several capabilities with a space
1586 separation is allowed. The format is the lower case of
1587 the capability definition without the "CAP_" prefix,
1588 eg. CAP_SYS_MODULE should be specified as
1589 sys_module. See
1590 <citerefentry>
1591 <refentrytitle><command>capabilities</command></refentrytitle>
1592 <manvolnum>7</manvolnum>
1593 </citerefentry>,
9c3f2966
KY
1594 If used with no value, lxc will clear any drop capabilities
1595 specified up to this point.
fb261f53 1596 -->
dc421f3a
KY
1597 コンテナ内で削除するケーパビリティ (capability) を指定します。
1598 一行でスペース区切りで複数のケーパビリティを指定することも可能です。
1599 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。
1600 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。
1601 詳しくは以下を参照してください。
50a8555e
KY
1602 <citerefentry>
1603 <refentrytitle><command>capabilities</command></refentrytitle>
1604 <manvolnum>7</manvolnum>
1605 </citerefentry>
1606 この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。
1607 </para>
1608 </listitem>
1609 </varlistentry>
1610 <varlistentry>
1611 <term>
1612 <option>lxc.cap.keep</option>
1613 </term>
1614 <listitem>
1615 <para>
1616 <!--
1617 Specify the capability to be kept in the container. All other
1618 capabilities will be dropped. When a special value of "none" is
1619 encountered, lxc will clear any keep capabilities specified up
1620 to this point. A value of "none" alone can be used to drop all
1621 capabilities.
fb261f53 1622 -->
f36062dc
KY
1623 コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。
1624 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。
50a8555e
KY
1625 </para>
1626 </listitem>
1627 </varlistentry>
fb261f53
KY
1628 </variablelist>
1629 </refsect2>
1630
e7267b53
KY
1631 <refsect2>
1632 <title>リソース制限 <!-- Resource limits --></title>
1633 <para>
50a8555e 1634 <!--
e7267b53
KY
1635 The soft and hard resource limits for the container can be changed.
1636 Unprivileged containers can only lower them. Resources which are not
1637 explicitly specified will be inherited.
50a8555e
KY
1638 -->
1639 コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。
e7267b53
KY
1640 </para>
1641 <variablelist>
1642 <varlistentry>
1643 <term>
240d4b74 1644 <option>lxc.prlimit.[limit name]</option>
e7267b53
KY
1645 </term>
1646 <listitem>
1647 <para>
1648 <!--
1649 Specify the resource limit to be set. A limit is specified as two
1650 colon separated values which are either numeric or the word
1651 'unlimited'. A single value can be used as a shortcut to set both
1652 soft and hard limit to the same value. The permitted names the
1653 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
1654 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
1655 <citerefentry>
1656 <refentrytitle><command>setrlimit</command></refentrytitle>
1657 <manvolnum>2</manvolnum>
1658 </citerefentry>.
1659 If used with no value, lxc will clear the resource limit
1660 specified up to this point. A resource with no explicitly
1661 configured limitation will be inherited from the process starting
1662 up the container.
1663 -->
1664 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは
1665 <citerefentry>
1666 <refentrytitle><command>setrlimit</command></refentrytitle>
1667 <manvolnum>2</manvolnum>
1668 </citerefentry> を参照してください。
1669 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。
1670 </para>
1671 </listitem>
1672 </varlistentry>
1673 </variablelist>
1674 </refsect2>
1675
fb261f53
KY
1676 <refsect2>
1677 <title><!-- Apparmor profile -->Apparmor プロファイル</title>
1678 <para>
1679 <!--
50a8555e
KY
1680 If lxc was compiled and installed with apparmor support, and the host
1681 system has apparmor enabled, then the apparmor profile under which the
1682 container should be run can be specified in the container
9d101b3d 1683 configuration. The default is <command>lxc-container-default-cgns</command>
50a8555e
KY
1684 if the host kernel is cgroup namespace aware, or
1685 <command>lxc-container-default</command> othewise.
fb261f53 1686 -->
dc421f3a 1687 lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。
cd548c9d 1688 デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。
fb261f53
KY
1689 </para>
1690 <variablelist>
50a8555e
KY
1691 <varlistentry>
1692 <term>
1693 <option>lxc.aa_profile</option>
1694 </term>
1695 <listitem>
1696 <para>
fb261f53 1697 <!--
50a8555e
KY
1698 Specify the apparmor profile under which the container should
1699 be run. To specify that the container should be unconfined,
1700 use
fb261f53 1701 -->
dc421f3a
KY
1702 コンテナが従うべき apparmor プロファイルを指定します。
1703 コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。
50a8555e
KY
1704 </para>
1705 <programlisting>lxc.aa_profile = unconfined</programlisting>
9d101b3d 1706 <para>
50a8555e 1707 <!--
9d101b3d 1708 If the apparmor profile should remain unchanged (i.e. if you
50a8555e
KY
1709 are nesting containers and are already confined), then use
1710 -->
1711 もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。
9d101b3d
KY
1712 </para>
1713 <programlisting>lxc.aa_profile = unchanged</programlisting>
50a8555e
KY
1714 </listitem>
1715 </varlistentry>
1716 <varlistentry>
1717 <term>
69e38e00 1718 <option>lxc.apparmor.allow_incomplete</option>
50a8555e
KY
1719 </term>
1720 <listitem>
1721 <para>
1722 <!--
1723 Apparmor profiles are pathname based. Therefore many file
1724 restrictions require mount restrictions to be effective against
1725 a determined attacker. However, these mount restrictions are not
1726 yet implemented in the upstream kernel. Without the mount
1727 restrictions, the apparmor profiles still protect against accidental
1728 damager.
edf3a692
KY
1729 -->
1730 apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。
1731 しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。
50a8555e
KY
1732 </para>
1733 <para>
edf3a692 1734 <!--
50a8555e
KY
1735 If this flag is 0 (default), then the container will not be
1736 started if the kernel lacks the apparmor mount features, so that a
1737 regression after a kernel upgrade will be detected. To start the
1738 container under partial apparmor protection, set this flag to 1.
edf3a692
KY
1739 -->
1740 このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。
1741 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。
50a8555e
KY
1742 </para>
1743 </listitem>
1744 </varlistentry>
fb261f53
KY
1745 </variablelist>
1746 </refsect2>
1747
1748 <refsect2>
1749 <title><!-- SELinux context -->SELinux コンテキスト</title>
1750 <para>
1751 <!--
50a8555e
KY
1752 If lxc was compiled and installed with SELinux support, and the host
1753 system has SELinux enabled, then the SELinux context under which the
1754 container should be run can be specified in the container
1755 configuration. The default is <command>unconfined_t</command>,
1756 which means that lxc will not attempt to change contexts.
1757 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
1758 information.
fb261f53 1759 -->
dc421f3a
KY
1760 lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。
1761 デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。
03c315af 1762 ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。
fb261f53
KY
1763 </para>
1764 <variablelist>
50a8555e
KY
1765 <varlistentry>
1766 <term>
1767 <option>lxc.se_context</option>
1768 </term>
1769 <listitem>
1770 <para>
fb261f53 1771 <!--
50a8555e
KY
1772 Specify the SELinux context under which the container should
1773 be run or <command>unconfined_t</command>. For example
fb261f53 1774 -->
dc421f3a 1775 コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。
50a8555e
KY
1776 </para>
1777 <programlisting>lxc.se_context = system_u:system_r:lxc_t:s0:c22</programlisting>
1778 </listitem>
1779 </varlistentry>
fb261f53
KY
1780 </variablelist>
1781 </refsect2>
1782
1783 <refsect2>
1784 <title><!-- Seccomp configuration -->Seccomp の設定</title>
1785 <para>
1786 <!--
1787 A container can be started with a reduced set of available
50a8555e
KY
1788 system calls by loading a seccomp profile at startup. The
1789 seccomp configuration file must begin with a version number
1790 on the first line, a policy type on the second line, followed
1791 by the configuration.
fb261f53 1792 -->
dc421f3a
KY
1793 コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。
1794 seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。
fb261f53 1795 </para>
4473e38b
KY
1796 <para>
1797 <!--
1798 Versions 1 and 2 are currently supported. In version 1, the
50a8555e
KY
1799 policy is a simple whitelist. The second line therefore must
1800 read "whitelist", with the rest of the file containing one (numeric)
1801 sycall number per line. Each syscall number is whitelisted,
1802 while every unlisted number is blacklisted for use in the container
4473e38b 1803 -->
dc421f3a
KY
1804 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。
1805 そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。
4473e38b
KY
1806 </para>
1807
1808 <para>
1809 <!--
1810 In version 2, the policy may be blacklist or whitelist,
1811 supports per-rule and per-policy default actions, and supports
1812 per-architecture system call resolution from textual names.
1813 -->
dc421f3a 1814 バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。
4473e38b
KY
1815 </para>
1816 <para>
1817 <!--
1818 An example blacklist policy, in which all system calls are
1819 allowed except for mknod, which will simply do nothing and
1820 return 0 (success), looks like:
1821 -->
dc421f3a 1822 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。
4473e38b 1823 </para>
2513f519
KY
1824
1825 <programlisting>
1826 2
1827 blacklist
1828 mknod errno 0
1829 </programlisting>
1830
fb261f53 1831 <variablelist>
50a8555e
KY
1832 <varlistentry>
1833 <term>
e71b47b2 1834 <option>lxc.seccomp.profile</option>
50a8555e
KY
1835 </term>
1836 <listitem>
1837 <para>
fb261f53 1838 <!--
50a8555e
KY
1839 Specify a file containing the seccomp configuration to
1840 load before the container starts.
fb261f53 1841 -->
dc421f3a 1842 コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。
50a8555e
KY
1843 </para>
1844 </listitem>
1845 </varlistentry>
fb261f53
KY
1846 </variablelist>
1847 </refsect2>
1848
16e58f07
KY
1849 <refsect2>
1850 <title>PR_SET_NO_NEW_PRIVS</title>
1851 <para>
1852 <!--
1853 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
1854 privileges to do anything that could not have been done without
1855 the execve() call (for example, rendering the set-user-ID and
1856 set-group-ID mode bits, and file capabilities non-functional).
1857 Once set, this bit cannot be unset. The setting of this bit is
1858 inherited by children created by fork() and clone(), and preserved
1859 across execve().
1860 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
1861 changed into its intended AppArmor profile or SElinux context.
1862 -->
1863 PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。
1864 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。
1865 PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。
1866 </para>
1867 <variablelist>
1868 <varlistentry>
1869 <term>
1870 <option>lxc.no_new_privs</option>
1871 </term>
1872 <listitem>
1873 <para>
50a8555e 1874 <!--
16e58f07
KY
1875 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
1876 container. Set to 1 to activate.
50a8555e
KY
1877 -->
1878 コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。
16e58f07
KY
1879 </para>
1880 </listitem>
1881 </varlistentry>
1882 </variablelist>
1883 </refsect2>
1884
fb261f53
KY
1885 <refsect2>
1886 <title><!-- UID mappings -->UID のマッピング</title>
1887 <para>
1888 <!--
1889 A container can be started in a private user namespace with
50a8555e
KY
1890 user and group id mappings. For instance, you can map userid
1891 0 in the container to userid 200000 on the host. The root
1892 user in the container will be privileged in the container,
1893 but unprivileged on the host. Normally a system container
1894 will want a range of ids, so you would map, for instance,
1895 user and group ids 0 through 20,000 in the container to the
1896 ids 200,000 through 220,000.
fb261f53 1897 -->
dc421f3a
KY
1898 コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。
1899 たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。
1900 コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。
1901 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。
1902 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。
fb261f53
KY
1903 </para>
1904 <variablelist>
50a8555e
KY
1905 <varlistentry>
1906 <term>
1907 <option>lxc.id_map</option>
1908 </term>
1909 <listitem>
1910 <para>
1911 <!--
1912 Four values must be provided. First a character, either
1913 'u', or 'g', to specify whether user or group ids are
1914 being mapped. Next is the first userid as seen in the
1915 user namespace of the container. Next is the userid as
1916 seen on the host. Finally, a range indicating the number
1917 of consecutive ids to map.
fb261f53 1918 -->
dc421f3a
KY
1919 4 つの値を記述する必要があります。
1920 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。
1921 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。
1922 その次は、そのユーザ ID のホスト上での値です。
1923 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。
50a8555e
KY
1924 </para>
1925 </listitem>
1926 </varlistentry>
fb261f53
KY
1927 </variablelist>
1928 </refsect2>
1929
1930 <refsect2>
1931 <title><!-- Container hooks -->コンテナのフック</title>
1932 <para>
1933 <!--
1934 Container hooks are programs or scripts which can be executed
50a8555e 1935 at various times in a container's lifetime.
fb261f53 1936 -->
dc421f3a 1937 コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。
fb261f53
KY
1938 </para>
1939 <para>
1940 <!--
1941 When a container hook is executed, information is passed both
50a8555e
KY
1942 as command line arguments and through environment variables.
1943 The arguments are:
1944 <itemizedlist>
1945 <listitem><para> Container name. </para></listitem>
1946 <listitem><para> Section (always 'lxc'). </para></listitem>
1947 <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
1948 <listitem><para> Additional arguments. In the
1949 case of the clone hook, any extra arguments passed to
d0b2a434
KY
1950 lxc-clone will appear as further arguments to the hook.
1951 In the case of the stop hook, paths to filedescriptors
1952 for each of the container's namespaces along with their types
1953 are passed. </para></listitem>
50a8555e
KY
1954 </itemizedlist>
1955 The following environment variables are set:
1956 <itemizedlist>
1957 <listitem><para> LXC_NAME: is the container's name. </para></listitem>
1958 <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
1959 <listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem>
1960 <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
1961 <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>
1962 </itemizedlist>
fb261f53 1963 -->
dc421f3a 1964 コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は:
50a8555e
KY
1965 <itemizedlist>
1966 <listitem><para>コンテナ名</para></listitem>
1967 <listitem><para>セクション (常に 'lxc')</para></listitem>
1968 <listitem><para>フックのタイプ ('clone' や 'pre-mount' など)</para></listitem>
1969 <listitem><para>追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。</para></listitem>
1970 </itemizedlist>
dc421f3a 1971 以下の環境変数がセットされます。
50a8555e
KY
1972 <itemizedlist>
1973 <listitem><para> LXC_NAME: コンテナ名</para></listitem>
1974 <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス</para></listitem>
1975 <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス </para></listitem>
1976 <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前</para></listitem>
1977 <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。</para></listitem>
fb261f53
KY
1978 </itemizedlist>
1979 </para>
1980 <para>
1981 <!--
1982 Standard output from the hooks is logged at debug level.
1983 Standard error is not logged, but can be captured by the
1984 hook redirecting its standard error to standard output.
1985 -->
dc421f3a
KY
1986 スクリプトからの標準出力は debug レベルでロギングされます。
1987 標準エラー出力はロギングされません。
1988 しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
fb261f53
KY
1989 </para>
1990 <variablelist>
50a8555e
KY
1991 <varlistentry>
1992 <term>
1993 <option>lxc.hook.pre-start</option>
1994 </term>
1995 <listitem>
1996 <para>
fb261f53 1997 <!--
50a8555e
KY
1998 A hook to be run in the host's namespace before the
1999 container ttys, consoles, or mounts are up.
fb261f53 2000 -->
dc421f3a 2001 コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。
50a8555e
KY
2002 </para>
2003 </listitem>
2004 </varlistentry>
fb261f53
KY
2005 </variablelist>
2006 <variablelist>
50a8555e
KY
2007 <varlistentry>
2008 <term>
2009 <option>lxc.hook.pre-mount</option>
2010 </term>
2011 <listitem>
2012 <para>
2013 <!--
2014 A hook to be run in the container's fs namespace but before
2015 the rootfs has been set up. This allows for manipulation
2016 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
2017 done in this hook will not be reflected on the host (apart from
2018 mounts propagation), so they will be automatically cleaned up
2019 when the container shuts down.
fb261f53 2020 -->
dc421f3a
KY
2021 コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。
2022 これにより rootfs の操作が可能になります。
2023 例えば、暗号化されたファイルシステムのマウントなどです。
2024 このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。
2025 なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。
50a8555e
KY
2026 </para>
2027 </listitem>
2028 </varlistentry>
fb261f53
KY
2029 </variablelist>
2030 <variablelist>
50a8555e
KY
2031 <varlistentry>
2032 <term>
2033 <option>lxc.hook.mount</option>
2034 </term>
2035 <listitem>
2036 <para>
fb261f53 2037 <!--
50a8555e
KY
2038 A hook to be run in the container's namespace after
2039 mounting has been done, but before the pivot_root.
fb261f53 2040 -->
dc421f3a 2041 マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。
50a8555e
KY
2042 </para>
2043 </listitem>
2044 </varlistentry>
fb261f53
KY
2045 </variablelist>
2046 <variablelist>
50a8555e
KY
2047 <varlistentry>
2048 <term>
2049 <option>lxc.hook.autodev</option>
2050 </term>
2051 <listitem>
2052 <para>
2053 <!--
2054 A hook to be run in the container's namespace after
2055 mounting has been done and after any mount hooks have
2056 run, but before the pivot_root, if
2057 <option>lxc.autodev</option> == 1.
2058 The purpose of this hook is to assist in populating the
2059 /dev directory of the container when using the autodev
2060 option for systemd based containers. The container's /dev
2061 directory is relative to the
2062 ${<option>LXC_ROOTFS_MOUNT</option>} environment
2063 variable available when the hook is run.
fb261f53 2064 -->
dc421f3a
KY
2065 <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。
2066 このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。
50a8555e
KY
2067 </para>
2068 </listitem>
2069 </varlistentry>
fb261f53
KY
2070 </variablelist>
2071 <variablelist>
50a8555e
KY
2072 <varlistentry>
2073 <term>
2074 <option>lxc.hook.start</option>
2075 </term>
2076 <listitem>
2077 <para>
fb261f53 2078 <!--
50a8555e
KY
2079 A hook to be run in the container's namespace immediately
2080 before executing the container's init. This requires the
2081 program to be available in the container.
fb261f53 2082 -->
dc421f3a
KY
2083 コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。
2084 コンテナ内で利用可能なプログラムである必要があります。
50a8555e
KY
2085 </para>
2086 </listitem>
2087 </varlistentry>
fb261f53 2088 </variablelist>
d0b2a434
KY
2089 <variablelist>
2090 <varlistentry>
2091 <term>
2092 <option>lxc.hook.stop</option>
2093 </term>
2094 <listitem>
2095 <para>
50a8555e 2096 <!--
d0b2a434
KY
2097 A hook to be run in the host's namespace with references
2098 to the container's namespaces after the container has been shut
2099 down. For each namespace an extra argument is passed to the hook
2100 containing the namespace's type and a filename that can be used to
2101 obtain a file descriptor to the corresponding namespace, separated
2102 by a colon. The type is the name as it would appear in the
2103 <filename>/proc/PID/ns</filename> directory.
2104 For instance for the mount namespace the argument usually looks
2105 like <filename>mnt:/proc/PID/fd/12</filename>.
50a8555e
KY
2106 -->
2107 コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。
2108 それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。
2109 タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。
2110 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。
d0b2a434
KY
2111 </para>
2112 </listitem>
2113 </varlistentry>
2114 </variablelist>
fb261f53 2115 <variablelist>
50a8555e
KY
2116 <varlistentry>
2117 <term>
2118 <option>lxc.hook.post-stop</option>
2119 </term>
2120 <listitem>
2121 <para>
fb261f53 2122 <!--
50a8555e
KY
2123 A hook to be run in the host's namespace after the
2124 container has been shut down.
fb261f53 2125 -->
dc421f3a 2126 コンテナがシャットダウンされた後にホストの名前空間で実行するフック。
50a8555e
KY
2127 </para>
2128 </listitem>
2129 </varlistentry>
fb261f53
KY
2130 </variablelist>
2131 <variablelist>
50a8555e
KY
2132 <varlistentry>
2133 <term>
2134 <option>lxc.hook.clone</option>
2135 </term>
2136 <listitem>
2137 <para>
fb261f53 2138 <!--
50a8555e
KY
2139 A hook to be run when the container is cloned to a new one.
2140 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2141 <manvolnum>1</manvolnum></citerefentry> for more information.
fb261f53 2142 -->
dc421f3a 2143 コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは
fb261f53
KY
2144 <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2145 <manvolnum>1</manvolnum></citerefentry>
dc421f3a 2146 を参照してください。
50a8555e
KY
2147 </para>
2148 </listitem>
2149 </varlistentry>
fb261f53 2150 </variablelist>
de0dc533
KY
2151 <variablelist>
2152 <varlistentry>
2153 <term>
2154 <option>lxc.hook.destroy</option>
2155 </term>
2156 <listitem>
2157 <para>
2158 <!--
2159 A hook to be run when the container is destroyed.
2160 -->
2161 コンテナを破壊する際に実行されるフックです。
2162 </para>
2163 </listitem>
2164 </varlistentry>
2165 </variablelist>
fb261f53
KY
2166 </refsect2>
2167
2168 <refsect2>
2169 <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title>
2170 <para>
2171 <!--
2172 A number of environment variables are made available to the startup
2173 hooks to provide configuration information and assist in the
2174 functioning of the hooks. Not all variables are valid in all
2175 contexts. In particular, all paths are relative to the host system
2176 and, as such, not valid during the <option>lxc.hook.start</option> hook.
2177 -->
dc421f3a
KY
2178 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。
2179 全ての変数が全てのコンテキストで利用可能なわけではありません。
2180 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。
fb261f53
KY
2181 </para>
2182 <variablelist>
50a8555e
KY
2183 <varlistentry>
2184 <term>
2185 <option>LXC_NAME</option>
2186 </term>
2187 <listitem>
2188 <para>
fb261f53 2189 <!--
50a8555e
KY
2190 The LXC name of the container. Useful for logging messages
2191 in common log environments. [<option>-n</option>]
fb261f53 2192 -->
dc421f3a 2193 LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>]
50a8555e
KY
2194 </para>
2195 </listitem>
2196 </varlistentry>
fb261f53
KY
2197 </variablelist>
2198 <variablelist>
50a8555e
KY
2199 <varlistentry>
2200 <term>
2201 <option>LXC_CONFIG_FILE</option>
2202 </term>
2203 <listitem>
2204 <para>
2205 <!--
2206 Host relative path to the container configuration file. This
2207 gives the container to reference the original, top level,
2208 configuration file for the container in order to locate any
2209 additional configuration information not otherwise made
2210 available. [<option>-f</option>]
fb261f53 2211 -->
dc421f3a
KY
2212 コンテナの設定ファイルのホスト上でのパス。
2213 これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>]
50a8555e
KY
2214 </para>
2215 </listitem>
2216 </varlistentry>
fb261f53
KY
2217 </variablelist>
2218 <variablelist>
50a8555e
KY
2219 <varlistentry>
2220 <term>
2221 <option>LXC_CONSOLE</option>
2222 </term>
2223 <listitem>
2224 <para>
fb261f53 2225 <!--
50a8555e 2226 The path to the console output of the container if not NULL.
e71b47b2 2227 [<option>-c</option>] [<option>lxc.console.path</option>]
fb261f53 2228 -->
dc421f3a 2229 設定されている場合のコンテナのコンソール出力のパス。
e71b47b2 2230 [<option>-c</option>] [<option>lxc.console.path</option>]
50a8555e
KY
2231 </para>
2232 </listitem>
2233 </varlistentry>
fb261f53
KY
2234 </variablelist>
2235 <variablelist>
50a8555e
KY
2236 <varlistentry>
2237 <term>
2238 <option>LXC_CONSOLE_LOGPATH</option>
2239 </term>
2240 <listitem>
2241 <para>
fb261f53 2242 <!--
50a8555e
KY
2243 The path to the console log output of the container if not NULL.
2244 [<option>-L</option>]
fb261f53 2245 -->
dc421f3a 2246 設定されている場合のコンテナのコンソールログ出力のパス。
50a8555e
KY
2247 [<option>-L</option>]
2248 </para>
2249 </listitem>
2250 </varlistentry>
fb261f53
KY
2251 </variablelist>
2252 <variablelist>
50a8555e
KY
2253 <varlistentry>
2254 <term>
2255 <option>LXC_ROOTFS_MOUNT</option>
2256 </term>
2257 <listitem>
2258 <para>
2259 <!--
2260 The mount location to which the container is initially bound.
2261 This will be the host relative path to the container rootfs
2262 for the container instance being started and is where changes
2263 should be made for that instance.
2264 [<option>lxc.rootfs.mount</option>]
fb261f53 2265 -->
dc421f3a
KY
2266 初期にコンテナがマウントされる場所。
2267 これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。
50a8555e
KY
2268 [<option>lxc.rootfs.mount</option>]
2269 </para>
2270 </listitem>
2271 </varlistentry>
fb261f53
KY
2272 </variablelist>
2273 <variablelist>
50a8555e
KY
2274 <varlistentry>
2275 <term>
2276 <option>LXC_ROOTFS_PATH</option>
2277 </term>
2278 <listitem>
2279 <para>
fb261f53 2280 <!--
50a8555e
KY
2281 The host relative path to the container root which has been
2282 mounted to the rootfs.mount location.
2283 [<option>lxc.rootfs</option>]
fb261f53 2284 -->
dc421f3a 2285 rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。
50a8555e
KY
2286 [<option>lxc.rootfs</option>]
2287 </para>
2288 </listitem>
2289 </varlistentry>
fb261f53 2290 </variablelist>
07945418
KY
2291 <variablelist>
2292 <varlistentry>
2293 <term>
2294 <option>LXC_SRC_NAME</option>
2295 </term>
2296 <listitem>
2297 <para>
2298 <!--
2299 Only for the clone hook. Is set to the original container name.
2300 -->
2301 clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。
2302 </para>
2303 </listitem>
2304 </varlistentry>
2305 </variablelist>
3c08e893
KY
2306 <variablelist>
2307 <varlistentry>
2308 <term>
2309 <option>LXC_TARGET</option>
2310 </term>
2311 <listitem>
2312 <para>
50a8555e 2313 <!--
3c08e893
KY
2314 Only for the stop hook. Is set to "stop" for a container
2315 shutdown or "reboot" for a container reboot.
50a8555e
KY
2316 -->
2317 stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。
3c08e893
KY
2318 </para>
2319 </listitem>
2320 </varlistentry>
2321 </variablelist>
63f2635d
KY
2322 <variablelist>
2323 <varlistentry>
2324 <term>
2325 <option>LXC_CGNS_AWARE</option>
2326 </term>
2327 <listitem>
2328 <para>
2329 <!--
2330 If unset, then this version of lxc is not aware of cgroup
2331 namespaces. If set, it will be set to 1, and lxc is aware
2332 of cgroup namespaces. Note this does not guarantee that
2333 cgroup namespaces are enabled in the kernel. This is used
2334 by the lxcfs mount hook.
2335 -->
cd548c9d
KY
2336 この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。
2337 この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。
63f2635d
KY
2338 </para>
2339 </listitem>
2340 </varlistentry>
2341 </variablelist>
fb261f53
KY
2342 </refsect2>
2343
2344 <refsect2>
2345 <title><!-- Logging -->ロギング</title>
2346 <para>
2347 <!--
2348 Logging can be configured on a per-container basis. By default,
2349 depending upon how the lxc package was compiled, container startup
2350 is logged only at the ERROR level, and logged to a file named after
2351 the container (with '.log' appended) either under the container path,
2352 or under @LOGPATH@.
2353 -->
dc421f3a
KY
2354 ロギングはコンテナごとに設定することが可能です。
2355 デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。
fb261f53
KY
2356 </para>
2357 <para>
2358 <!--
2359 Both the default log level and the log file can be specified in the
2360 container configuration file, overriding the default behavior. Note
2361 that the configuration file entries can in turn be overridden by the
2362 command line options to <command>lxc-start</command>.
2363 -->
dc421f3a
KY
2364 デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。
2365 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。
fb261f53
KY
2366 </para>
2367 <variablelist>
50a8555e
KY
2368 <varlistentry>
2369 <term>
46cc906d 2370 <option>lxc.log.level</option>
50a8555e
KY
2371 </term>
2372 <listitem>
2373 <para>
2374 <!--
2375 The level at which to log. The log level is an integer in
2376 the range of 0..8 inclusive, where a lower number means more
2377 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
2378 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
2379 alert, and 8 = fatal. If unspecified, the level defaults
2380 to 5 (error), so that only errors and above are logged.
fb261f53 2381 -->
dc421f3a
KY
2382 ログを取得するレベル。
2383 ログレベルは 0..8 の範囲の整数です。
2384 数字が小さいほど冗長なデバッグを意味します。
2385 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。
2386 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。
50a8555e
KY
2387 </para>
2388 <para>
fb261f53 2389 <!--
50a8555e
KY
2390 Note that when a script (such as either a hook script or a
2391 network interface up or down script) is called, the script's
2392 standard output is logged at level 1, debug.
fb261f53 2393 -->
dc421f3a 2394 (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。
50a8555e
KY
2395 </para>
2396 </listitem>
2397 </varlistentry>
2398 <varlistentry>
2399 <term>
46cc906d 2400 <option>lxc.log</option>
50a8555e
KY
2401 </term>
2402 <listitem>
2403 <para>
2404 <!--
2405 The file to which logging info should be written.
fb261f53 2406 -->
dc421f3a 2407 ログ情報を書き込むファイル。
50a8555e
KY
2408 </para>
2409 </listitem>
2410 </varlistentry>
917420dd
KY
2411 <varlistentry>
2412 <term>
46cc906d 2413 <option>lxc.log.syslog</option>
917420dd
KY
2414 </term>
2415 <listitem>
2416 <para>
50a8555e 2417 <!--
917420dd 2418 Send logging info to syslog. It respects the log level defined in
46cc906d 2419 <command>lxc.log.level</command>. The argument should be the syslog
917420dd
KY
2420 facility to use, valid ones are: daemon, local0, local1, local2,
2421 local3, local4, local5, local5, local7.
50a8555e 2422 -->
46cc906d 2423 ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
917420dd
KY
2424 </para>
2425 </listitem>
2426 </varlistentry>
fb261f53
KY
2427 </variablelist>
2428 </refsect2>
2429
2430 <refsect2>
2431 <title><!-- Autostart -->自動起動</title>
2432 <para>
2433 <!--
2434 The autostart options support marking which containers should be
2435 auto-started and in what order. These options may be used by LXC tools
2436 directly or by external tooling provided by the distributions.
2437 -->
dc421f3a
KY
2438 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。
2439 このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。
fb261f53
KY
2440 </para>
2441
2442 <variablelist>
2443 <varlistentry>
2444 <term>
2445 <option>lxc.start.auto</option>
2446 </term>
2447 <listitem>
2448 <para>
2449 <!--
2450 Whether the container should be auto-started.
2451 Valid values are 0 (off) and 1 (on).
2452 -->
dc421f3a
KY
2453 コンテナを自動起動させるかどうかを設定します。
2454 有効な値は 0(オフ) か 1(オン) です。
fb261f53
KY
2455 </para>
2456 </listitem>
2457 </varlistentry>
2458 <varlistentry>
2459 <term>
2460 <option>lxc.start.delay</option>
2461 </term>
2462 <listitem>
2463 <para>
2464 <!--
2465 How long to wait (in seconds) after the container is
2466 started before starting the next one.
2467 -->
dc421f3a 2468 コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。
fb261f53
KY
2469 </para>
2470 </listitem>
2471 </varlistentry>
2472 <varlistentry>
2473 <term>
2474 <option>lxc.start.order</option>
2475 </term>
2476 <listitem>
2477 <para>
2478 <!--
2479 An integer used to sort the containers when auto-starting
2480 a series of containers at once.
2481 -->
dc421f3a 2482 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。
fb261f53
KY
2483 </para>
2484 </listitem>
2485 </varlistentry>
86b484e9
KY
2486 <varlistentry>
2487 <term>
2488 <option>lxc.monitor.unshare</option>
2489 </term>
2490 <listitem>
2491 <para>
2492 <!--
2493 If not zero the mount namespace will be unshared from the host
2494 before initializing the container (before running any pre-start
2495 hooks). This requires the CAP_SYS_ADMIN capability at startup.
2496 Default is 0.
2497 -->
2498 この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。
2499 </para>
2500 </listitem>
2501 </varlistentry>
fb261f53
KY
2502 <varlistentry>
2503 <term>
2504 <option>lxc.group</option>
2505 </term>
2506 <listitem>
2507 <para>
2508 <!--
2509 A multi-value key (can be used multiple times) to put the
2510 container in a container group. Those groups can then be
2511 used (amongst other things) to start a series of related
2512 containers.
2513 -->
dc421f3a 2514 コンテナを追加したいコンテナグループ名を指定します。
4db216f7 2515 複数の値を設定でき、複数回指定することもできます。
dc421f3a 2516 設定されたグループは、関連する一連のコンテナを起動させるために使われます。
fb261f53
KY
2517 </para>
2518 </listitem>
2519 </varlistentry>
2520 </variablelist>
2521 </refsect2>
2522
f57517ef
KY
2523 <refsect2>
2524 <title><!-- Autostart and System Boot -->自動起動とシステムブート</title>
2525 <para>
2526 <!--
2527 Each container can be part of any number of groups or no group at all.
2528 Two groups are special. One is the NULL group, i.e. the container does
2529 not belong to any group. The other group is the "onboot" group.
2530 -->
2531 コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。
2532 </para>
2533
2534 <para>
2535 <!--
2536 When the system boots with the LXC service enabled, it will first
2537 attempt to boot any containers with lxc.start.auto == 1 that is a member
2538 of the "onboot" group. The startup will be in order of lxc.start.order.
2539 If an lxc.start.delay has been specified, that delay will be honored
2540 before attempting to start the next container to give the current
2541 container time to begin initialization and reduce overloading the host
2542 system. After starting the members of the "onboot" group, the LXC system
2543 will proceed to boot containers with lxc.start.auto == 1 which are not
2544 members of any group (the NULL group) and proceed as with the onboot
2545 group.
2546 -->
2547 LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。
2548 lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。
2549 "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。
2550 </para>
2551
2552 </refsect2>
9231d3a4
KY
2553
2554 <refsect2>
2555 <title><!-- Container Environment -->コンテナの環境変数</title>
2556 <para>
2557 <!--
50a8555e
KY
2558 If you want to pass environment variables into the container (that
2559 is, environment variables which will be available to init and all of
2560 its descendents), you can use <command>lxc.environment</command>
2561 parameters to do so. Be careful that you do not pass in anything
2562 sensitive; any process in the container which doesn't have its
2563 environment scrubbed will have these variables available to it, and
2564 environment variables are always available via
2565 <command>/proc/PID/environ</command>.
9231d3a4
KY
2566 -->
2567 コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。
2568 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。
2569 </para>
2570
2571 <para>
2572 <!--
2573 This configuration parameter can be specified multiple times; once
2574 for each environment variable you wish to configure.
2575 -->
2576 この設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。
2577 </para>
2578
2579 <variablelist>
50a8555e
KY
2580 <varlistentry>
2581 <term>
2582 <option>lxc.environment</option>
2583 </term>
2584 <listitem>
2585 <para>
9231d3a4 2586 <!--
50a8555e
KY
2587 Specify an environment variable to pass into the container.
2588 Example:
9231d3a4
KY
2589 -->
2590 コンテナに渡したい環境変数を指定します。
2591 例:
50a8555e
KY
2592 </para>
2593 <programlisting>
2594 lxc.environment = APP_ENV=production
2595 lxc.environment = SYSLOG_SERVER=192.0.2.42
2596 </programlisting>
2597 </listitem>
2598 </varlistentry>
9231d3a4
KY
2599 </variablelist>
2600 </refsect2>
2601
fb261f53
KY
2602 </refsect1>
2603
2604 <refsect1>
2605 <title><!-- Examples -->例</title>
2606 <para>
2607 <!--
50a8555e
KY
2608 In addition to the few examples given below, you will find
2609 some other examples of configuration file in @DOCDIR@/examples
fb261f53 2610 -->
dc421f3a 2611 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。
fb261f53
KY
2612 </para>
2613 <refsect2>
2614 <title><!-- Network -->ネットワーク</title>
2615 <para>
2616 <!--
2617 This configuration sets up a container to use a veth pair
50a8555e
KY
2618 device with one side plugged to a bridge br0 (which has been
2619 configured before on the system by the administrator). The
2620 virtual network device visible in the container is renamed to
2621 eth0.
fb261f53 2622 -->
dc421f3a
KY
2623 この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。
2624 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。
fb261f53
KY
2625 </para>
2626 <programlisting>
b67771bc 2627 lxc.uts.name = myhostname
7fa3f2e9 2628 lxc.net.0.type = veth
2629 lxc.net.0.flags = up
2630 lxc.net.0.link = br0
2631 lxc.net.0.name = eth0
2632 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
e71b47b2
KY
2633 lxc.net.0.ipv4.address = 1.2.3.5/24 1.2.3.255
2634 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
fb261f53
KY
2635 </programlisting>
2636 </refsect2>
2637
2638 <refsect2>
2639 <title><!-- UID/GID mapping -->UID/GID のマッピング</title>
2640 <para><!-- This configuration will map both user and group ids in the
2641 range 0-9999 in the container to the ids 100000-109999 on the host. -->
dc421f3a 2642 この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。
fb261f53
KY
2643 </para>
2644 <programlisting>
50a8555e
KY
2645 lxc.id_map = u 0 100000 10000
2646 lxc.id_map = g 0 100000 10000
fb261f53
KY
2647 </programlisting>
2648 </refsect2>
2649
2650 <refsect2>
2651 <title>Control group</title>
2652 <para>
2653 <!-- This configuration will setup several control groups for
2654 the application, cpuset.cpus restricts usage of the defined cpu,
2655 cpus.share prioritize the control group, devices.allow makes
2656 usable the specified devices.-->
dc421f3a
KY
2657 この設定は、アプリケーションのための control group をいくつか設定します。
2658 cpuset.cpus は定義された cpu のみ使用できるように制限します。
2659 cpus.share は、control group の (cpu) 優先度を指定します。
2660 devices.allow は、特定のデバイスを使用可能にします。
fb261f53
KY
2661 </para>
2662 <programlisting>
50a8555e
KY
2663 lxc.cgroup.cpuset.cpus = 0,1
2664 lxc.cgroup.cpu.shares = 1234
2665 lxc.cgroup.devices.deny = a
2666 lxc.cgroup.devices.allow = c 1:3 rw
2667 lxc.cgroup.devices.allow = b 8:0 rw
fb261f53
KY
2668 </programlisting>
2669 </refsect2>
2670
2671 <refsect2>
2672 <title><!-- Complex configuration -->複雑な設定</title>
2673 <para>
2674 <!-- This example show a complex configuration making a complex
2675 network stack, using the control groups, setting a new hostname,
2676 mounting some locations and a changing root file system. -->
dc421f3a 2677 この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。
fb261f53
KY
2678 </para>
2679 <programlisting>
b67771bc 2680 lxc.uts.name = complex
7fa3f2e9 2681 lxc.net.0.type = veth
2682 lxc.net.0.flags = up
2683 lxc.net.0.link = br0
2684 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
e71b47b2
KY
2685 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
2686 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
2687 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
7fa3f2e9 2688 lxc.net.1.type = macvlan
2689 lxc.net.1.flags = up
2690 lxc.net.1.link = eth0
2691 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
e71b47b2
KY
2692 lxc.net.1.ipv4.address = 10.2.3.4/24
2693 lxc.net.1.ipv4.address = 192.168.10.125/24
2694 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
7fa3f2e9 2695 lxc.net.2.type = phys
2696 lxc.net.2.flags = up
2697 lxc.net.2.link = dummy0
2698 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
e71b47b2
KY
2699 lxc.net.2.ipv4.address = 10.2.3.6/24
2700 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
2513f519
KY
2701 lxc.cgroup.cpuset.cpus = 0,1
2702 lxc.cgroup.cpu.shares = 1234
2703 lxc.cgroup.devices.deny = a
2704 lxc.cgroup.devices.allow = c 1:3 rw
2705 lxc.cgroup.devices.allow = b 8:0 rw
e71b47b2 2706 lxc.mount.fstab = /etc/fstab.complex
2513f519
KY
2707 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
2708 lxc.rootfs = /mnt/rootfs.complex
2709 lxc.cap.drop = sys_module mknod setuid net_raw
2710 lxc.cap.drop = mac_override
fb261f53
KY
2711 </programlisting>
2712 </refsect2>
2713
2714 </refsect1>
2715
2716 <refsect1>
2717 <title>See Also</title>
2718 <simpara>
2719 <citerefentry>
50a8555e
KY
2720 <refentrytitle><command>chroot</command></refentrytitle>
2721 <manvolnum>1</manvolnum>
fb261f53
KY
2722 </citerefentry>,
2723
2724 <citerefentry>
50a8555e
KY
2725 <refentrytitle><command>pivot_root</command></refentrytitle>
2726 <manvolnum>8</manvolnum>
fb261f53
KY
2727 </citerefentry>,
2728
2729 <citerefentry>
50a8555e
KY
2730 <refentrytitle><filename>fstab</filename></refentrytitle>
2731 <manvolnum>5</manvolnum>
fb261f53
KY
2732 </citerefentry>
2733
2734 <citerefentry>
50a8555e
KY
2735 <refentrytitle><filename>capabilities</filename></refentrytitle>
2736 <manvolnum>7</manvolnum>
fb261f53
KY
2737 </citerefentry>
2738
2739 </simpara>
2740 </refsect1>
2741
2742 &seealso;
2743
2744 <refsect1>
2745 <title><!-- Author -->作者</title>
2746 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
2747 </refsect1>
2748
2749</refentry>
2750
2751<!-- Keep this comment at the end of the file
2752Local variables:
2753mode: sgml
2754sgml-omittag:t
2755sgml-shorttag:t
2756sgml-minimize-attributes:nil
2757sgml-always-quote-attributes:t
2758sgml-indent-step:2
2759sgml-indent-data:t
2760sgml-parent-document:nil
2761sgml-default-dtd-file:nil
2762sgml-exposed-tags:nil
2763sgml-local-catalogs:nil
2764sgml-local-ecat-files:nil
2765End:
2766-->