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