]> git.proxmox.com Git - mirror_lxc.git/blob - doc/ja/lxc.container.conf.sgml.in
Merge pull request #1793 from tenforward/japanese
[mirror_lxc.git] / doc / ja / lxc.container.conf.sgml.in
1 <!--
2
3 lxc: linux Container library
4
5 (C) Copyright IBM Corp. 2007, 2008
6
7 Authors:
8 Daniel Lezcano <daniel.lezcano at free.fr>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24 Translated into Japanese
25 by 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 <!--
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 カーネル内の良く知られた様々なコンテナ機能の実装に貢献した人と同じ人もいます。
66 </para>
67
68 <para>
69 <!--
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.idmap</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.idmap</option> を使って定義できます。
113 </para>
114
115 <para>
116 <!--
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
129 configuration keys such as <option>lxc.net.0</option> expose various
130 subkeys such as <option>lxc.net.0.type</option>,
131 <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and
132 others for even more fine-grained configuration.
133 -->
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> や、さらに細分化された設定向けの色々なサブキーを持つことを意味します。
135 </para>
136
137 <refsect2>
138 <title><!-- Configuration -->設定</title>
139 <para>
140 <!--
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 -->
147 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。
148 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。
149 その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。
150 </para>
151
152 <variablelist>
153 <varlistentry>
154 <term>
155 <option>lxc.include</option>
156 </term>
157 <listitem>
158 <para>
159 <!--
160 Specify the file to be included. The included file must be
161 in the same valid lxc configuration file format.
162 -->
163 include させたいファイルを指定します。
164 include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。
165 </para>
166 </listitem>
167 </varlistentry>
168 </variablelist>
169 </refsect2>
170
171 <refsect2>
172 <title><!-- Architecture -->アーキテクチャ</title>
173 <para>
174 <!--
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.
179 -->
180 コンテナに対してアーキテクチャを設定することが可能です。
181 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。
182 この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。
183 </para>
184
185 <variablelist>
186 <varlistentry>
187 <term>
188 <option>lxc.arch</option>
189 </term>
190 <listitem>
191 <para>
192 <!--
193 Specify the architecture for the container.
194 -->
195 コンテナに設定するアーキテクチャを指定します。
196 </para>
197 <para>
198 <!--
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>
213 </variablelist>
214
215 </refsect2>
216
217 <refsect2>
218 <title><!-- Hostname -->ホスト名</title>
219 <para>
220 <!--
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.
224 -->
225 utsname セクションは、コンテナに設定されるホスト名を定義します。
226 コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。
227 このことにより、ホスト名はコンテナ専用となります。
228 </para>
229 <variablelist>
230 <varlistentry>
231 <term>
232 <option>lxc.uts.name</option>
233 </term>
234 <listitem>
235 <para>
236 <!--
237 specify the hostname for the container
238 -->
239 コンテナのホスト名を指定します。
240 </para>
241 </listitem>
242 </varlistentry>
243 </variablelist>
244 </refsect2>
245
246 <refsect2>
247 <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title>
248 <para>
249 <!--
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.
256 -->
257 コンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定できます。init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。このオプションではシグナルとして kill(1) で使う形式を指定できます。
258 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。
259 </para>
260 <variablelist>
261 <varlistentry>
262 <term>
263 <option>lxc.signal.halt</option>
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 <!--
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.
285 -->
286 コンテナをリブートするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
287 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGINT です。
288 </para>
289 <variablelist>
290 <varlistentry>
291 <term>
292 <option>lxc.signal.reboot</option>
293 </term>
294 <listitem>
295 <para>
296 <!--
297 specify the signal used to reboot the container
298 -->
299 コンテナをリブートするために使うシグナルを指定します。
300 </para>
301 </listitem>
302 </varlistentry>
303 </variablelist>
304 </refsect2>
305
306 <refsect2>
307 <title><!-- Stop signal -->強制停止時のシグナル</title>
308 <para>
309 <!--
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.
314 -->
315 コンテナを強制的にシャットダウンするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
316 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。
317 </para>
318 <variablelist>
319 <varlistentry>
320 <term>
321 <option>lxc.signal.stop</option>
322 </term>
323 <listitem>
324 <para>
325 <!--
326 specify the signal used to stop the container
327 -->
328 コンテナを停止するのに使用するシグナルを指定します。
329 </para>
330 </listitem>
331 </varlistentry>
332 </variablelist>
333 </refsect2>
334
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>
352 <option>lxc.init.cmd</option>
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
366 <refsect2>
367 <title><!-- Init ID -->Init が使う ID</title>
368 <para>
369 <!--
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.
374
375 Defaults to: UID(0), GID(0)
376 -->
377 init と後続のコマンドが使う UID/GID を設定します。システムコンテナを起動するのに非 root な UID を使うと、特権がないために動作しないでしょう。UID/GID の指定は、通常はアプリケーションコンテナの動作の際に役に立ちます。
378
379 デフォルト値: UID(0)、GID(0)
380 </para>
381 <variablelist>
382 <varlistentry>
383 <term>
384 <option>lxc.init.uid</option>
385 </term>
386 <listitem>
387 <para>
388 <!--
389 UID to use for init.
390 -->
391 init が使う UID です。
392 </para>
393 </listitem>
394 </varlistentry>
395 <varlistentry>
396 <term>
397 <option>lxc.init.gid</option>
398 </term>
399 <listitem>
400 <para>
401 <!--
402 GID to use for init.
403 -->
404 init が使う GID です。
405 </para>
406 </listitem>
407 </varlistentry>
408 </variablelist>
409 </refsect2>
410
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
437 <refsect2>
438 <title><!-- Network -->ネットワーク</title>
439 <para>
440 <!--
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.
448 -->
449 ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。
450 ネットワークの仮想化はレイヤー 2 で作動します。
451 ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。
452 いくつかの仮想インターフェースをアサインすることができます。
453 そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。
454 </para>
455 <variablelist>
456 <varlistentry>
457 <term>
458 <option>lxc.net</option>
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>
469 <varlistentry>
470 <term>
471 <option>lxc.net.[i].type</option>
472 </term>
473 <listitem>
474 <para>
475 <!--
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>
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
483 networks of the same type. All keys sharing the same index
484 <option>i</option> will be treated as belonging to the same
485 network. For example, <option>lxc.net.0.link = br0</option>
486 will belong to <option>lxc.net.0.type</option>.
487 Currently, the different virtualization types can be:
488 -->
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> と同じネットワークの設定になります。
491 現時点では、以下のネットワーク仮想化のタイプが使えます:
492 </para>
493
494 <para>
495 <!--
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.
502 -->
503 <option>none:</option> ホストのネットワーク名前空間を共有します。
504 これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。
505 もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。
506 </para>
507
508 <para>
509 <!--
510 <option>empty:</option> will create only the loopback
511 interface.
512 -->
513 <option>empty:</option> ループバックインターフェースだけを作成します。
514 </para>
515
516 <para>
517 <!--
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
521 the <option>lxc.net.[i].link</option> option.
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
533 the <option>lxc.net.[i].veth.pair</option> option (except for
534 unprivileged containers where this option is ignored for security
535 reasons).
536 -->
537 <option>veth:</option > 一方がコンテナに、もう一方が <option>lxc.net.[i].link</option> オプションで指定されたブリッジに接続されるペアの仮想イーサネットデバイスを作成します。
538 もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。
539 ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。
540 <command>lxc</command> はコンテナ外の設定を扱うことはありません。
541 デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。
542 しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。
543 </para>
544
545 <para>
546 <!--
547 <option>vlan:</option> a vlan interface is linked with
548 the interface specified by
549 the <option>lxc.net.[i].link</option> and assigned to
550 the container. The vlan identifier is specified with the
551 option <option>lxc.net.[i].vlan.id</option>.
552 -->
553 <option>vlan:</option> vlan インターフェースは <option>lxc.net.[i].link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。
554 vlan の指定は <option>lxc.net.[i].vlan.id</option> オプションで指定します。
555 </para>
556
557 <para>
558 <!--
559 <option>macvlan:</option> a macvlan interface is linked
560 with the interface specified by
561 the <option>lxc.net.[i].link</option> and assigned to
562 the container.
563 <option>lxc.net.[i].macvlan.mode</option> specifies the
564 mode the macvlan will use to communicate between
565 different macvlan on the same upper device. The accepted
566 modes are <option>private</option>, <option>vepa</option>,
567 <option>bridge</option> and <option>passthru</option>.
568 In <option>private</option> mode, the device never
569 communicates with any other device on the same upper_dev (default).
570 In <option>vepa</option> mode, the new Virtual Ethernet Port
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
577 delivered locally. In <option>bridge</option> mode, it
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
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.
591 -->
592 <option>macvlan:</option> macvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
593 <option>lxc.net.[i].macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan の間の通信をする時に使います。
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 ポートに対してローカルであるフレームを全て返すと仮定します。
597 すなわち、ブリッジが reflective relay として設定されているということです。
598 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。
599 ローカルのフレームはローカルには配送されません。
600 <option>bridge</option> モードの場合、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。
601 あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。
602 ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。
603 しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。
604 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。
605 <option>passthru</option> モードの場合、物理インターフェースで受け取った全てのフレームは macvlan インターフェースに転送されます。<option>passthru</option> モードの場合、ひとつの macvlan インターフェースだけが、ひとつの物理インターフェースに対して設定できます。
606 </para>
607
608 <para>
609 <!--
610 <option>phys:</option> an already existing interface
611 specified by the <option>lxc.net.[i].link</option> is
612 assigned to the container.
613 -->
614 <option>phys:</option> <option>lxc.net.[i].link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。
615 </para>
616 </listitem>
617 </varlistentry>
618
619 <varlistentry>
620 <term>
621 <option>lxc.net.[i].flags</option>
622 </term>
623 <listitem>
624 <para>
625 <!--
626 Specify an action to do for the network.
627 -->
628 ネットワークに対して行うアクションを指定します。
629 </para>
630
631 <para>
632 <!--
633 <option>up:</option> activates the interface.
634 -->
635 <option>up:</option> インターフェースを起動させます。
636 </para>
637 </listitem>
638 </varlistentry>
639
640 <varlistentry>
641 <term>
642 <option>lxc.net.[i].link</option>
643 </term>
644 <listitem>
645 <para>
646 <!--
647 Specify the interface to be used for real network traffic.
648 -->
649 実際のネットワークトラフィックに使うインターフェースを指定します。
650 </para>
651 </listitem>
652 </varlistentry>
653
654 <varlistentry>
655 <term>
656 <option>lxc.net.[i].mtu</option>
657 </term>
658 <listitem>
659 <para>
660 <!--
661 Specify the maximum transfer unit for this interface.
662 -->
663 インターフェースに対する MTU を指定します。
664 </para>
665 </listitem>
666 </varlistentry>
667
668 <varlistentry>
669 <term>
670 <option>lxc.net.[i].name</option>
671 </term>
672 <listitem>
673 <para>
674 <!--
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.
679 -->
680 インターフェース名は動的に割り当てられます。しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。
681 </para>
682 </listitem>
683 </varlistentry>
684
685 <varlistentry>
686 <term>
687 <option>lxc.net.[i].hwaddr</option>
688 </term>
689 <listitem>
690 <para>
691 <!--
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 を設定することが可能になります。
699 </para>
700 </listitem>
701 </varlistentry>
702
703 <varlistentry>
704 <term>
705 <option>lxc.net.[i].ipv4.address</option>
706 </term>
707 <listitem>
708 <para>
709 <!--
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
715 </para>
716 </listitem>
717 </varlistentry>
718
719 <varlistentry>
720 <term>
721 <option>lxc.net.[i].ipv4.gateway</option>
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
732 <option>lxc.net.[i].link</option> option) and use that as
733 the gateway. <option>auto</option> is only available when
734 using the <option>veth</option> and
735 <option>macvlan</option> network types.
736 -->
737 コンテナでゲートウェイとして使う IPv4 アドレスを指定します。アドレスは x.y.z.t というフォーマットです。例) 192.168.1.123
738 <option>auto</option> という特別な値を指定できます。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。
739 </para>
740 </listitem>
741 </varlistentry>
742
743
744 <varlistentry>
745 <term>
746 <option>lxc.net.[i].ipv6.address</option>
747 </term>
748 <listitem>
749 <para>
750 <!--
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
755 -->
756 仮想インターフェースに割り当てる ipv6 アドレスを指定します。複数行により複数の ipv6 アドレスを指定します。このアドレスは x::y/m というフォーマットで指定します。例) 2003:db8:1:0:214:1234:fe0b:3596/64
757 </para>
758 </listitem>
759 </varlistentry>
760
761 <varlistentry>
762 <term>
763 <option>lxc.net.[i].ipv6.gateway</option>
764 </term>
765 <listitem>
766 <para>
767 <!--
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
770
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
774 <option>lxc.net.[i].link</option> option) and use that as
775 the gateway. <option>auto</option> is only available when
776 using the <option>veth</option> and
777 <option>macvlan</option> network types.
778 -->
779 コンテナでゲートウェイとして使う IPv6 アドレスを指定します。アドレスは x::y というフォーマットです。例) 2003:db8:1:0::1
780 <option>auto</option> という特別な値を記述する事も可能です。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。
781 </para>
782 </listitem>
783 </varlistentry>
784
785 <varlistentry>
786 <term>
787 <option>lxc.net.[i].script.up</option>
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.
802 -->
803 ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。
804 その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)
805 ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名
806 </para>
807 <para>
808 <!--
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.
812 -->
813 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
814 </para>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry>
819 <term>
820 <option>lxc.net.[i].script.down</option>
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.
835 -->
836 ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。
837 その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)。
838 ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys。そして最後に (ホスト側の) デバイス名が渡されます。
839 </para>
840 <para>
841 <!--
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.
845 -->
846 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
847 </para>
848 </listitem>
849 </varlistentry>
850 </variablelist>
851
852 </refsect2>
853
854 <refsect2>
855 <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title>
856 <para>
857 <!--
858 For stricter isolation the container can have its own private
859 instance of the pseudo tty.
860 -->
861 さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。
862 </para>
863 <variablelist>
864 <varlistentry>
865 <term>
866 <option>lxc.pty.max</option>
867 </term>
868 <listitem>
869 <para>
870 <!--
871 If set, the container will have a new pseudo tty
872 instance, making this private to it. The value specifies
873 the maximum number of pseudo ttys allowed for a pts
874 instance (this limitation is not implemented yet).
875 -->
876 もし設定された場合、コンテナは新しい pseudo tty インスタンスを持ち、それを自身のプライベートとします。
877 この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。
878 </para>
879 </listitem>
880 </varlistentry>
881 </variablelist>
882 </refsect2>
883
884 <refsect2>
885 <title><!-- Container system console -->コンテナのシステムコンソール</title>
886 <para>
887 <!--
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.
891 -->
892 コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。
893 </para>
894 <variablelist>
895 <varlistentry>
896 <term>
897 <option>lxc.console.logfile</option>
898 </term>
899 <listitem>
900 <para>
901 <!--
902 Specify a path to a file where the console output will
903 be written.
904 -->
905 コンソール出力を書き込むファイルのパスを指定します。
906 </para>
907 </listitem>
908 </varlistentry>
909 <varlistentry>
910 <term>
911 <option>lxc.console.path</option>
912 </term>
913 <listitem>
914 <para>
915 <!--
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 -->
925 コンソールを割り当てるデバイスのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。
926 'none' を指定し、コンテナ内のコンソールに対するデバイスノードを /dev/console に作成するか、もしくはホストの /dev/console をコンテナ内の /dev/console に bind mount する場合、そのコンテナはホストの /dev/console へ直接アクセスを行うことに注意が必要です。
927 そのコンテナがデバイスへの書き込み権を持っている場合は危険ですので、注意してこの指定を使用する必要があります。
928 </para>
929 </listitem>
930 </varlistentry>
931 </variablelist>
932 </refsect2>
933
934 <refsect2>
935 <title><!-- Console through the ttys -->tty を通したコンソール</title>
936 <para>
937 <!--
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>.
946 -->
947 このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。
948 このオプションはコンテナで利用できる tty の数を指定します。
949 inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。
950 さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。
951 </para>
952 <variablelist>
953 <varlistentry>
954 <term>
955 <option>lxc.tty.max</option>
956 </term>
957 <listitem>
958 <para>
959 <!--
960 Specify the number of tty to make available to the
961 container.
962 -->
963 コンテナに作成出来る tty の数を指定します。
964 </para>
965 </listitem>
966 </varlistentry>
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
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.
984 -->
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 シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。
992 </para>
993 <variablelist>
994 <varlistentry>
995 <term>
996 <option>lxc.tty.dir</option>
997 </term>
998 <listitem>
999 <para>
1000 <!--
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 -->
1006 コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。
1007 LXC は /dev/console に対する bind mount や /dev/console デバイスノードをこのディレクトリ以下に移動することに注意が必要です。
1008 </para>
1009 </listitem>
1010 </varlistentry>
1011 </variablelist>
1012 </refsect2>
1013
1014 <refsect2>
1015 <title><!-- /dev directory -->/dev ディレクトリ</title>
1016 <para>
1017 <!--
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.
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 -->
1030 デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。
1031 これは、コンテナの rootfs で必要な設定を行えるようにするものです。
1032 lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (500k 制限の)。
1033 そして初期デバイスの最小限のセットを作成します。
1034 これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。
1035 コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。
1036 </para>
1037 <variablelist>
1038 <varlistentry>
1039 <term>
1040 <option>lxc.autodev</option>
1041 </term>
1042 <listitem>
1043 <para>
1044 <!--
1045 Set this to 0 to stop LXC from mounting and populating a minimal
1046 <filename>/dev</filename> when starting the container.
1047 -->
1048 コンテナの起動時に LXC が /dev をマウントして最小限の /dev を作成するのを止めるには、この値を 0 に設定してください。
1049 </para>
1050 </listitem>
1051 </varlistentry>
1052 </variablelist>
1053 </refsect2>
1054
1055 <refsect2>
1056 <title><!-- Mount points -->マウントポイント</title>
1057 <para>
1058 <!--
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.
1064 -->
1065 マウントポイントセクションは、マウントするための区別された場所を指定します。
1066 これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。
1067 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。
1068 </para>
1069 <para>
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
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.
1081 -->
1082 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。
1083 これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。)
1084 しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。
1085 </para>
1086 <variablelist>
1087 <varlistentry>
1088 <term>
1089 <option>lxc.mount.fstab</option>
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,
1099 -->
1100 マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。
1101 マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。
1102 </para>
1103 <programlisting>
1104 proc proc proc nodev,noexec,nosuid 0 0
1105 </programlisting>
1106 <para>
1107 <!--
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.
1112 -->
1113 この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。
1114 </para>
1115 <para>
1116 <!--
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
1120 <citerefentry>
1121 <refentrytitle>mount</refentrytitle>
1122 <manvolnum>8</manvolnum>
1123 </citerefentry>
1124 but must be explicitly specified.
1125 -->
1126 ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は
1127 <citerefentry>
1128 <refentrytitle>mount</refentrytitle>
1129 <manvolnum>8</manvolnum>
1130 </citerefentry>
1131 のように auto を指定することはできず、明確に指定しなければいけません。
1132 </para>
1133 </listitem>
1134 </varlistentry>
1135
1136 <varlistentry>
1137 <term>
1138 <option>lxc.mount.entry</option>
1139 </term>
1140 <listitem>
1141 <para>
1142 <!--
1143 specify a mount point corresponding to a line in the
1144 fstab format.
1145 -->
1146 fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。
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> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。
1157 </para>
1158 </listitem>
1159 </varlistentry>
1160
1161 <varlistentry>
1162 <term>
1163 <option>lxc.mount.auto</option>
1164 </term>
1165 <listitem>
1166 <para>
1167 <!--
1168 specify which standard kernel file systems should be
1169 automatically mounted. This may dramatically simplify
1170 the configuration. The file systems are:
1171 -->
1172 標準のカーネルファイルシステムで自動的にマウントするものを指定します。
1173 これは劇的に設定を容易にする可能性があります。
1174 </para>
1175 <itemizedlist>
1176 <listitem>
1177 <!--
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>
1185 -->
1186 <para>
1187 <option>proc:mixed</option> (or <option>proc</option>):
1188 <filename>/proc</filename> を読み書き可能でマウントします。
1189 ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。
1190 </para>
1191 </listitem>
1192 <listitem>
1193 <!--
1194 <para>
1195 <option>proc:rw</option>: mount
1196 <filename>/proc</filename> as read-write
1197 </para>
1198 -->
1199 <para>
1200 <option>proc:rw</option>:
1201 <filename>/proc</filename> を読み書き可能でマウントします。
1202 </para>
1203 </listitem>
1204 <listitem>
1205 <!--
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>
1211 -->
1212 <para>
1213 <option>sys:mixed</option> (or <option>sys</option>):
1214 /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。
1215 </para>
1216 </listitem>
1217 <listitem>
1218 <!--
1219 <para>
1220 <option>sys:ro</option>
1221 mount <filename>/sys</filename> as read-only
1222 for security / container isolation purposes.
1223 </para>
1224 -->
1225 <para>
1226 <option>sys:ro</option>:
1227 <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。
1228 </para>
1229 </listitem>
1230 <listitem>
1231 <!--
1232 <para>
1233 <option>sys:rw</option>: mount
1234 <filename>/sys</filename> as read-write
1235 </para>
1236 -->
1237 <para>
1238 <option>sys:rw</option>:
1239 <filename>/sys</filename> を読み書き可能でマウントします。
1240 </para>
1241 </listitem>
1242 <listitem>
1243 <!--
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>
1255 -->
1256 <para>
1257 <option>cgroup:mixed</option>:
1258 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。
1259 コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。
1260 </para>
1261 </listitem>
1262 <listitem>
1263 <!--
1264 <para>
1265 <option>cgroup:ro</option>: similar to
1266 <option>cgroup:mixed</option>, but everything will
1267 be mounted read-only.
1268 </para>
1269 -->
1270 <para>
1271 <option>cgroup:ro</option>:
1272 <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
1273 </para>
1274 </listitem>
1275 <listitem>
1276 <!--
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>
1285 -->
1286 <para>
1287 <option>cgroup:rw</option>:
1288 <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。
1289 コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、
1290 <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。
1291 </para>
1292 </listitem>
1293 <listitem>
1294 <para>
1295 <!--
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.
1300 -->
1301 <option>cgroup</option> (マウントオプションなしの場合):
1302 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。
1303 </para>
1304 </listitem>
1305 <listitem>
1306 <!--
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>
1324 -->
1325 <para>
1326 <option>cgroup-full:mixed</option>:
1327 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。
1328 <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。
1329 これにより、コンテナにはかなりの情報が漏洩します。
1330 </para>
1331 </listitem>
1332 <listitem>
1333 <!--
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>
1339 -->
1340 <para>
1341 <option>cgroup-full:ro</option>:
1342 <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
1343 </para>
1344 </listitem>
1345 <listitem>
1346 <!--
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>
1356 -->
1357 <para>
1358 <option>cgroup-full:rw</option>:
1359 <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。
1360 この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。
1361 </para>
1362 </listitem>
1363 <listitem>
1364 <para>
1365 <!--
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.
1370 -->
1371 <option>cgroup-full</option> (マウントオプションなしの場合):
1372 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。
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>
1398 <manvolnum>8</manvolnum>
1399 </citerefentry>
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.
1405 -->
1406 cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の
1407 <citerefentry>
1408 <refentrytitle>mountall</refentrytitle>
1409 <manvolnum>8</manvolnum>
1410 </citerefentry>
1411 コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。
1412 </para>
1413 <para>
1414 <!--
1415 Examples:
1416 -->
1417 例:
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>
1425
1426 </variablelist>
1427 </refsect2>
1428
1429 <refsect2>
1430 <title><!-- Root file system -->ルートファイルシステム</title>
1431 <para>
1432 <!--
1433 The root file system of the container can be different than that
1434 of the host system.
1435 -->
1436 コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。
1437 </para>
1438 <variablelist>
1439 <varlistentry>
1440 <term>
1441 <option>lxc.rootfs.path</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.
1450 -->
1451 コンテナのルートファイルシステムを指定します。
1452 この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。
1453 もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。
1454 </para>
1455 <para>
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
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
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> というディレクトリを読み書き可能で重ね合わせてマウントします。
1476 <filename>aufs:/lower:/upper</filename> は overlayfs で指定している部分を aufs と指定すれば同じことになります。<filename>overlayfs</filename> と <filename>aufs</filename> は両方とも、複数の <filename>/lower</filename> ディレクトリを指定できます。
1477 <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。
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.path</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.
1497 -->
1498 root ファイルシステムの変更の前に、<option>lxc.rootfs.path</option> を再帰的にどこにバインドするのかを指定します。これは
1499 <citerefentry>
1500 <refentrytitle><command>pivot_root</command></refentrytitle>
1501 <manvolnum>8</manvolnum>
1502 </citerefentry>
1503 システムコールが確実に成功する事を保証します。
1504 どんなディレクトリでも良く、デフォルトでも通常は動くはずです。
1505 </para>
1506 </listitem>
1507 </varlistentry>
1508
1509 <varlistentry>
1510 <term>
1511 <option>lxc.rootfs.options</option>
1512 </term>
1513 <listitem>
1514 <para>
1515 <!--
1516 extra mount options to use when mounting the rootfs.
1517 -->
1518 rootfs をマウントするときに追加したいマウントオプション。
1519 </para>
1520 </listitem>
1521 </varlistentry>
1522
1523 </variablelist>
1524 </refsect2>
1525
1526 <refsect2>
1527 <title>Control group</title>
1528 <para>
1529 <!--
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.
1536 -->
1537 CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。
1538 <command>lxc</command> は、このサブシステム名の正しさはチェックしません。
1539 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。
1540 </para>
1541 <variablelist>
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>
1556 -->
1557 設定する control group の値を指定します。
1558 サブシステム名は、control group のそのままの名前です。
1559 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
1560 例えば <option>lxc.cgroup.cpuset.cpus</option>
1561 </para>
1562 </listitem>
1563 </varlistentry>
1564 <varlistentry>
1565 <term>
1566 <option>lxc.cgroup.dir</option>
1567 </term>
1568 <listitem>
1569 <para>
1570 <!--
1571 specify a directory or path in which the container's cgroup will
1572 be created. For example, setting
1573 <option>lxc.cgroup.dir = my-cgroup/first</option> for a container
1574 named "c1" will create the container's cgroup as a sub-cgroup of
1575 "my-cgroup". For example, if the user's current cgroup "my-user"
1576 is located in the root cgroup of the cpuset controllerin in a
1577 cgroup v1 hierarchy this would create the cgroup
1578 "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
1579 container. Any missing cgroups will be created by LXC. This
1580 presupposes that the user has write access to its current cgroup.
1581 -->
1582 コンテナの cgroup を作成するパスやディレクトリを指定します。
1583 例えば、"c1" という名前のコンテナで <option>lxc.cgroup.dir = my-cgroup/first</option> のように設定すると、"my-cgroup" のサブ cgroup のようにコンテナの cgroup を作成します。
1584 例えば、ユーザのカレントの cgroup である "my-user" が cgroup v1 階層にある cpuset コントローラの root cgroup 内に存在する場合、この設定は "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" という cgroup をこのコンテナ向けに作成します。
1585 存在しない cgroup は LXC が作成しますが、ユーザがカレントの cgroup に書き込み権を持っていることが前提となります。
1586 </para>
1587 </listitem>
1588 </varlistentry>
1589 </variablelist>
1590 </refsect2>
1591
1592 <refsect2>
1593 <title><!-- Capabilities -->ケーパビリティ</title>
1594 <para>
1595 <!--
1596 The capabilities can be dropped in the container if this one
1597 is run as root.
1598 -->
1599 コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。
1600 </para>
1601 <variablelist>
1602 <varlistentry>
1603 <term>
1604 <option>lxc.cap.drop</option>
1605 </term>
1606 <listitem>
1607 <para>
1608 <!--
1609 Specify the capability to be dropped in the container. A
1610 single line defining several capabilities with a space
1611 separation is allowed. The format is the lower case of
1612 the capability definition without the "CAP_" prefix,
1613 eg. CAP_SYS_MODULE should be specified as
1614 sys_module. See
1615 <citerefentry>
1616 <refentrytitle><command>capabilities</command></refentrytitle>
1617 <manvolnum>7</manvolnum>
1618 </citerefentry>,
1619 If used with no value, lxc will clear any drop capabilities
1620 specified up to this point.
1621 -->
1622 コンテナ内で削除するケーパビリティ (capability) を指定します。
1623 一行でスペース区切りで複数のケーパビリティを指定することも可能です。
1624 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。
1625 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。
1626 詳しくは以下を参照してください。
1627 <citerefentry>
1628 <refentrytitle><command>capabilities</command></refentrytitle>
1629 <manvolnum>7</manvolnum>
1630 </citerefentry>
1631 この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。
1632 </para>
1633 </listitem>
1634 </varlistentry>
1635 <varlistentry>
1636 <term>
1637 <option>lxc.cap.keep</option>
1638 </term>
1639 <listitem>
1640 <para>
1641 <!--
1642 Specify the capability to be kept in the container. All other
1643 capabilities will be dropped. When a special value of "none" is
1644 encountered, lxc will clear any keep capabilities specified up
1645 to this point. A value of "none" alone can be used to drop all
1646 capabilities.
1647 -->
1648 コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。
1649 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。
1650 </para>
1651 </listitem>
1652 </varlistentry>
1653 </variablelist>
1654 </refsect2>
1655
1656 <refsect2>
1657 <title>リソース制限 <!-- Resource limits --></title>
1658 <para>
1659 <!--
1660 The soft and hard resource limits for the container can be changed.
1661 Unprivileged containers can only lower them. Resources which are not
1662 explicitly specified will be inherited.
1663 -->
1664 コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。
1665 </para>
1666 <variablelist>
1667 <varlistentry>
1668 <term>
1669 <option>lxc.prlimit.[limit name]</option>
1670 </term>
1671 <listitem>
1672 <para>
1673 <!--
1674 Specify the resource limit to be set. A limit is specified as two
1675 colon separated values which are either numeric or the word
1676 'unlimited'. A single value can be used as a shortcut to set both
1677 soft and hard limit to the same value. The permitted names the
1678 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
1679 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
1680 <citerefentry>
1681 <refentrytitle><command>setrlimit</command></refentrytitle>
1682 <manvolnum>2</manvolnum>
1683 </citerefentry>.
1684 If used with no value, lxc will clear the resource limit
1685 specified up to this point. A resource with no explicitly
1686 configured limitation will be inherited from the process starting
1687 up the container.
1688 -->
1689 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは
1690 <citerefentry>
1691 <refentrytitle><command>setrlimit</command></refentrytitle>
1692 <manvolnum>2</manvolnum>
1693 </citerefentry> を参照してください。
1694 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。
1695 </para>
1696 </listitem>
1697 </varlistentry>
1698 </variablelist>
1699 </refsect2>
1700
1701 <refsect2>
1702 <title><!-- Apparmor profile -->Apparmor プロファイル</title>
1703 <para>
1704 <!--
1705 If lxc was compiled and installed with apparmor support, and the host
1706 system has apparmor enabled, then the apparmor profile under which the
1707 container should be run can be specified in the container
1708 configuration. The default is <command>lxc-container-default-cgns</command>
1709 if the host kernel is cgroup namespace aware, or
1710 <command>lxc-container-default</command> othewise.
1711 -->
1712 lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。
1713 デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。
1714 </para>
1715 <variablelist>
1716 <varlistentry>
1717 <term>
1718 <option>lxc.apparmor.profile</option>
1719 </term>
1720 <listitem>
1721 <para>
1722 <!--
1723 Specify the apparmor profile under which the container should
1724 be run. To specify that the container should be unconfined,
1725 use
1726 -->
1727 コンテナが従うべき apparmor プロファイルを指定します。
1728 コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。
1729 </para>
1730 <programlisting>lxc.apparmor.profile = unconfined</programlisting>
1731 <para>
1732 <!--
1733 If the apparmor profile should remain unchanged (i.e. if you
1734 are nesting containers and are already confined), then use
1735 -->
1736 もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。
1737 </para>
1738 <programlisting>lxc.apparmor.profile = unchanged</programlisting>
1739 </listitem>
1740 </varlistentry>
1741 <varlistentry>
1742 <term>
1743 <option>lxc.apparmor.allow_incomplete</option>
1744 </term>
1745 <listitem>
1746 <para>
1747 <!--
1748 Apparmor profiles are pathname based. Therefore many file
1749 restrictions require mount restrictions to be effective against
1750 a determined attacker. However, these mount restrictions are not
1751 yet implemented in the upstream kernel. Without the mount
1752 restrictions, the apparmor profiles still protect against accidental
1753 damager.
1754 -->
1755 apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。
1756 しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。
1757 </para>
1758 <para>
1759 <!--
1760 If this flag is 0 (default), then the container will not be
1761 started if the kernel lacks the apparmor mount features, so that a
1762 regression after a kernel upgrade will be detected. To start the
1763 container under partial apparmor protection, set this flag to 1.
1764 -->
1765 このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。
1766 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。
1767 </para>
1768 </listitem>
1769 </varlistentry>
1770 </variablelist>
1771 </refsect2>
1772
1773 <refsect2>
1774 <title><!-- SELinux context -->SELinux コンテキスト</title>
1775 <para>
1776 <!--
1777 If lxc was compiled and installed with SELinux support, and the host
1778 system has SELinux enabled, then the SELinux context under which the
1779 container should be run can be specified in the container
1780 configuration. The default is <command>unconfined_t</command>,
1781 which means that lxc will not attempt to change contexts.
1782 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
1783 information.
1784 -->
1785 lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。
1786 デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。
1787 ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。
1788 </para>
1789 <variablelist>
1790 <varlistentry>
1791 <term>
1792 <option>lxc.selinux.context</option>
1793 </term>
1794 <listitem>
1795 <para>
1796 <!--
1797 Specify the SELinux context under which the container should
1798 be run or <command>unconfined_t</command>. For example
1799 -->
1800 コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。
1801 </para>
1802 <programlisting>lxc.selinux.context = system_u:system_r:lxc_t:s0:c22</programlisting>
1803 </listitem>
1804 </varlistentry>
1805 </variablelist>
1806 </refsect2>
1807
1808 <refsect2>
1809 <title><!-- Seccomp configuration -->Seccomp の設定</title>
1810 <para>
1811 <!--
1812 A container can be started with a reduced set of available
1813 system calls by loading a seccomp profile at startup. The
1814 seccomp configuration file must begin with a version number
1815 on the first line, a policy type on the second line, followed
1816 by the configuration.
1817 -->
1818 コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。
1819 seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。
1820 </para>
1821 <para>
1822 <!--
1823 Versions 1 and 2 are currently supported. In version 1, the
1824 policy is a simple whitelist. The second line therefore must
1825 read "whitelist", with the rest of the file containing one (numeric)
1826 sycall number per line. Each syscall number is whitelisted,
1827 while every unlisted number is blacklisted for use in the container
1828 -->
1829 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。
1830 そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。
1831 </para>
1832
1833 <para>
1834 <!--
1835 In version 2, the policy may be blacklist or whitelist,
1836 supports per-rule and per-policy default actions, and supports
1837 per-architecture system call resolution from textual names.
1838 -->
1839 バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。
1840 </para>
1841 <para>
1842 <!--
1843 An example blacklist policy, in which all system calls are
1844 allowed except for mknod, which will simply do nothing and
1845 return 0 (success), looks like:
1846 -->
1847 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。
1848 </para>
1849
1850 <programlisting>
1851 2
1852 blacklist
1853 mknod errno 0
1854 </programlisting>
1855
1856 <variablelist>
1857 <varlistentry>
1858 <term>
1859 <option>lxc.seccomp.profile</option>
1860 </term>
1861 <listitem>
1862 <para>
1863 <!--
1864 Specify a file containing the seccomp configuration to
1865 load before the container starts.
1866 -->
1867 コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。
1868 </para>
1869 </listitem>
1870 </varlistentry>
1871 </variablelist>
1872 </refsect2>
1873
1874 <refsect2>
1875 <title>PR_SET_NO_NEW_PRIVS</title>
1876 <para>
1877 <!--
1878 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
1879 privileges to do anything that could not have been done without
1880 the execve() call (for example, rendering the set-user-ID and
1881 set-group-ID mode bits, and file capabilities non-functional).
1882 Once set, this bit cannot be unset. The setting of this bit is
1883 inherited by children created by fork() and clone(), and preserved
1884 across execve().
1885 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
1886 changed into its intended AppArmor profile or SElinux context.
1887 -->
1888 PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。
1889 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。
1890 PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。
1891 </para>
1892 <variablelist>
1893 <varlistentry>
1894 <term>
1895 <option>lxc.no_new_privs</option>
1896 </term>
1897 <listitem>
1898 <para>
1899 <!--
1900 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
1901 container. Set to 1 to activate.
1902 -->
1903 コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。
1904 </para>
1905 </listitem>
1906 </varlistentry>
1907 </variablelist>
1908 </refsect2>
1909
1910 <refsect2>
1911 <title><!-- UID mappings -->UID のマッピング</title>
1912 <para>
1913 <!--
1914 A container can be started in a private user namespace with
1915 user and group id mappings. For instance, you can map userid
1916 0 in the container to userid 200000 on the host. The root
1917 user in the container will be privileged in the container,
1918 but unprivileged on the host. Normally a system container
1919 will want a range of ids, so you would map, for instance,
1920 user and group ids 0 through 20,000 in the container to the
1921 ids 200,000 through 220,000.
1922 -->
1923 コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。
1924 たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。
1925 コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。
1926 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。
1927 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。
1928 </para>
1929 <variablelist>
1930 <varlistentry>
1931 <term>
1932 <option>lxc.idmap</option>
1933 </term>
1934 <listitem>
1935 <para>
1936 <!--
1937 Four values must be provided. First a character, either
1938 'u', or 'g', to specify whether user or group ids are
1939 being mapped. Next is the first userid as seen in the
1940 user namespace of the container. Next is the userid as
1941 seen on the host. Finally, a range indicating the number
1942 of consecutive ids to map.
1943 -->
1944 4 つの値を記述する必要があります。
1945 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。
1946 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。
1947 その次は、そのユーザ ID のホスト上での値です。
1948 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。
1949 </para>
1950 </listitem>
1951 </varlistentry>
1952 </variablelist>
1953 </refsect2>
1954
1955 <refsect2>
1956 <title><!-- Container hooks -->コンテナのフック</title>
1957 <para>
1958 <!--
1959 Container hooks are programs or scripts which can be executed
1960 at various times in a container's lifetime.
1961 -->
1962 コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。
1963 </para>
1964 <para>
1965 <!--
1966 When a container hook is executed, information is passed both
1967 as command line arguments and through environment variables.
1968 The arguments are:
1969 <itemizedlist>
1970 <listitem><para> Container name. </para></listitem>
1971 <listitem><para> Section (always 'lxc'). </para></listitem>
1972 <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
1973 <listitem><para> Additional arguments. In the
1974 case of the clone hook, any extra arguments passed to
1975 lxc-clone will appear as further arguments to the hook.
1976 In the case of the stop hook, paths to filedescriptors
1977 for each of the container's namespaces along with their types
1978 are passed. </para></listitem>
1979 </itemizedlist>
1980 The following environment variables are set:
1981 <itemizedlist>
1982 <listitem><para> LXC_NAME: is the container's name. </para></listitem>
1983 <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
1984 <listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem>
1985 <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
1986 <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs.path entry for the container. Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem>
1987 </itemizedlist>
1988 -->
1989 コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は:
1990 <itemizedlist>
1991 <listitem><para>コンテナ名</para></listitem>
1992 <listitem><para>セクション (常に 'lxc')</para></listitem>
1993 <listitem><para>フックのタイプ ('clone' や 'pre-mount' など)</para></listitem>
1994 <listitem><para>追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。</para></listitem>
1995 </itemizedlist>
1996 以下の環境変数がセットされます。
1997 <itemizedlist>
1998 <listitem><para> LXC_NAME: コンテナ名</para></listitem>
1999 <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス</para></listitem>
2000 <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス </para></listitem>
2001 <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前</para></listitem>
2002 <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs.path エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。</para></listitem>
2003 </itemizedlist>
2004 </para>
2005 <para>
2006 <!--
2007 Standard output from the hooks is logged at debug level.
2008 Standard error is not logged, but can be captured by the
2009 hook redirecting its standard error to standard output.
2010 -->
2011 スクリプトからの標準出力は debug レベルでロギングされます。
2012 標準エラー出力はロギングされません。
2013 しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
2014 </para>
2015 <variablelist>
2016 <varlistentry>
2017 <term>
2018 <option>lxc.hook.pre-start</option>
2019 </term>
2020 <listitem>
2021 <para>
2022 <!--
2023 A hook to be run in the host's namespace before the
2024 container ttys, consoles, or mounts are up.
2025 -->
2026 コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。
2027 </para>
2028 </listitem>
2029 </varlistentry>
2030 </variablelist>
2031 <variablelist>
2032 <varlistentry>
2033 <term>
2034 <option>lxc.hook.pre-mount</option>
2035 </term>
2036 <listitem>
2037 <para>
2038 <!--
2039 A hook to be run in the container's fs namespace but before
2040 the rootfs has been set up. This allows for manipulation
2041 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
2042 done in this hook will not be reflected on the host (apart from
2043 mounts propagation), so they will be automatically cleaned up
2044 when the container shuts down.
2045 -->
2046 コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。
2047 これにより rootfs の操作が可能になります。
2048 例えば、暗号化されたファイルシステムのマウントなどです。
2049 このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。
2050 なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。
2051 </para>
2052 </listitem>
2053 </varlistentry>
2054 </variablelist>
2055 <variablelist>
2056 <varlistentry>
2057 <term>
2058 <option>lxc.hook.mount</option>
2059 </term>
2060 <listitem>
2061 <para>
2062 <!--
2063 A hook to be run in the container's namespace after
2064 mounting has been done, but before the pivot_root.
2065 -->
2066 マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。
2067 </para>
2068 </listitem>
2069 </varlistentry>
2070 </variablelist>
2071 <variablelist>
2072 <varlistentry>
2073 <term>
2074 <option>lxc.hook.autodev</option>
2075 </term>
2076 <listitem>
2077 <para>
2078 <!--
2079 A hook to be run in the container's namespace after
2080 mounting has been done and after any mount hooks have
2081 run, but before the pivot_root, if
2082 <option>lxc.autodev</option> == 1.
2083 The purpose of this hook is to assist in populating the
2084 /dev directory of the container when using the autodev
2085 option for systemd based containers. The container's /dev
2086 directory is relative to the
2087 ${<option>LXC_ROOTFS_MOUNT</option>} environment
2088 variable available when the hook is run.
2089 -->
2090 <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。
2091 このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。
2092 </para>
2093 </listitem>
2094 </varlistentry>
2095 </variablelist>
2096 <variablelist>
2097 <varlistentry>
2098 <term>
2099 <option>lxc.hook.start</option>
2100 </term>
2101 <listitem>
2102 <para>
2103 <!--
2104 A hook to be run in the container's namespace immediately
2105 before executing the container's init. This requires the
2106 program to be available in the container.
2107 -->
2108 コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。
2109 コンテナ内で利用可能なプログラムである必要があります。
2110 </para>
2111 </listitem>
2112 </varlistentry>
2113 </variablelist>
2114 <variablelist>
2115 <varlistentry>
2116 <term>
2117 <option>lxc.hook.stop</option>
2118 </term>
2119 <listitem>
2120 <para>
2121 <!--
2122 A hook to be run in the host's namespace with references
2123 to the container's namespaces after the container has been shut
2124 down. For each namespace an extra argument is passed to the hook
2125 containing the namespace's type and a filename that can be used to
2126 obtain a file descriptor to the corresponding namespace, separated
2127 by a colon. The type is the name as it would appear in the
2128 <filename>/proc/PID/ns</filename> directory.
2129 For instance for the mount namespace the argument usually looks
2130 like <filename>mnt:/proc/PID/fd/12</filename>.
2131 -->
2132 コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。
2133 それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。
2134 タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。
2135 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。
2136 </para>
2137 </listitem>
2138 </varlistentry>
2139 </variablelist>
2140 <variablelist>
2141 <varlistentry>
2142 <term>
2143 <option>lxc.hook.post-stop</option>
2144 </term>
2145 <listitem>
2146 <para>
2147 <!--
2148 A hook to be run in the host's namespace after the
2149 container has been shut down.
2150 -->
2151 コンテナがシャットダウンされた後にホストの名前空間で実行するフック。
2152 </para>
2153 </listitem>
2154 </varlistentry>
2155 </variablelist>
2156 <variablelist>
2157 <varlistentry>
2158 <term>
2159 <option>lxc.hook.clone</option>
2160 </term>
2161 <listitem>
2162 <para>
2163 <!--
2164 A hook to be run when the container is cloned to a new one.
2165 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2166 <manvolnum>1</manvolnum></citerefentry> for more information.
2167 -->
2168 コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは
2169 <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2170 <manvolnum>1</manvolnum></citerefentry>
2171 を参照してください。
2172 </para>
2173 </listitem>
2174 </varlistentry>
2175 </variablelist>
2176 <variablelist>
2177 <varlistentry>
2178 <term>
2179 <option>lxc.hook.destroy</option>
2180 </term>
2181 <listitem>
2182 <para>
2183 <!--
2184 A hook to be run when the container is destroyed.
2185 -->
2186 コンテナを破壊する際に実行されるフックです。
2187 </para>
2188 </listitem>
2189 </varlistentry>
2190 </variablelist>
2191 </refsect2>
2192
2193 <refsect2>
2194 <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title>
2195 <para>
2196 <!--
2197 A number of environment variables are made available to the startup
2198 hooks to provide configuration information and assist in the
2199 functioning of the hooks. Not all variables are valid in all
2200 contexts. In particular, all paths are relative to the host system
2201 and, as such, not valid during the <option>lxc.hook.start</option> hook.
2202 -->
2203 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。
2204 全ての変数が全てのコンテキストで利用可能なわけではありません。
2205 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。
2206 </para>
2207 <variablelist>
2208 <varlistentry>
2209 <term>
2210 <option>LXC_NAME</option>
2211 </term>
2212 <listitem>
2213 <para>
2214 <!--
2215 The LXC name of the container. Useful for logging messages
2216 in common log environments. [<option>-n</option>]
2217 -->
2218 LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>]
2219 </para>
2220 </listitem>
2221 </varlistentry>
2222 </variablelist>
2223 <variablelist>
2224 <varlistentry>
2225 <term>
2226 <option>LXC_CONFIG_FILE</option>
2227 </term>
2228 <listitem>
2229 <para>
2230 <!--
2231 Host relative path to the container configuration file. This
2232 gives the container to reference the original, top level,
2233 configuration file for the container in order to locate any
2234 additional configuration information not otherwise made
2235 available. [<option>-f</option>]
2236 -->
2237 コンテナの設定ファイルのホスト上でのパス。
2238 これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>]
2239 </para>
2240 </listitem>
2241 </varlistentry>
2242 </variablelist>
2243 <variablelist>
2244 <varlistentry>
2245 <term>
2246 <option>LXC_CONSOLE</option>
2247 </term>
2248 <listitem>
2249 <para>
2250 <!--
2251 The path to the console output of the container if not NULL.
2252 [<option>-c</option>] [<option>lxc.console.path</option>]
2253 -->
2254 設定されている場合のコンテナのコンソール出力のパス。
2255 [<option>-c</option>] [<option>lxc.console.path</option>]
2256 </para>
2257 </listitem>
2258 </varlistentry>
2259 </variablelist>
2260 <variablelist>
2261 <varlistentry>
2262 <term>
2263 <option>LXC_CONSOLE_LOGPATH</option>
2264 </term>
2265 <listitem>
2266 <para>
2267 <!--
2268 The path to the console log output of the container if not NULL.
2269 [<option>-L</option>]
2270 -->
2271 設定されている場合のコンテナのコンソールログ出力のパス。
2272 [<option>-L</option>]
2273 </para>
2274 </listitem>
2275 </varlistentry>
2276 </variablelist>
2277 <variablelist>
2278 <varlistentry>
2279 <term>
2280 <option>LXC_ROOTFS_MOUNT</option>
2281 </term>
2282 <listitem>
2283 <para>
2284 <!--
2285 The mount location to which the container is initially bound.
2286 This will be the host relative path to the container rootfs
2287 for the container instance being started and is where changes
2288 should be made for that instance.
2289 [<option>lxc.rootfs.mount</option>]
2290 -->
2291 初期にコンテナがマウントされる場所。
2292 これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。
2293 [<option>lxc.rootfs.mount</option>]
2294 </para>
2295 </listitem>
2296 </varlistentry>
2297 </variablelist>
2298 <variablelist>
2299 <varlistentry>
2300 <term>
2301 <option>LXC_ROOTFS_PATH</option>
2302 </term>
2303 <listitem>
2304 <para>
2305 <!--
2306 The host relative path to the container root which has been
2307 mounted to the rootfs.mount location.
2308 [<option>lxc.rootfs.path</option>]
2309 -->
2310 rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。
2311 [<option>lxc.rootfs.path</option>]
2312 </para>
2313 </listitem>
2314 </varlistentry>
2315 </variablelist>
2316 <variablelist>
2317 <varlistentry>
2318 <term>
2319 <option>LXC_SRC_NAME</option>
2320 </term>
2321 <listitem>
2322 <para>
2323 <!--
2324 Only for the clone hook. Is set to the original container name.
2325 -->
2326 clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。
2327 </para>
2328 </listitem>
2329 </varlistentry>
2330 </variablelist>
2331 <variablelist>
2332 <varlistentry>
2333 <term>
2334 <option>LXC_TARGET</option>
2335 </term>
2336 <listitem>
2337 <para>
2338 <!--
2339 Only for the stop hook. Is set to "stop" for a container
2340 shutdown or "reboot" for a container reboot.
2341 -->
2342 stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。
2343 </para>
2344 </listitem>
2345 </varlistentry>
2346 </variablelist>
2347 <variablelist>
2348 <varlistentry>
2349 <term>
2350 <option>LXC_CGNS_AWARE</option>
2351 </term>
2352 <listitem>
2353 <para>
2354 <!--
2355 If unset, then this version of lxc is not aware of cgroup
2356 namespaces. If set, it will be set to 1, and lxc is aware
2357 of cgroup namespaces. Note this does not guarantee that
2358 cgroup namespaces are enabled in the kernel. This is used
2359 by the lxcfs mount hook.
2360 -->
2361 この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。
2362 この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。
2363 </para>
2364 </listitem>
2365 </varlistentry>
2366 </variablelist>
2367 </refsect2>
2368
2369 <refsect2>
2370 <title><!-- Logging -->ロギング</title>
2371 <para>
2372 <!--
2373 Logging can be configured on a per-container basis. By default,
2374 depending upon how the lxc package was compiled, container startup
2375 is logged only at the ERROR level, and logged to a file named after
2376 the container (with '.log' appended) either under the container path,
2377 or under @LOGPATH@.
2378 -->
2379 ロギングはコンテナごとに設定することが可能です。
2380 デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。
2381 </para>
2382 <para>
2383 <!--
2384 Both the default log level and the log file can be specified in the
2385 container configuration file, overriding the default behavior. Note
2386 that the configuration file entries can in turn be overridden by the
2387 command line options to <command>lxc-start</command>.
2388 -->
2389 デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。
2390 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。
2391 </para>
2392 <variablelist>
2393 <varlistentry>
2394 <term>
2395 <option>lxc.log.level</option>
2396 </term>
2397 <listitem>
2398 <para>
2399 <!--
2400 The level at which to log. The log level is an integer in
2401 the range of 0..8 inclusive, where a lower number means more
2402 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
2403 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
2404 alert, and 8 = fatal. If unspecified, the level defaults
2405 to 5 (error), so that only errors and above are logged.
2406 -->
2407 ログを取得するレベル。
2408 ログレベルは 0..8 の範囲の整数です。
2409 数字が小さいほど冗長なデバッグを意味します。
2410 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。
2411 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。
2412 </para>
2413 <para>
2414 <!--
2415 Note that when a script (such as either a hook script or a
2416 network interface up or down script) is called, the script's
2417 standard output is logged at level 1, debug.
2418 -->
2419 (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。
2420 </para>
2421 </listitem>
2422 </varlistentry>
2423 <varlistentry>
2424 <term>
2425 <option>lxc.log</option>
2426 </term>
2427 <listitem>
2428 <para>
2429 <!--
2430 The file to which logging info should be written.
2431 -->
2432 ログ情報を書き込むファイル。
2433 </para>
2434 </listitem>
2435 </varlistentry>
2436 <varlistentry>
2437 <term>
2438 <option>lxc.log.syslog</option>
2439 </term>
2440 <listitem>
2441 <para>
2442 <!--
2443 Send logging info to syslog. It respects the log level defined in
2444 <command>lxc.log.level</command>. The argument should be the syslog
2445 facility to use, valid ones are: daemon, local0, local1, local2,
2446 local3, local4, local5, local5, local7.
2447 -->
2448 ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
2449 </para>
2450 </listitem>
2451 </varlistentry>
2452 </variablelist>
2453 </refsect2>
2454
2455 <refsect2>
2456 <title><!-- Autostart -->自動起動</title>
2457 <para>
2458 <!--
2459 The autostart options support marking which containers should be
2460 auto-started and in what order. These options may be used by LXC tools
2461 directly or by external tooling provided by the distributions.
2462 -->
2463 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。
2464 このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。
2465 </para>
2466
2467 <variablelist>
2468 <varlistentry>
2469 <term>
2470 <option>lxc.start.auto</option>
2471 </term>
2472 <listitem>
2473 <para>
2474 <!--
2475 Whether the container should be auto-started.
2476 Valid values are 0 (off) and 1 (on).
2477 -->
2478 コンテナを自動起動させるかどうかを設定します。
2479 有効な値は 0(オフ) か 1(オン) です。
2480 </para>
2481 </listitem>
2482 </varlistentry>
2483 <varlistentry>
2484 <term>
2485 <option>lxc.start.delay</option>
2486 </term>
2487 <listitem>
2488 <para>
2489 <!--
2490 How long to wait (in seconds) after the container is
2491 started before starting the next one.
2492 -->
2493 コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。
2494 </para>
2495 </listitem>
2496 </varlistentry>
2497 <varlistentry>
2498 <term>
2499 <option>lxc.start.order</option>
2500 </term>
2501 <listitem>
2502 <para>
2503 <!--
2504 An integer used to sort the containers when auto-starting
2505 a series of containers at once.
2506 -->
2507 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。
2508 </para>
2509 </listitem>
2510 </varlistentry>
2511 <varlistentry>
2512 <term>
2513 <option>lxc.monitor.unshare</option>
2514 </term>
2515 <listitem>
2516 <para>
2517 <!--
2518 If not zero the mount namespace will be unshared from the host
2519 before initializing the container (before running any pre-start
2520 hooks). This requires the CAP_SYS_ADMIN capability at startup.
2521 Default is 0.
2522 -->
2523 この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。
2524 </para>
2525 </listitem>
2526 </varlistentry>
2527 <varlistentry>
2528 <term>
2529 <option>lxc.group</option>
2530 </term>
2531 <listitem>
2532 <para>
2533 <!--
2534 A multi-value key (can be used multiple times) to put the
2535 container in a container group. Those groups can then be
2536 used (amongst other things) to start a series of related
2537 containers.
2538 -->
2539 コンテナを追加したいコンテナグループ名を指定します。
2540 複数の値を設定でき、複数回指定することもできます。
2541 設定されたグループは、関連する一連のコンテナを起動させるために使われます。
2542 </para>
2543 </listitem>
2544 </varlistentry>
2545 </variablelist>
2546 </refsect2>
2547
2548 <refsect2>
2549 <title><!-- Autostart and System Boot -->自動起動とシステムブート</title>
2550 <para>
2551 <!--
2552 Each container can be part of any number of groups or no group at all.
2553 Two groups are special. One is the NULL group, i.e. the container does
2554 not belong to any group. The other group is the "onboot" group.
2555 -->
2556 コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。
2557 </para>
2558
2559 <para>
2560 <!--
2561 When the system boots with the LXC service enabled, it will first
2562 attempt to boot any containers with lxc.start.auto == 1 that is a member
2563 of the "onboot" group. The startup will be in order of lxc.start.order.
2564 If an lxc.start.delay has been specified, that delay will be honored
2565 before attempting to start the next container to give the current
2566 container time to begin initialization and reduce overloading the host
2567 system. After starting the members of the "onboot" group, the LXC system
2568 will proceed to boot containers with lxc.start.auto == 1 which are not
2569 members of any group (the NULL group) and proceed as with the onboot
2570 group.
2571 -->
2572 LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。
2573 lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。
2574 "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。
2575 </para>
2576
2577 </refsect2>
2578
2579 <refsect2>
2580 <title><!-- Container Environment -->コンテナの環境変数</title>
2581 <para>
2582 <!--
2583 If you want to pass environment variables into the container (that
2584 is, environment variables which will be available to init and all of
2585 its descendents), you can use <command>lxc.environment</command>
2586 parameters to do so. Be careful that you do not pass in anything
2587 sensitive; any process in the container which doesn't have its
2588 environment scrubbed will have these variables available to it, and
2589 environment variables are always available via
2590 <command>/proc/PID/environ</command>.
2591 -->
2592 コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。
2593 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。
2594 </para>
2595
2596 <para>
2597 <!--
2598 This configuration parameter can be specified multiple times; once
2599 for each environment variable you wish to configure.
2600 -->
2601 この設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。
2602 </para>
2603
2604 <variablelist>
2605 <varlistentry>
2606 <term>
2607 <option>lxc.environment</option>
2608 </term>
2609 <listitem>
2610 <para>
2611 <!--
2612 Specify an environment variable to pass into the container.
2613 Example:
2614 -->
2615 コンテナに渡したい環境変数を指定します。
2616 例:
2617 </para>
2618 <programlisting>
2619 lxc.environment = APP_ENV=production
2620 lxc.environment = SYSLOG_SERVER=192.0.2.42
2621 </programlisting>
2622 </listitem>
2623 </varlistentry>
2624 </variablelist>
2625 </refsect2>
2626
2627 </refsect1>
2628
2629 <refsect1>
2630 <title><!-- Examples -->例</title>
2631 <para>
2632 <!--
2633 In addition to the few examples given below, you will find
2634 some other examples of configuration file in @DOCDIR@/examples
2635 -->
2636 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。
2637 </para>
2638 <refsect2>
2639 <title><!-- Network -->ネットワーク</title>
2640 <para>
2641 <!--
2642 This configuration sets up a container to use a veth pair
2643 device with one side plugged to a bridge br0 (which has been
2644 configured before on the system by the administrator). The
2645 virtual network device visible in the container is renamed to
2646 eth0.
2647 -->
2648 この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。
2649 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。
2650 </para>
2651 <programlisting>
2652 lxc.uts.name = myhostname
2653 lxc.net.0.type = veth
2654 lxc.net.0.flags = up
2655 lxc.net.0.link = br0
2656 lxc.net.0.name = eth0
2657 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2658 lxc.net.0.ipv4.address = 1.2.3.5/24 1.2.3.255
2659 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
2660 </programlisting>
2661 </refsect2>
2662
2663 <refsect2>
2664 <title><!-- UID/GID mapping -->UID/GID のマッピング</title>
2665 <para><!-- This configuration will map both user and group ids in the
2666 range 0-9999 in the container to the ids 100000-109999 on the host. -->
2667 この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。
2668 </para>
2669 <programlisting>
2670 lxc.idmap = u 0 100000 10000
2671 lxc.idmap = g 0 100000 10000
2672 </programlisting>
2673 </refsect2>
2674
2675 <refsect2>
2676 <title>Control group</title>
2677 <para>
2678 <!-- This configuration will setup several control groups for
2679 the application, cpuset.cpus restricts usage of the defined cpu,
2680 cpus.share prioritize the control group, devices.allow makes
2681 usable the specified devices.-->
2682 この設定は、アプリケーションのための control group をいくつか設定します。
2683 cpuset.cpus は定義された cpu のみ使用できるように制限します。
2684 cpus.share は、control group の (cpu) 優先度を指定します。
2685 devices.allow は、特定のデバイスを使用可能にします。
2686 </para>
2687 <programlisting>
2688 lxc.cgroup.cpuset.cpus = 0,1
2689 lxc.cgroup.cpu.shares = 1234
2690 lxc.cgroup.devices.deny = a
2691 lxc.cgroup.devices.allow = c 1:3 rw
2692 lxc.cgroup.devices.allow = b 8:0 rw
2693 </programlisting>
2694 </refsect2>
2695
2696 <refsect2>
2697 <title><!-- Complex configuration -->複雑な設定</title>
2698 <para>
2699 <!-- This example show a complex configuration making a complex
2700 network stack, using the control groups, setting a new hostname,
2701 mounting some locations and a changing root file system. -->
2702 この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。
2703 </para>
2704 <programlisting>
2705 lxc.uts.name = complex
2706 lxc.net.0.type = veth
2707 lxc.net.0.flags = up
2708 lxc.net.0.link = br0
2709 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2710 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
2711 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
2712 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
2713 lxc.net.1.type = macvlan
2714 lxc.net.1.flags = up
2715 lxc.net.1.link = eth0
2716 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
2717 lxc.net.1.ipv4.address = 10.2.3.4/24
2718 lxc.net.1.ipv4.address = 192.168.10.125/24
2719 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
2720 lxc.net.2.type = phys
2721 lxc.net.2.flags = up
2722 lxc.net.2.link = dummy0
2723 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
2724 lxc.net.2.ipv4.address = 10.2.3.6/24
2725 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
2726 lxc.cgroup.cpuset.cpus = 0,1
2727 lxc.cgroup.cpu.shares = 1234
2728 lxc.cgroup.devices.deny = a
2729 lxc.cgroup.devices.allow = c 1:3 rw
2730 lxc.cgroup.devices.allow = b 8:0 rw
2731 lxc.mount.fstab = /etc/fstab.complex
2732 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
2733 lxc.rootfs.path = dir:/mnt/rootfs.complex
2734 lxc.cap.drop = sys_module mknod setuid net_raw
2735 lxc.cap.drop = mac_override
2736 </programlisting>
2737 </refsect2>
2738
2739 </refsect1>
2740
2741 <refsect1>
2742 <title>See Also</title>
2743 <simpara>
2744 <citerefentry>
2745 <refentrytitle><command>chroot</command></refentrytitle>
2746 <manvolnum>1</manvolnum>
2747 </citerefentry>,
2748
2749 <citerefentry>
2750 <refentrytitle><command>pivot_root</command></refentrytitle>
2751 <manvolnum>8</manvolnum>
2752 </citerefentry>,
2753
2754 <citerefentry>
2755 <refentrytitle><filename>fstab</filename></refentrytitle>
2756 <manvolnum>5</manvolnum>
2757 </citerefentry>
2758
2759 <citerefentry>
2760 <refentrytitle><filename>capabilities</filename></refentrytitle>
2761 <manvolnum>7</manvolnum>
2762 </citerefentry>
2763
2764 </simpara>
2765 </refsect1>
2766
2767 &seealso;
2768
2769 <refsect1>
2770 <title><!-- Author -->作者</title>
2771 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
2772 </refsect1>
2773
2774 </refentry>
2775
2776 <!-- Keep this comment at the end of the file
2777 Local variables:
2778 mode: sgml
2779 sgml-omittag:t
2780 sgml-shorttag:t
2781 sgml-minimize-attributes:nil
2782 sgml-always-quote-attributes:t
2783 sgml-indent-step:2
2784 sgml-indent-data:t
2785 sgml-parent-document:nil
2786 sgml-default-dtd-file:nil
2787 sgml-exposed-tags:nil
2788 sgml-local-catalogs:nil
2789 sgml-local-ecat-files:nil
2790 End:
2791 -->