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