]> git.proxmox.com Git - mirror_lxc.git/blame - doc/ja/lxc.container.conf.sgml.in
doc: add a note about shared ns + LSMs to Japanese doc
[mirror_lxc.git] / doc / ja / lxc.container.conf.sgml.in
CommitLineData
fb261f53
KY
1<!--
2
3lxc: linux Container library
4
5(C) Copyright IBM Corp. 2007, 2008
6
7Authors:
8Daniel Lezcano <daniel.lezcano at free.fr>
9
10This library is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2.1 of the License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public
21License along with this library; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24Translated into Japanese
25by KATOH Yasufumi <karma at jazz.email.ne.jp>
26
27-->
28
29<!DOCTYPE refentry PUBLIC @docdtd@ [
30
31<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
32]>
33
34<refentry>
35
36 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
37
38 <refmeta>
39 <refentrytitle>lxc.container.conf</refentrytitle>
40 <manvolnum>5</manvolnum>
41 </refmeta>
42
43 <refnamediv>
44 <refname>lxc.container.conf</refname>
45
46 <refpurpose>
47 <!--
48 LXC container configuration file
49 -->
50 LXC コンテナ設定ファイル
51 </refpurpose>
52 </refnamediv>
53
54 <refsect1>
55 <title><!-- Description -->説明</title>
56
57 <para>
58 <!--
2513f519
KY
59 LXC is the well-known and heavily tested low-level Linux container
60 runtime. It is in active development since 2008 and has proven itself in
61 critical production environments world-wide. Some of its core contributors
62 are the same people that helped to implement various well-known
63 containerization features inside the Linux kernel.
64 -->
65 LXC は良く知られた、多くのテストが行われた Linux コンテナのランタイムです。LXC は、2008 年以来アクティブに開発されており、世界中の重要な本番環境で実証されています。開発への貢献者の中には、Linux カーネル内の良く知られた様々なコンテナ機能の実装に貢献した人と同じ人もいます。
fb261f53
KY
66 </para>
67
68 <para>
69 <!--
2513f519
KY
70 LXC's main focus is system containers. That is, containers which offer an
71 environment as close as possible as the one you'd get from a VM but
72 without the overhead that comes with running a separate kernel and
73 simulating all the hardware.
74 -->
75 LXC は主にシステムコンテナにフォーカスを当てています。つまり、VM で得られる環境と可能な限り近い環境を提供を提供するにも関わらず、別々のカーネルを実行したり、ハードウェアをすべてシミュレートしたりすることによるオーバーヘッドがないコンテナのことです。
76 </para>
77
78 <para>
79 <!--
80 This is achieved through a combination of kernel security features such as
81 namespaces, mandatory access control and control groups.
82 -->
83 このような環境は、名前空間 (namespace)、強制アクセスコントロール、cgroup といったカーネルのセキュリティ機能の組み合わせで実現しています。
84 </para>
85
86 <para>
87 <!--
88 LXC has supports unprivileged containers. Unprivileged containers are
89 containers that are run without any privilege. This requires support for
90 user namespaces in the kernel that the container is run on. LXC was the
91 first runtime to support unprivileged containers after user namespaces
92 were merged into the mainline kernel.
93 -->
94 LXC は非特権コンテナをサポートしています。非特権コンテナは、いかなる特権も持たずに実行するコンテナです。非特権コンテナの実行には、コンテナを実行しているカーネルにユーザ名前空間 (user namespace) のサポートが必要です。LXC は、ユーザ名前空間がメインラインカーネルにマージされてから、初めて非特権コンテナをサポートしたランタイムです。
95 </para>
96
97 <para>
98 <!--
99 In essence, user namespaces isolate given sets of UIDs and GIDs. This is
100 achieved by establishing a mapping between a range of UIDs and GIDs on the
101 host to a different (unprivileged) range of UIDs and GIDs in the
102 container. The kernel will translate this mapping in such a way that
103 inside the container all UIDs and GIDs appear as you would expect from the
104 host whereas on the host these UIDs and GIDs are in fact unprivileged. For
105 example, a process running as UID and GID 0 inside the container might
106 appear as UID and GID 100000 on the host. The implementation and working
107 details can be gathered from the corresponding user namespace man page.
bdcbb6b3 108 UID and GID mappings can be defined with the <option>lxc.idmap</option>
2513f519
KY
109 key.
110 -->
111 本質的には、ユーザ名前空間は与えられた UID、GID の組を隔離します。ユーザ名前空間は、ホスト上の UID、GID のある範囲を、それとは異なるコンテナ上の UID、GID の範囲へマッピングすることで実現します。カーネルは、ホスト上では実際には UID、GID は特権を持たないにも関わらず、コンテナ内ではすべての UID、GID が期待されるように見えるように変換を行います。
bdcbb6b3 112 例えば、コンテナ内では UID、GID が 0 として実行中のプロセスは、ホスト上では UID、GID が 100000 として見えるでしょう。実装と動作の詳細は、ユーザ名前空間の man ページから得られます。UID と GID のマッピングは <option>lxc.idmap</option> を使って定義できます。
fb261f53
KY
113 </para>
114
115 <para>
116 <!--
2513f519
KY
117 Linux containers are defined with a simple configuration file. Each
118 option in the configuration file has the form <command>key =
119 value</command> fitting in one line. The "#" character means the line is a
120 comment. List options, like capabilities and cgroups options, can be used
121 with no value to clear any previously defined values of that option.
122 -->
123 Linux コンテナは、簡単な設定ファイルで定義します。設定ファイル中のオプションは <command>key = value</command> の形で一行で表します。'#' は、その行はコメントであることを示します。ケーパビリティや cgroup のオプションのような、リスト形式で指定するオプションでは、value がない形式で指定でき、そのように使うと、それ以前に定義した値をすべてクリアします。
124 </para>
125
126 <para>
127 <!--
128 LXC namespaces configuration keys by using single dots. This means complex
7fa3f2e9 129 configuration keys such as <option>lxc.net.0</option> expose various
130 subkeys such as <option>lxc.net.0.type</option>,
e71b47b2 131 <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and
2513f519 132 others for even more fine-grained configuration.
fb261f53 133 -->
e71b47b2 134 LXC は、シングルドットを使って設定キーの名前空間を表します。<option>lxc.net.0</option> のような複雑な設定キーは、<option>lxc.net.0.type</option>、<option>lxc.net.0.link</option>、<option>lxc.net.0.ipv6.address</option> や、さらに細分化された設定向けの色々なサブキーを持つことを意味します。
fb261f53
KY
135 </para>
136
137 <refsect2>
138 <title><!-- Configuration -->設定</title>
139 <para>
140 <!--
2513f519
KY
141 In order to ease administration of multiple related containers, it is
142 possible to have a container configuration file cause another file to be
143 loaded. For instance, network configuration can be defined in one common
144 file which is included by multiple containers. Then, if the containers
145 are moved to another host, only one file may need to be updated.
146 -->
dc421f3a
KY
147 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。
148 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。
149 その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。
fb261f53
KY
150 </para>
151
152 <variablelist>
50a8555e
KY
153 <varlistentry>
154 <term>
155 <option>lxc.include</option>
156 </term>
157 <listitem>
158 <para>
fb261f53 159 <!--
50a8555e
KY
160 Specify the file to be included. The included file must be
161 in the same valid lxc configuration file format.
fb261f53 162 -->
dc421f3a
KY
163 include させたいファイルを指定します。
164 include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。
50a8555e
KY
165 </para>
166 </listitem>
167 </varlistentry>
fb261f53
KY
168 </variablelist>
169 </refsect2>
170
171 <refsect2>
172 <title><!-- Architecture -->アーキテクチャ</title>
173 <para>
174 <!--
2513f519
KY
175 Allows one to set the architecture for the container. For example, set a
176 32bits architecture for a container running 32bits binaries on a 64bits
177 host. This fixes the container scripts which rely on the architecture to
178 do some work like downloading the packages.
fb261f53 179 -->
dc421f3a
KY
180 コンテナに対してアーキテクチャを設定することが可能です。
181 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。
182 この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。
fb261f53
KY
183 </para>
184
185 <variablelist>
50a8555e
KY
186 <varlistentry>
187 <term>
188 <option>lxc.arch</option>
189 </term>
190 <listitem>
191 <para>
fb261f53 192 <!--
50a8555e 193 Specify the architecture for the container.
fb261f53 194 -->
dc421f3a 195 コンテナに設定するアーキテクチャを指定します。
50a8555e
KY
196 </para>
197 <para>
fb261f53 198 <!--
2513f519
KY
199 Some valid options are
200 <option>x86</option>,
201 <option>i686</option>,
202 <option>x86_64</option>,
203 <option>amd64</option>
204 -->
205 有効なオプションには以下のようなものがあります。
206 <option>x86</option>,
207 <option>i686</option>,
208 <option>x86_64</option>,
209 <option>amd64</option>
210 </para>
211 </listitem>
212 </varlistentry>
fb261f53
KY
213 </variablelist>
214
215 </refsect2>
216
217 <refsect2>
218 <title><!-- Hostname -->ホスト名</title>
219 <para>
220 <!--
2513f519
KY
221 The utsname section defines the hostname to be set for the container.
222 That means the container can set its own hostname without changing the
223 one from the system. That makes the hostname private for the container.
fb261f53 224 -->
dc421f3a
KY
225 utsname セクションは、コンテナに設定されるホスト名を定義します。
226 コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。
227 このことにより、ホスト名はコンテナ専用となります。
fb261f53
KY
228 </para>
229 <variablelist>
50a8555e
KY
230 <varlistentry>
231 <term>
b67771bc 232 <option>lxc.uts.name</option>
50a8555e
KY
233 </term>
234 <listitem>
235 <para>
fb261f53 236 <!--
50a8555e 237 specify the hostname for the container
fb261f53 238 -->
dc421f3a 239 コンテナのホスト名を指定します。
50a8555e
KY
240 </para>
241 </listitem>
242 </varlistentry>
fb261f53
KY
243 </variablelist>
244 </refsect2>
245
246 <refsect2>
247 <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title>
248 <para>
50a8555e 249 <!--
2513f519
KY
250 Allows one to specify signal name or number sent to the container's
251 init process to cleanly shutdown the container. Different init systems
252 could use different signals to perform clean shutdown sequence. This
253 option allows the signal to be specified in kill(1) fashion, e.g.
254 SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is
255 SIGPWR.
50a8555e 256 -->
2513f519 257 コンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定できます。init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。このオプションではシグナルとして kill(1) で使う形式を指定できます。
dc421f3a 258 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。
fb261f53
KY
259 </para>
260 <variablelist>
ea4cadbf
KY
261 <varlistentry>
262 <term>
55c84efc 263 <option>lxc.signal.halt</option>
ea4cadbf
KY
264 </term>
265 <listitem>
266 <para>
267 <!--
268 specify the signal used to halt the container
269 -->
270 コンテナをシャットダウンするために使うシグナルを指定します。
271 </para>
272 </listitem>
273 </varlistentry>
274 </variablelist>
275 </refsect2>
276
277 <refsect2>
278 <title>リブート時のシグナル <!-- Reboot signal --></title>
279 <para>
280 <!--
2513f519
KY
281 Allows one to specify signal name or number to reboot the container.
282 This option allows signal to be specified in kill(1) fashion, e.g.
283 SIGTERM, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal
284 is SIGINT.
fb261f53 285 -->
2513f519 286 コンテナをリブートするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
ea4cadbf
KY
287 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGINT です。
288 </para>
289 <variablelist>
290 <varlistentry>
291 <term>
55c84efc 292 <option>lxc.signal.reboot</option>
ea4cadbf
KY
293 </term>
294 <listitem>
295 <para>
296 <!--
297 specify the signal used to reboot the container
298 -->
299 コンテナをリブートするために使うシグナルを指定します。
300 </para>
301 </listitem>
302 </varlistentry>
fb261f53
KY
303 </variablelist>
304 </refsect2>
305
306 <refsect2>
307 <title><!-- Stop signal -->強制停止時のシグナル</title>
308 <para>
309 <!--
2513f519
KY
310 Allows one to specify signal name or number to forcibly shutdown the
311 container. This option allows signal to be specified in kill(1) fashion,
312 e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default
313 signal is SIGKILL.
ea4cadbf 314 -->
2513f519 315 コンテナを強制的にシャットダウンするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
dc421f3a 316 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。
fb261f53
KY
317 </para>
318 <variablelist>
ea4cadbf
KY
319 <varlistentry>
320 <term>
55c84efc 321 <option>lxc.signal.stop</option>
ea4cadbf
KY
322 </term>
323 <listitem>
324 <para>
325 <!--
326 specify the signal used to stop the container
327 -->
328 コンテナを停止するのに使用するシグナルを指定します。
329 </para>
330 </listitem>
331 </varlistentry>
fb261f53
KY
332 </variablelist>
333 </refsect2>
334
c881c406
KY
335 <refsect2>
336 <title><!-- Init command -->Init コマンド</title>
337 <para>
338 <!--
339 Sets the command to use as the init system for the containers.
c881c406
KY
340 -->
341 コンテナの init として使うコマンドを設定します。
c881c406 342 </para>
fcd95ae9
KY
343 <variablelist>
344 <varlistentry>
345 <term>
346 <option>lxc.execute.cmd</option>
347 </term>
348 <listitem>
349 <para>
4eeecbdb 350 <!--
fcd95ae9 351 Absolute path from container rootfs to the binary to run by default. This
4eeecbdb
KY
352 mostly makes sense for lxc-execute.
353 -->
354 デフォルトで実行するバイナリのコンテナの root からの絶対パスを指定します。これは <command>lxc-execute</command> のための設定です。
fcd95ae9
KY
355 </para>
356 </listitem>
357 </varlistentry>
358 </variablelist>
c881c406
KY
359 <variablelist>
360 <varlistentry>
361 <term>
9dcf7b4d 362 <option>lxc.init.cmd</option>
c881c406
KY
363 </term>
364 <listitem>
365 <para>
366 <!--
fcd95ae9 367 Absolute path from container rootfs to the binary to use as init. This
4eeecbdb 368 mostly makes sense for lxc-start. Default is /sbin/init.
c881c406 369 -->
fcd95ae9 370 init として使うバイナリの、コンテナの root からの絶対パスを指定します。これは <command>lxc-start</command> のための設定です。デフォルトは <command>/sbin/init</command> です。
c881c406
KY
371 </para>
372 </listitem>
373 </varlistentry>
374 </variablelist>
375 </refsect2>
376
3f6b1110
KY
377 <refsect2>
378 <title>Init のワーキングディレクトリ <!-- Init working directory --></title>
379 <para>
4eeecbdb 380 <!--
3f6b1110
KY
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.
4eeecbdb
KY
383 -->
384 コンテナのワーキングディレクトリとして、コンテナ内の絶対パスを設定します。LXC は init を実行する前に、このディレクトリに移動します。
3f6b1110
KY
385 </para>
386 <variablelist>
387 <varlistentry>
388 <term>
389 <option>lxc.init.cwd</option>
390 </term>
391 <listitem>
392 <para>
4eeecbdb 393 <!--
3f6b1110 394 Absolute path inside the container to use as the working directory.
4eeecbdb
KY
395 -->
396 ワーキングディレクトリとして使うコンテナ内の絶対パス
3f6b1110
KY
397 </para>
398 </listitem>
399 </varlistentry>
400 </variablelist>
401 </refsect2>
402
7ee64c0f
KY
403 <refsect2>
404 <title><!-- Init ID -->Init が使う ID</title>
405 <para>
50a8555e 406 <!--
2513f519
KY
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.
7ee64c0f 411
7ee64c0f 412 Defaults to: UID(0), GID(0)
50a8555e
KY
413 -->
414 init と後続のコマンドが使う UID/GID を設定します。システムコンテナを起動するのに非 root な UID を使うと、特権がないために動作しないでしょう。UID/GID の指定は、通常はアプリケーションコンテナの動作の際に役に立ちます。
2513f519 415
50a8555e 416 デフォルト値: UID(0)、GID(0)
7ee64c0f
KY
417 </para>
418 <variablelist>
419 <varlistentry>
420 <term>
9dcf7b4d 421 <option>lxc.init.uid</option>
7ee64c0f
KY
422 </term>
423 <listitem>
424 <para>
50a8555e
KY
425 <!--
426 UID to use for init.
427 -->
2513f519 428 init が使う UID です。
7ee64c0f
KY
429 </para>
430 </listitem>
431 </varlistentry>
432 <varlistentry>
433 <term>
9dcf7b4d 434 <option>lxc.init.gid</option>
7ee64c0f
KY
435 </term>
436 <listitem>
437 <para>
438 <!--
2513f519 439 GID to use for init.
7ee64c0f 440 -->
2513f519 441 init が使う GID です。
7ee64c0f
KY
442 </para>
443 </listitem>
444 </varlistentry>
445 </variablelist>
446 </refsect2>
447
4eeecbdb
KY
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
7346eb3a
KY
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
fb261f53
KY
505 <refsect2>
506 <title><!-- Network -->ネットワーク</title>
507 <para>
508 <!--
50a8555e
KY
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.
fb261f53 516 -->
dc421f3a
KY
517 ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。
518 ネットワークの仮想化はレイヤー 2 で作動します。
519 ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。
520 いくつかの仮想インターフェースをアサインすることができます。
521 そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。
fb261f53
KY
522 </para>
523 <variablelist>
3f45936b
KY
524 <varlistentry>
525 <term>
7fa3f2e9 526 <option>lxc.net</option>
3f45936b
KY
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>
50a8555e
KY
537 <varlistentry>
538 <term>
7fa3f2e9 539 <option>lxc.net.[i].type</option>
50a8555e
KY
540 </term>
541 <listitem>
2513f519 542 <para>
50a8555e 543 <!--
2513f519
KY
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>
7fa3f2e9 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
2513f519
KY
551 networks of the same type. All keys sharing the same index
552 <option>i</option> will be treated as belonging to the same
7fa3f2e9 553 network. For example, <option>lxc.net.0.link = br0</option>
554 will belong to <option>lxc.net.0.type</option>.
2513f519 555 Currently, the different virtualization types can be:
50a8555e 556 -->
7fa3f2e9 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> と同じネットワークの設定になります。
50a8555e 559 現時点では、以下のネットワーク仮想化のタイプが使えます:
2513f519 560 </para>
fb261f53 561
50a8555e 562 <para>
fb261f53 563 <!--
50a8555e
KY
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
e0e360c5
KY
569 host. Note that unprivileged containers do not work with this
570 setting due to an inability to mount sysfs. An unsafe workaround
571 would be to bind mount the host's sysfs.
fb261f53 572 -->
dc421f3a
KY
573 <option>none:</option> ホストのネットワーク名前空間を共有します。
574 これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。
575 もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。
e0e360c5 576 非特権コンテナでは、sysfs をマウントできないので、この設定は動作しません。この問題に対する回避策は、ホストの sysfs を bind マウントすることです。ただしこの回避策は安全ではありません。
50a8555e 577 </para>
fb261f53 578
50a8555e 579 <para>
fb261f53 580 <!--
50a8555e
KY
581 <option>empty:</option> will create only the loopback
582 interface.
fb261f53 583 -->
50a8555e
KY
584 <option>empty:</option> ループバックインターフェースだけを作成します。
585 </para>
fb261f53 586
ac11ab33 587 <para>
fb261f53 588 <!--
ac11ab33
KY
589 <option>veth:</option> a virtual ethernet pair
590 device is created with one side assigned to the container
591 and the other side attached to a bridge specified by
7fa3f2e9 592 the <option>lxc.net.[i].link</option> option.
ac11ab33
KY
593 If the bridge is not specified, then the veth pair device
594 will be created but not attached to any bridge.
595 Otherwise, the bridge has to be created on the system
596 before starting the container.
597 <command>lxc</command> won't handle any
598 configuration outside of the container.
599 By default, <command>lxc</command> chooses a name for the
600 network device belonging to the outside of the
601 container, but if you wish to handle
602 this name yourselves, you can tell <command>lxc</command>
603 to set a specific name with
7fa3f2e9 604 the <option>lxc.net.[i].veth.pair</option> option (except for
ac11ab33
KY
605 unprivileged containers where this option is ignored for security
606 reasons).
7dd6ead9
KY
607
608 Static routes can be added on the host pointing to the container using the
609 <option>lxc.net.[i].veth.ipv4.route</option> and
610 <option>lxc.net.[i].veth.ipv6.route</option> options.
611 Several lines specify several routes.
612 The route is in format x.y.z.t/m, eg. 192.168.1.0/24.
fb261f53 613 -->
7fa3f2e9 614 <option>veth:</option > 一方がコンテナに、もう一方が <option>lxc.net.[i].link</option> オプションで指定されたブリッジに接続されるペアの仮想イーサネットデバイスを作成します。
ac11ab33
KY
615 もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。
616 ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。
617 <command>lxc</command> はコンテナ外の設定を扱うことはありません。
618 デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。
7fa3f2e9 619 しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。
7dd6ead9
KY
620
621 <option>lxc.net.[i].veth.ipv4.route</option>、<option>lxc.net.[i].veth.ipv6.route</option> オプションを使って、静的ルーティングをコンテナを指し示すホスト上に追加できます。
622 複数のルートがある場合は複数の設定を指定します。
623 ルートは x.y.z.t/m の形式です。例: 192.168.1.0/24
ac11ab33 624 </para>
fb261f53 625
50a8555e 626 <para>
fb261f53 627 <!--
50a8555e
KY
628 <option>vlan:</option> a vlan interface is linked with
629 the interface specified by
7fa3f2e9 630 the <option>lxc.net.[i].link</option> and assigned to
50a8555e 631 the container. The vlan identifier is specified with the
7fa3f2e9 632 option <option>lxc.net.[i].vlan.id</option>.
fb261f53 633 -->
7fa3f2e9 634 <option>vlan:</option> vlan インターフェースは <option>lxc.net.[i].link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。
635 vlan の指定は <option>lxc.net.[i].vlan.id</option> オプションで指定します。
50a8555e 636 </para>
fb261f53 637
50a8555e 638 <para>
fb261f53 639 <!--
50a8555e
KY
640 <option>macvlan:</option> a macvlan interface is linked
641 with the interface specified by
7fa3f2e9 642 the <option>lxc.net.[i].link</option> and assigned to
50a8555e 643 the container.
7fa3f2e9 644 <option>lxc.net.[i].macvlan.mode</option> specifies the
50a8555e
KY
645 mode the macvlan will use to communicate between
646 different macvlan on the same upper device. The accepted
5a56eeb6
KY
647 modes are <option>private</option>, <option>vepa</option>,
648 <option>bridge</option> and <option>passthru</option>.
50a8555e 649 In <option>private</option> mode, the device never
5a56eeb6
KY
650 communicates with any other device on the same upper_dev (default).
651 In <option>vepa</option> mode, the new Virtual Ethernet Port
50a8555e
KY
652 Aggregator (VEPA) mode, it assumes that the adjacent
653 bridge returns all frames where both source and
654 destination are local to the macvlan port, i.e. the
655 bridge is set up as a reflective relay. Broadcast
656 frames coming in from the upper_dev get flooded to all
657 macvlan interfaces in VEPA mode, local frames are not
5a56eeb6 658 delivered locally. In <option>bridge</option> mode, it
50a8555e
KY
659 provides the behavior of a simple bridge between
660 different macvlan interfaces on the same port. Frames
661 from one interface to another one get delivered directly
662 and are not sent out externally. Broadcast frames get
663 flooded to all other bridge ports and to the external
664 interface, but when they come back from a reflective
665 relay, we don't deliver them again. Since we know all
666 the MAC addresses, the macvlan bridge mode does not
5a56eeb6
KY
667 require learning or STP like the bridge module does. In
668 <option>passthru</option> mode, all frames received by
669 the physical interface are forwarded to the macvlan
670 interface. Only one macvlan interface in <option>passthru</option>
671 mode is possible for one physical interface.
fb261f53 672 -->
7fa3f2e9 673 <option>macvlan:</option> macvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
7dd6ead9 674 <option>lxc.net.[i].macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan 間の通信をする時に使います。
5a56eeb6
KY
675 指定できるモードは <option>private</option>、<option>vepa</option>、<option>bridge</option>、<option>passthru</option> のいずれかです。
676 <option>private</option> モードの場合、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。
677 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である <option>vepa</option> モードの場合、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。
dc421f3a
KY
678 すなわち、ブリッジが reflective relay として設定されているということです。
679 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。
680 ローカルのフレームはローカルには配送されません。
5a56eeb6 681 <option>bridge</option> モードの場合、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。
dc421f3a
KY
682 あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。
683 ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。
684 しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。
685 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。
5a56eeb6 686 <option>passthru</option> モードの場合、物理インターフェースで受け取った全てのフレームは macvlan インターフェースに転送されます。<option>passthru</option> モードの場合、ひとつの macvlan インターフェースだけが、ひとつの物理インターフェースに対して設定できます。
50a8555e 687 </para>
fb261f53 688
7dd6ead9
KY
689 <para>
690 <!--
691 <option>ipvlan:</option> an ipvlan interface is linked
692 with the interface specified by
693 the <option>lxc.net.[i].link</option> and assigned to
694 the container.
695 <option>lxc.net.[i].ipvlan.mode</option> specifies the
696 mode the ipvlan will use to communicate between
697 different ipvlan on the same upper device. The accepted
698 modes are <option>l3</option>, <option>l3s</option> and
699 <option>l2</option>. It defaults to <option>l3</option> mode.
700 In <option>l3</option> mode TX processing up to L3 happens on the stack instance
701 attached to the slave device and packets are switched to the stack instance of the
702 master device for the L2 processing and routing from that instance will be
703 used before packets are queued on the outbound device. In this mode the slaves
704 will not receive nor can send multicast / broadcast traffic.
705 In <option>l3s</option> mode TX processing is very similar to the L3 mode except that
706 iptables (conn-tracking) works in this mode and hence it is L3-symmetric (L3s).
707 This will have slightly less performance but that shouldn't matter since you are
708 choosing this mode over plain-L3 mode to make conn-tracking work.
709 In <option>l2</option> mode TX processing happens on the stack instance attached to
710 the slave device and packets are switched and queued to the master device to send
711 out. In this mode the slaves will RX/TX multicast and broadcast (if applicable) as well.
712 <option>lxc.net.[i].ipvlan.isolation</option> specifies the isolation mode.
713 The accepted isolation values are <option>bridge</option>,
714 <option>private</option> and <option>vepa</option>.
715 It defaults to <option>bridge</option>.
716 In <option>bridge</option> isolation mode slaves can cross-talk among themselves
717 apart from talking through the master device.
718 In <option>private</option> isolation mode the port is set in private mode.
719 i.e. port won't allow cross communication between slaves.
720 In <option>vepa</option> isolation mode the port is set in VEPA mode.
721 i.e. port will offload switching functionality to the external entity as
722 described in 802.1Qbg.
723 -->
724 <option>ipvlan:</option> ipvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
725 <option>lxc.net.[i].ipvlan.mode</option> でモードを指定すると、その ipvlan の指定を、同じ上位デバイスで異なる ipvlan 間の通信をする時に使います。
726 指定できるモードは <option>l3</option>、<option>l3s</option>、<option>l2</option> で、デフォルトは <option>l3</option> モードです。
c425edc6
KY
727 <option>l3</option> モードでは、L3 までの TX (送信) 処理はスレーブデバイスにアタッチされたスタックインスタンス上で行われます。
728 そしてパケットは、L2 処理のためにマスターデバイスのスタックインスタンスにスイッチされます。このインスタンスからのルーティングは、発信デバイス上でキューに入る前に使われます。
729 このモードでは、スレーブはマルチキャスト・ブロードキャストのトラフィックを受信しませんし、送信もできません。
730 <option>l3s</option> モードは、TX (送信) 処理は L3 モードと非常に似ていますが、iptables (conn-tracking) がこのモードで動作します。
731 それゆえに L3対称 (symmetric) (L3s) です。このモードは若干パフォーマンスが低下しますが、conn-tracking (接続追跡) が動作するように、普通の L3 モードの代わりにこのモードを選んでいるので問題にはならないはずです。
732 <option>l2</option> モードでは、TX (送信) 処理はスレーブデバイスにアタッチされたスタックインスンタンス上で行われます。
733 パケットは送信のため、マスターデバイスにスイッチされ、マスターデバイス上でキューに入ります。このモードでは、スレーブはマルチキャストも(該当する場合)ブロードキャストも RX/TX (送受信) 処理します。
7dd6ead9
KY
734
735 <option>lxc.net.[i].ipvlan.isolation</option> は隔離モードを指定します。隔離モードには <option>bridge</option>、<option>private</option>、<option>vepa</option> が指定できます。デフォルトは <option>bridge</option> モードです。
736 <option>bridge</option> 隔離モードでは、スレーブはマスターデバイス経由の通信とは別に、スレーブ同士で通信できます。
737 <option>private</option> 隔離モードでは、ポートはプライベートに設定されます。つまり、スレーブ間の通信はできません。
738 <option>vepa</option> 隔離モードでは、ポートは VEPA モードに設定されます。つまり、802.1Qbg で説明されているように、ポートはスイッチング機能を外部エンティティにオフロードします。
739 </para>
740
50a8555e 741 <para>
fb261f53 742 <!--
50a8555e 743 <option>phys:</option> an already existing interface
7fa3f2e9 744 specified by the <option>lxc.net.[i].link</option> is
50a8555e 745 assigned to the container.
fb261f53 746 -->
7fa3f2e9 747 <option>phys:</option> <option>lxc.net.[i].link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。
50a8555e
KY
748 </para>
749 </listitem>
750 </varlistentry>
fb261f53 751
50a8555e
KY
752 <varlistentry>
753 <term>
7fa3f2e9 754 <option>lxc.net.[i].flags</option>
50a8555e
KY
755 </term>
756 <listitem>
757 <para>
fb261f53 758 <!--
2513f519 759 Specify an action to do for the network.
fb261f53 760 -->
dc421f3a 761 ネットワークに対して行うアクションを指定します。
50a8555e 762 </para>
fb261f53 763
50a8555e 764 <para>
fb261f53
KY
765 <!--
766 <option>up:</option> activates the interface.
767 -->
dc421f3a 768 <option>up:</option> インターフェースを起動させます。
50a8555e
KY
769 </para>
770 </listitem>
771 </varlistentry>
fb261f53 772
50a8555e
KY
773 <varlistentry>
774 <term>
7fa3f2e9 775 <option>lxc.net.[i].link</option>
50a8555e
KY
776 </term>
777 <listitem>
778 <para>
fb261f53 779 <!--
2513f519 780 Specify the interface to be used for real network traffic.
fb261f53 781 -->
dc421f3a 782 実際のネットワークトラフィックに使うインターフェースを指定します。
50a8555e
KY
783 </para>
784 </listitem>
785 </varlistentry>
fb261f53 786
7dd6ead9
KY
787 <varlistentry>
788 <term>
789 <option>lxc.net.[i].l2proxy</option>
790 </term>
791 <listitem>
792 <para>
c425edc6 793 <!--
7dd6ead9
KY
794 Controls whether layer 2 IP neighbour proxy entries will be added to the
795 lxc.net.[i].link interface for the IP addresses of the container.
796 Can be set to 0 or 1. Defaults to 0.
797 When used with IPv4 addresses, the following sysctl values need to be set:
798 net.ipv4.conf.[link].forwarding=1
799 When used with IPv6 addresses, the following sysctl values need to be set:
800 net.ipv6.conf.[link].proxy_ndp=1
801 net.ipv6.conf.[link].forwarding=1
c425edc6
KY
802 -->
803 レイヤ 2 IP 近隣プロキシエントリを、コンテナの IP アドレスに対応する lxc.net.[i].link インターフェースに追加するかどうかを制御します。0 か 1 が設定でき、デフォルトは 0 です。
804 IPv4 アドレスで使う場合は、次の sysctl 設定が必要です:
805 net.ipv4.conf.[link].forwarding=1
806 IPv6 アドレスで使う場合は、次の sysctl 設定が必要です:
7dd6ead9
KY
807 net.ipv6.conf.[link].proxy_ndp=1
808 net.ipv6.conf.[link].forwarding=1
809 </para>
810 </listitem>
811 </varlistentry>
812
50a8555e
KY
813 <varlistentry>
814 <term>
7fa3f2e9 815 <option>lxc.net.[i].mtu</option>
50a8555e
KY
816 </term>
817 <listitem>
818 <para>
fb261f53 819 <!--
2513f519 820 Specify the maximum transfer unit for this interface.
fb261f53 821 -->
dc421f3a 822 インターフェースに対する MTU を指定します。
50a8555e
KY
823 </para>
824 </listitem>
825 </varlistentry>
fb261f53 826
50a8555e
KY
827 <varlistentry>
828 <term>
7fa3f2e9 829 <option>lxc.net.[i].name</option>
50a8555e
KY
830 </term>
831 <listitem>
832 <para>
fb261f53 833 <!--
2513f519
KY
834 The interface name is dynamically allocated, but if another name
835 is needed because the configuration files being used by the
836 container use a generic name, eg. eth0, this option will rename
837 the interface in the container.
fb261f53 838 -->
2513f519 839 インターフェース名は動的に割り当てられます。しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。
50a8555e
KY
840 </para>
841 </listitem>
842 </varlistentry>
fb261f53 843
50a8555e
KY
844 <varlistentry>
845 <term>
7fa3f2e9 846 <option>lxc.net.[i].hwaddr</option>
50a8555e
KY
847 </term>
848 <listitem>
849 <para>
fb261f53 850 <!--
2513f519
KY
851 The interface mac address is dynamically allocated by default to
852 the virtual interface, but in some cases, this is needed to
853 resolve a mac address conflict or to always have the same
854 link-local ipv6 address. Any "x" in address will be replaced by
855 random value, this allows setting hwaddr templates.
856 -->
857 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。アドレス中の "x" という文字は、ランダムな値に置き換えられます。これによりテンプレートに hwaddr を設定することが可能になります。
50a8555e
KY
858 </para>
859 </listitem>
860 </varlistentry>
fb261f53 861
50a8555e
KY
862 <varlistentry>
863 <term>
e71b47b2 864 <option>lxc.net.[i].ipv4.address</option>
50a8555e
KY
865 </term>
866 <listitem>
867 <para>
fb261f53 868 <!--
2513f519
KY
869 Specify the ipv4 address to assign to the virtualized interface.
870 Several lines specify several ipv4 addresses. The address is in
871 format x.y.z.t/m, eg. 192.168.1.123/24.
872 -->
873 仮想インターフェースに割り当てる ipv4 アドレスを指定します。複数行により複数の ipv4 アドレスを指定します。このアドレスは x.y.z.t/m というフォーマットで指定します。例) 192.168.1.123/24
50a8555e
KY
874 </para>
875 </listitem>
876 </varlistentry>
877
878 <varlistentry>
879 <term>
7fa3f2e9 880 <option>lxc.net.[i].ipv4.gateway</option>
50a8555e
KY
881 </term>
882 <listitem>
883 <para>
884 <!--
885 specify the ipv4 address to use as the gateway inside the
886 container. The address is in format x.y.z.t, eg. 192.168.1.123.
887
888 Can also have the special value <option>auto</option>,
889 which means to take the primary address from the bridge
890 interface (as specified by the
7fa3f2e9 891 <option>lxc.net.[i].link</option> option) and use that as
50a8555e 892 the gateway. <option>auto</option> is only available when
7dd6ead9
KY
893 using the <option>veth</option>,
894 <option>macvlan</option> and <option>ipvlan</option> network types.
895 Can also have the special value of <option>dev</option>,
896 which means to set the default gateway as a device route.
897 This is primarily for use with layer 3 network modes, such as IPVLAN.
fb261f53 898 -->
2513f519 899 コンテナでゲートウェイとして使う IPv4 アドレスを指定します。アドレスは x.y.z.t というフォーマットです。例) 192.168.1.123
7dd6ead9
KY
900 <option>auto</option> という特別な値を指定できます。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option>、<option>macvlan</option>、<option>ipvlan</option> を指定している時だけ有効となります。
901 特別な値である <option>dev</option> も設定できます。これはデバイスのルートとしてデフォルトゲートウェイを設定するという意味です。これは主に、IPVLAN のようなレイヤ 3 のネットワークモードで使用します。
50a8555e
KY
902 </para>
903 </listitem>
904 </varlistentry>
fb261f53
KY
905
906
50a8555e
KY
907 <varlistentry>
908 <term>
e71b47b2 909 <option>lxc.net.[i].ipv6.address</option>
50a8555e
KY
910 </term>
911 <listitem>
912 <para>
fb261f53 913 <!--
2513f519
KY
914 Specify the ipv6 address to assign to the virtualized
915 interface. Several lines specify several ipv6 addresses. The
916 address is in format x::y/m, eg.
917 2003:db8:1:0:214:1234:fe0b:3596/64
fb261f53 918 -->
2513f519 919 仮想インターフェースに割り当てる ipv6 アドレスを指定します。複数行により複数の ipv6 アドレスを指定します。このアドレスは x::y/m というフォーマットで指定します。例) 2003:db8:1:0:214:1234:fe0b:3596/64
50a8555e
KY
920 </para>
921 </listitem>
922 </varlistentry>
fb261f53 923
50a8555e
KY
924 <varlistentry>
925 <term>
7fa3f2e9 926 <option>lxc.net.[i].ipv6.gateway</option>
50a8555e
KY
927 </term>
928 <listitem>
929 <para>
fb261f53 930 <!--
2513f519
KY
931 Specify the ipv6 address to use as the gateway inside the
932 container. The address is in format x::y, eg. 2003:db8:1:0::1
fb261f53 933
50a8555e
KY
934 Can also have the special value <option>auto</option>,
935 which means to take the primary address from the bridge
936 interface (as specified by the
7fa3f2e9 937 <option>lxc.net.[i].link</option> option) and use that as
50a8555e 938 the gateway. <option>auto</option> is only available when
7dd6ead9
KY
939 using the <option>veth</option>,
940 <option>macvlan</option> and <option>ipvlan</option> network types.
941 Can also have the special value of <option>dev</option>,
942 which means to set the default gateway as a device route.
943 This is primarily for use with layer 3 network modes, such as IPVLAN.
fb261f53 944 -->
2513f519 945 コンテナでゲートウェイとして使う IPv6 アドレスを指定します。アドレスは x::y というフォーマットです。例) 2003:db8:1:0::1
7dd6ead9
KY
946 <option>auto</option> という特別な値を記述する事も可能です。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option>、<option>macvlan</option>、<option>ipvlan</option> を指定している時だけ有効となります。
947 特別な値である <option>dev</option> も設定できます。これはデバイスのルートとしてデフォルトゲートウェイを設定するという意味です。これは主に、IPVLAN のようなレイヤ 3 のネットワークモードで使用します。
50a8555e
KY
948 </para>
949 </listitem>
950 </varlistentry>
951
952 <varlistentry>
953 <term>
7fa3f2e9 954 <option>lxc.net.[i].script.up</option>
50a8555e
KY
955 </term>
956 <listitem>
957 <para>
a0a4f759 958 <!--
b6feb9db 959 Add a configuration option to specify a script to be
50a8555e 960 executed after creating and configuring the network used
b6feb9db 961 from the host side.
a0a4f759
KY
962 -->
963 ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。
b6feb9db
KY
964 </para>
965
966 <para>
a0a4f759 967 <!--
b6feb9db
KY
968 In addition to the information available to all hooks. The
969 following information is provided to the script:
a0a4f759
KY
970 -->
971 すべてのフックで追加の情報が使えます。以下の情報がスクリプトに提供されます:
b6feb9db
KY
972 <itemizedlist>
973 <listitem>
974 <para>
975 LXC_HOOK_TYPE: フックタイプ。'up' か 'down' のいずれかです <!-- the hook type. This is either 'up' or 'down'. -->
976 </para>
977 </listitem>
978
979 <listitem>
980 <para>
981 LXC_HOOK_SECTION: セクションタイプとして 'net' が設定されます<!-- the section type 'net'. -->
982 </para>
983 </listitem>
984
985 <listitem>
986 <para>
7dd6ead9
KY
987 LXC_NET_TYPE: ネットワークタイプ。有効なネットワークタイプのうちのひとつです (例: 'vlan', 'macvlan', 'ipvlan', 'veth') <!-- the network type. This is one of the valid
988 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth'). -->
b6feb9db
KY
989 </para>
990 </listitem>
991
992 <listitem>
993 <para>
994 LXC_NET_PARENT: ホスト上の親デバイス名。これはネットワークタイプが 'macvlan'、'veth'、'phys' のどれかのときだけ設定されます <!-- the parent device on the host. This is only
995 set for network types 'mavclan', 'veth', 'phys'. -->
996 </para>
997 </listitem>
998
999 <listitem>
1000 <para>
1001 LXC_NET_PEER: ホスト上のピアデバイス名。これはネットワークタイプが 'veth' の場合のみ設定されます。この情報は <option>lxc.hook.version</option> が 1 に設定されている場合のみ設定されます
a0a4f759 1002 <!-- the name of the peer device on the host. This is
b6feb9db
KY
1003 only set for 'veth' network types. Note that this information
1004 is only available when <option>lxc.hook.version</option> is set
1005 to 1. -->
1006 </para>
1007 </listitem>
1008 </itemizedlist>
1009
a0a4f759 1010 <!--
b6feb9db
KY
1011 Whether this information is provided in the form of environment
1012 variables or as arguments to the script depends on the value of
1013 <option>lxc.hook.version</option>. If set to 1 then information is
1014 provided in the form of environment variables. If set to 0
1015 information is provided as arguments to the script.
a0a4f759
KY
1016 -->
1017 この情報が環境変数の形で提供されるか、スクリプトへの引数の形で提供されるかは <option>lxc.hook.version</option> の値によって決まります。もし <option>lxc.hook.version</option> が 1 に設定されている場合は、環境変数の形で提供されます。もし 0 が設定されている場合は、スクリプトへの引数として提供されます。
fb261f53 1018 </para>
b6feb9db 1019
50a8555e 1020 <para>
fb261f53 1021 <!--
50a8555e
KY
1022 Standard output from the script is logged at debug level.
1023 Standard error is not logged, but can be captured by the
1024 hook redirecting its standard error to standard output.
fb261f53 1025 -->
2513f519 1026 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
50a8555e
KY
1027 </para>
1028 </listitem>
1029 </varlistentry>
1030
1031 <varlistentry>
1032 <term>
7fa3f2e9 1033 <option>lxc.net.[i].script.down</option>
50a8555e
KY
1034 </term>
1035 <listitem>
a0a4f759
KY
1036 <para>
1037 <!--
b6feb9db 1038 Add a configuration option to specify a script to be
50a8555e 1039 executed before destroying the network used from the
b6feb9db 1040 host side.
a0a4f759
KY
1041 -->
1042 ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。
b6feb9db
KY
1043 </para>
1044
1045 <para>
a0a4f759 1046 <!--
b6feb9db
KY
1047 In addition to the information available to all hooks. The
1048 following information is provided to the script:
a0a4f759
KY
1049 -->
1050 すべてのフックで追加の情報が使えます。以下の情報がスクリプトに提供されます:
b6feb9db
KY
1051 <itemizedlist>
1052 <listitem>
1053 <para>
1054 LXC_HOOK_TYPE: フックタイプ。'up' か 'down' のいずれかです <!-- the hook type. This is either 'up' or 'down'. -->
1055 </para>
1056 </listitem>
1057
1058 <listitem>
1059 <para>
1060 LXC_HOOK_SECTION: セクションタイプとして 'net' が設定されます<!-- the section type 'net'. -->
1061 </para>
1062 </listitem>
1063
1064 <listitem>
7dd6ead9
KY
1065 <para>
1066 LXC_NET_TYPE: ネットワークタイプ。有効なネットワークタイプのうちのひとつです (例: 'vlan', 'macvlan', 'ipvlan', 'veth') <!-- the network type. This is one of the valid
1067 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth'). -->
b6feb9db
KY
1068 </para>
1069 </listitem>
1070
1071 <listitem>
1072 <para>
1073 LXC_NET_PARENT: ホスト上の親デバイス名。これはネットワークタイプが 'macvlan'、'veth'、'phys' のどれかのときだけ設定されます <!-- the parent device on the host. This is only
1074 set for network types 'mavclan', 'veth', 'phys'. -->
1075 </para>
1076 </listitem>
1077
1078 <listitem>
1079 <para>
1080 LXC_NET_PEER: ホスト上のピアデバイス名。これはネットワークタイプが 'veth' の場合のみ設定されます。この情報は <option>lxc.hook.version</option> が 1 に設定されている場合のみ設定されます
a0a4f759 1081 <!-- the name of the peer device on the host. This is
b6feb9db
KY
1082 only set for 'veth' network types. Note that this information
1083 is only available when <option>lxc.hook.version</option> is set
1084 to 1. -->
1085 </para>
1086 </listitem>
1087 </itemizedlist>
1088
a0a4f759 1089 <!--
b6feb9db
KY
1090 Whether this information is provided in the form of environment
1091 variables or as arguments to the script depends on the value of
1092 <option>lxc.hook.version</option>. If set to 1 then information is
1093 provided in the form of environment variables. If set to 0
1094 information is provided as arguments to the script.
a0a4f759
KY
1095 -->
1096 この情報が環境変数の形で提供されるか、スクリプトへの引数の形で提供されるかは <option>lxc.hook.version</option> の値によって決まります。もし <option>lxc.hook.version</option> が 1 に設定されている場合は、環境変数の形で提供されます。もし 0 が設定されている場合は、スクリプトへの引数として提供されます。
fb261f53 1097 </para>
b6feb9db 1098
50a8555e 1099 <para>
fb261f53 1100 <!--
50a8555e
KY
1101 Standard output from the script is logged at debug level.
1102 Standard error is not logged, but can be captured by the
1103 hook redirecting its standard error to standard output.
fb261f53 1104 -->
2513f519 1105 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
50a8555e
KY
1106 </para>
1107 </listitem>
1108 </varlistentry>
fb261f53
KY
1109 </variablelist>
1110
1111 </refsect2>
1112
1113 <refsect2>
1114 <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title>
1115 <para>
1116 <!--
50a8555e
KY
1117 For stricter isolation the container can have its own private
1118 instance of the pseudo tty.
fb261f53 1119 -->
dc421f3a 1120 さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。
fb261f53
KY
1121 </para>
1122 <variablelist>
50a8555e
KY
1123 <varlistentry>
1124 <term>
e71b47b2 1125 <option>lxc.pty.max</option>
50a8555e
KY
1126 </term>
1127 <listitem>
1128 <para>
1129 <!--
1130 If set, the container will have a new pseudo tty
1131 instance, making this private to it. The value specifies
fb261f53
KY
1132 the maximum number of pseudo ttys allowed for a pts
1133 instance (this limitation is not implemented yet).
1134 -->
ec64264d 1135 もし設定された場合、コンテナは新しい pseudo tty インスタンスを持ち、それを自身のプライベートとします。
dc421f3a 1136 この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。
50a8555e
KY
1137 </para>
1138 </listitem>
1139 </varlistentry>
fb261f53
KY
1140 </variablelist>
1141 </refsect2>
1142
1143 <refsect2>
1144 <title><!-- Container system console -->コンテナのシステムコンソール</title>
1145 <para>
1146 <!--
50a8555e
KY
1147 If the container is configured with a root filesystem and the
1148 inittab file is setup to use the console, you may want to specify
1149 where the output of this console goes.
fb261f53 1150 -->
dc421f3a 1151 コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。
fb261f53
KY
1152 </para>
1153 <variablelist>
4d94eb7d
KY
1154
1155 <varlistentry>
1156 <term>
1157 <option>lxc.console.buffer.size</option>
1158 </term>
1159 <listitem>
1160 <para>
1161 <!--
1162 Setting this option instructs liblxc to allocate an in-memory
1163 ringbuffer. The container's console output will be written to the
1164 ringbuffer. Note that ringbuffer must be at least as big as a
1165 standard page size. When passed a value smaller than a single page
1166 size liblxc will allocate a ringbuffer of a single page size. A page
15c22687 1167 size is usually 4KB.
4d94eb7d 1168 -->
15c22687 1169 このオプションを設定すると、liblxc はインメモリのリングバッファを割り当てます。コンテナのコンソールはリングバッファに出力されます。リングバッファは少なくとも標準ページサイズの大きさでなければなりません。ページサイズより小さい値を与えた場合は、liblxc はページサイズのリングバッファを割り当てます。ページサイズは通常は 4KB です。
4d94eb7d
KY
1170
1171 <!--
1172 The keyword 'auto' will cause liblxc to allocate a ringbuffer of
15c22687 1173 128KB.
4d94eb7d 1174 -->
15c22687 1175 'auto' を指定すると、liblxc は 128KB のリングバッファを割り当てます。
4d94eb7d
KY
1176
1177 <!--
1178 When manually specifying a size for the ringbuffer the value should
1179 be a power of 2 when converted to bytes. Valid size prefixes are
15c22687
KY
1180 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
1181 of 1024. That means 'Kb' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
1182 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
1183 'Kb' are treated equally.)
4d94eb7d 1184 -->
15c22687 1185 リングバッファサイズを数値指定する場合、値がバイトに変換されるときに 2 の累乗になります。サイズ接頭辞付きの単位として 'KB'、'MB'、'GB' が使えます。(この場合の変換は 1024 の倍数に基づいています。つまり 'KB' == 'KiB'、'MB' == 'MiB'、'GB' == 'GiB' という意味です。加えて、単位の大文字小文字は無視されます。すなわち 'kB'、'KB'、'Kb' は同一に扱われます。)
4d94eb7d
KY
1186 </para>
1187 </listitem>
1188 </varlistentry>
1189
1190 <varlistentry>
1191 <term>
d9874b21 1192 <option>lxc.console.size</option>
4d94eb7d
KY
1193 </term>
1194 <listitem>
1195 <para>
1196 <!--
d9874b21
KY
1197 Setting this option instructs liblxc to place a limit on the size of
1198 the console log file specified in
1199 <option>lxc.console.logfile</option>. Note that size of the log file
1200 must be at least as big as a standard page size. When passed a value
1201 smaller than a single page size liblxc will set the size of log file
15c22687 1202 to a single page size. A page size is usually 4KB.
4d94eb7d 1203 -->
15c22687 1204 liblxc は <option>lxc.console.logfile</option> で指定したコンソールログのサイズを、このオプションで設定した値に制限します。ログファイルのサイズは少なくとも標準ページサイズでなければなりません。ページサイズ以下の値を設定した場合は、liblxc はログファイルのサイズをページサイズに設定します。ページサイズは通常は 4KB です。
4d94eb7d
KY
1205
1206 <!--
15c22687 1207 The keyword 'auto' will cause liblxc to place a limit of 128KB on
d9874b21 1208 the log file.
4d94eb7d 1209 -->
15c22687 1210 'auto' を指定すると、liblxc はログファイルのサイズを 128KB に制限します。
d9874b21
KY
1211
1212 <!--
1213 When manually specifying a size for the log file the value should
1214 be a power of 2 when converted to bytes. Valid size prefixes are
15c22687
KY
1215 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
1216 of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
1217 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
1218 'Kb' are treated equally.)
d9874b21 1219 -->
15c22687 1220 ログファイルサイズの値を数値指定する場合、値がバイトに変換されるときに 2 の累乗になります。サイズ接頭辞付きの単位として 'kB'、'MB'、'GB' が使えます。(この場合の変換は 1024 の倍数に基づいています。つまり 'kB' == 'KiB'、'MB' == 'MiB'、'GB' == 'GiB' という意味です。加えて、単位の大文字小文字は無視されます。すなわち 'kB'、'KB'、'Kb' は同一に扱われます。)
d9874b21
KY
1221
1222 <!--
1223 If users want to mirror the console ringbuffer on disk they should set
1224 <option>lxc.console.size</option> equal to
1225 <option>lxc.console.buffer.size</option>.
1226 -->
1227 ディスク上のコンソールリングバッファとミラーになるようにしたい場合は、<option>lxc.console.size</option> と <option>lxc.console.buffer.size</option> の値を同じ値に設定します。
4d94eb7d
KY
1228 </para>
1229 </listitem>
1230 </varlistentry>
1231
50a8555e
KY
1232 <varlistentry>
1233 <term>
1234 <option>lxc.console.logfile</option>
1235 </term>
1236 <listitem>
1237 <para>
fb261f53 1238 <!--
4d94eb7d
KY
1239 Specify a path to a file where the console output will be written.
1240 Note that in contrast to the on-disk ringbuffer logfile this file
1241 will keep growing potentially filling up the users disks if not
1242 rotated and deleted. This problem can also be avoided by using the
1243 in-memory ringbuffer options
1244 <option>lxc.console.buffer.size</option> and
1245 <option>lxc.console.buffer.logfile</option>.
48e60dfe 1246 -->
4d94eb7d 1247 コンソール出力を書き込むファイルのパスを指定します。ディスクに保存されるリングバッファログと異なり、このファイルはサイズが大きくなり続けるので、ファイルがローテートや削除されない限りは、ユーザのディスクをいっぱいにしてしまう可能性があります。この問題は、インメモリのリングバッファオプションである、<option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも回避できます。
50a8555e
KY
1248 </para>
1249 </listitem>
1250 </varlistentry>
4d94eb7d
KY
1251
1252 <varlistentry>
1253 <term>
1254 <option>lxc.console.rotate</option>
1255 </term>
1256 <listitem>
1257 <para>
1258 <!--
1259 Whether to rotate the console logfile specified in
1260 <option>lxc.console.logfile</option>. Users can send an API
1261 request to rotate the logfile. Note that the old logfile will have
1262 the same name as the original with the suffix ".1" appended.
1263 -->
1264 <option>lxc.console.logfile</option> で指定したコンソールログファイルをローテートするかどうかを指定します。ユーザはログファイルをローテートするように API リクエストを送ることができます。古いログファイルは、元のファイル名と同じ名前のファイルに ".1" というサフィックスが付け加わります。
1265
1266 <!--
1267 Users wishing to prevent the console log file from filling the
1268 disk should rotate the logfile and delete it if unneeded. This
1269 problem can also be avoided by using the in-memory ringbuffer
1270 options <option>lxc.console.buffer.size</option> and
1271 <option>lxc.console.buffer.logfile</option>.
1272 -->
1273 ユーザがコンソールログでディスクがいっぱいになるのを防ぐには、ログファイルをローテートし、不要なログファイルを削除してください。この問題はインメモリのリングバッファオプションである <option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも防げます。
1274 </para>
1275 </listitem>
1276 </varlistentry>
1277
50a8555e
KY
1278 <varlistentry>
1279 <term>
e71b47b2 1280 <option>lxc.console.path</option>
50a8555e
KY
1281 </term>
1282 <listitem>
7a534f67 1283 <para>
48e60dfe 1284 <!--
7a534f67
KY
1285 Specify a path to a device to which the console will be
1286 attached. The keyword 'none' will simply disable the
1287 console. Note, when specifying 'none' and creating a device node
1288 for the console in the container at /dev/console or bind-mounting
1289 the hosts's /dev/console into the container at /dev/console the
1290 container will have direct access to the hosts's /dev/console.
1291 This is dangerous when the container has write access to the
1292 device and should thus be used with caution.
1293 -->
48e60dfe 1294 コンソールを割り当てるデバイスのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。
7a534f67
KY
1295 'none' を指定し、コンテナ内のコンソールに対するデバイスノードを /dev/console に作成するか、もしくはホストの /dev/console をコンテナ内の /dev/console に bind mount する場合、そのコンテナはホストの /dev/console へ直接アクセスを行うことに注意が必要です。
1296 そのコンテナがデバイスへの書き込み権を持っている場合は危険ですので、注意してこの指定を使用する必要があります。
1297 </para>
50a8555e
KY
1298 </listitem>
1299 </varlistentry>
fb261f53
KY
1300 </variablelist>
1301 </refsect2>
1302
1303 <refsect2>
1304 <title><!-- Console through the ttys -->tty を通したコンソール</title>
1305 <para>
1306 <!--
50a8555e
KY
1307 This option is useful if the container is configured with a root
1308 filesystem and the inittab file is setup to launch a getty on the
1309 ttys. The option specifies the number of ttys to be available for
1310 the container. The number of gettys in the inittab file of the
1311 container should not be greater than the number of ttys specified
1312 in this option, otherwise the excess getty sessions will die and
1313 respawn indefinitely giving annoying messages on the console or in
1314 <filename>/var/log/messages</filename>.
fb261f53 1315 -->
dc421f3a
KY
1316 このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。
1317 このオプションはコンテナで利用できる tty の数を指定します。
1318 inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。
1319 さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。
fb261f53
KY
1320 </para>
1321 <variablelist>
50a8555e
KY
1322 <varlistentry>
1323 <term>
e71b47b2 1324 <option>lxc.tty.max</option>
50a8555e
KY
1325 </term>
1326 <listitem>
1327 <para>
fb261f53 1328 <!--
50a8555e
KY
1329 Specify the number of tty to make available to the
1330 container.
fb261f53 1331 -->
dc421f3a 1332 コンテナに作成出来る tty の数を指定します。
50a8555e
KY
1333 </para>
1334 </listitem>
1335 </varlistentry>
fb261f53
KY
1336 </variablelist>
1337 </refsect2>
1338
1339 <refsect2>
1340 <title><!-- Console devices location -->コンソールデバイスの位置</title>
1341 <para>
1342 <!--
1343 LXC consoles are provided through Unix98 PTYs created on the
50a8555e
KY
1344 host and bind-mounted over the expected devices in the container.
1345 By default, they are bind-mounted over <filename>/dev/console</filename>
1346 and <filename>/dev/ttyN</filename>. This can prevent package upgrades
1347 in the guest. Therefore you can specify a directory location (under
1348 <filename>/dev</filename> under which LXC will create the files and
1349 bind-mount over them. These will then be symbolically linked to
1350 <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>.
1351 A package upgrade can then succeed as it is able to remove and replace
1352 the symbolic links.
fb261f53 1353 -->
dc421f3a
KY
1354 LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。
1355 デフォルトでは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> に bind マウントされます。
1356 これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。
1357 なので <filename>/dev</filename> 以下のディレクトリを指定することができます。
1358 LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。
1359 そして、これらの (作成された) ファイルは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> にシンボリックリンクされます。
1360 シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。
fb261f53
KY
1361 </para>
1362 <variablelist>
50a8555e
KY
1363 <varlistentry>
1364 <term>
e71b47b2 1365 <option>lxc.tty.dir</option>
50a8555e
KY
1366 </term>
1367 <listitem>
7a534f67 1368 <para>
fb261f53 1369 <!--
7a534f67
KY
1370 Specify a directory under <filename>/dev</filename>
1371 under which to create the container console devices. Note that LXC
1372 will move any bind-mounts or device nodes for /dev/console into
1373 this directory.
1374 -->
dc421f3a 1375 コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。
7a534f67
KY
1376 LXC は /dev/console に対する bind mount や /dev/console デバイスノードをこのディレクトリ以下に移動することに注意が必要です。
1377 </para>
50a8555e
KY
1378 </listitem>
1379 </varlistentry>
fb261f53
KY
1380 </variablelist>
1381 </refsect2>
1382
1383 <refsect2>
1384 <title><!-- /dev directory -->/dev ディレクトリ</title>
1385 <para>
1386 <!--
50a8555e
KY
1387 By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr)
1388 in the container's <filename>/dev</filename> directory but does not
1389 automatically create device node entries. This allows the container's
1390 <filename>/dev</filename> to be set up as needed in the container
1391 rootfs. If lxc.autodev is set to 1, then after mounting the container's
1392 rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename>
1393 (limited to 500k) and fill in a minimal set of initial devices.
fb261f53
KY
1394 This is generally required when starting a container containing
1395 a "systemd" based "init" but may be optional at other times. Additional
1396 devices in the containers /dev directory may be created through the
1397 use of the <option>lxc.hook.autodev</option> hook.
1398 -->
dc421f3a
KY
1399 デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。
1400 これは、コンテナの rootfs で必要な設定を行えるようにするものです。
c35d2909 1401 lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (500k 制限の)。
dc421f3a
KY
1402 そして初期デバイスの最小限のセットを作成します。
1403 これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。
1404 コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。
fb261f53
KY
1405 </para>
1406 <variablelist>
50a8555e
KY
1407 <varlistentry>
1408 <term>
1409 <option>lxc.autodev</option>
1410 </term>
1411 <listitem>
1412 <para>
fb261f53 1413 <!--
a9516fe5
KY
1414 Set this to 0 to stop LXC from mounting and populating a minimal
1415 <filename>/dev</filename> when starting the container.
fb261f53 1416 -->
a9516fe5 1417 コンテナの起動時に LXC が /dev をマウントして最小限の /dev を作成するのを止めるには、この値を 0 に設定してください。
50a8555e
KY
1418 </para>
1419 </listitem>
1420 </varlistentry>
fb261f53
KY
1421 </variablelist>
1422 </refsect2>
1423
fb261f53
KY
1424 <refsect2>
1425 <title><!-- Mount points -->マウントポイント</title>
1426 <para>
1427 <!--
50a8555e
KY
1428 The mount points section specifies the different places to be
1429 mounted. These mount points will be private to the container
1430 and won't be visible by the processes running outside of the
1431 container. This is useful to mount /etc, /var or /home for
1432 examples.
fb261f53 1433 -->
dc421f3a
KY
1434 マウントポイントセクションは、マウントするための区別された場所を指定します。
1435 これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。
1436 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。
fb261f53 1437 </para>
2c79e91b 1438 <para>
50a8555e
KY
1439 <!--
1440 NOTE - LXC will generally ensure that mount targets and relative
1441 bind-mount sources are properly confined under the container
1442 root, to avoid attacks involving over-mounting host directories
1443 and files. (Symbolic links in absolute mount sources are ignored)
1444 However, if the container configuration first mounts a directory which
1445 is under the control of the container user, such as /home/joe, into
2c79e91b
KY
1446 the container at some <filename>path</filename>, and then mounts
1447 under <filename>path</filename>, then a TOCTTOU attack would be
1448 possible where the container user modifies a symbolic link under
1449 his home directory at just the right time.
50a8555e
KY
1450 -->
1451 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。
1452 これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。)
1453 しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。
2c79e91b 1454 </para>
fb261f53 1455 <variablelist>
50a8555e
KY
1456 <varlistentry>
1457 <term>
e71b47b2 1458 <option>lxc.mount.fstab</option>
50a8555e
KY
1459 </term>
1460 <listitem>
1461 <para>
1462 <!--
1463 specify a file location in
1464 the <filename>fstab</filename> format, containing the
1465 mount information. The mount target location can and in
1466 most cases should be a relative path, which will become
1467 relative to the mounted container root. For instance,
e053b31e
KY
1468 -->
1469 マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。
1470 マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。
50a8555e 1471 </para>
2513f519
KY
1472 <programlisting>
1473 proc proc proc nodev,noexec,nosuid 0 0
1474 </programlisting>
50a8555e 1475 <para>
e053b31e 1476 <!--
50a8555e
KY
1477 Will mount a proc filesystem under the container's /proc,
1478 regardless of where the root filesystem comes from. This
1479 is resilient to block device backed filesystems as well as
1480 container cloning.
e053b31e 1481 -->
2513f519 1482 この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。
50a8555e
KY
1483 </para>
1484 <para>
e053b31e 1485 <!--
50a8555e
KY
1486 Note that when mounting a filesystem from an
1487 image file or block device the third field (fs_vfstype)
1488 cannot be auto as with
fb261f53 1489 <citerefentry>
50a8555e 1490 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1491 <manvolnum>8</manvolnum>
1492 </citerefentry>
1493 but must be explicitly specified.
1494 -->
dc421f3a 1495 ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は
fb261f53 1496 <citerefentry>
50a8555e 1497 <refentrytitle>mount</refentrytitle>
fb261f53
KY
1498 <manvolnum>8</manvolnum>
1499 </citerefentry>
dc421f3a 1500 のように auto を指定することはできず、明確に指定しなければいけません。
50a8555e
KY
1501 </para>
1502 </listitem>
1503 </varlistentry>
fb261f53 1504
50a8555e
KY
1505 <varlistentry>
1506 <term>
1507 <option>lxc.mount.entry</option>
1508 </term>
1509 <listitem>
1510 <para>
fb261f53 1511 <!--
07410c63 1512 Specify a mount point corresponding to a line in the
50a8555e 1513 fstab format.
fb261f53 1514 -->
dc421f3a 1515 fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。
b332333b
KY
1516
1517 <!--
07410c63
KY
1518 Moreover lxc supports mount propagation, such as rslave or
1519 rprivate, and adds three additional mount options.
b332333b
KY
1520 <option>optional</option> don't fail if mount does not work.
1521 <option>create=dir</option> or <option>create=file</option>
1522 to create dir (or file) when the point will be mounted.
a0a4f759
KY
1523 <option>relative</option> source path is taken to be relative to
1524 the mounted container root. For instance,
b332333b 1525 -->
07410c63 1526 加えて、LXC では rslave や rprivate といったマウント・プロパゲーションオプションと、独自の 3 つのマウントオプションが使えます。
b332333b
KY
1527 <option>optional</option> は、マウントが失敗しても失敗を返さずに無視します。
1528 <option>create=dir</option> と <option>create=file</option> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。
a0a4f759 1529 <option>relative</option> を指定すると、マウントされたコンテナルートからの相対パスとして取得されます。
50a8555e 1530 </para>
a0a4f759
KY
1531 <screen>
1532 dev/null proc/kcore none bind,relative 0 0
1533 </screen>
1534 <para>
1535 <!--
1536 Will expand dev/null to ${<option>LXC_ROOTFS_MOUNT</option>}/dev/null,
1537 and mount it to proc/kcore inside the container.
1538 -->
1539 は dev/null を ${<option>LXC_ROOTFS_MOUNT</option>}/dev/null と展開し、コンテナ内の proc/kcore にマウントします。
1540 </para>
50a8555e
KY
1541 </listitem>
1542 </varlistentry>
fb261f53 1543
50a8555e
KY
1544 <varlistentry>
1545 <term>
1546 <option>lxc.mount.auto</option>
1547 </term>
1548 <listitem>
1549 <para>
fb261f53 1550 <!--
50a8555e
KY
1551 specify which standard kernel file systems should be
1552 automatically mounted. This may dramatically simplify
1553 the configuration. The file systems are:
fb261f53 1554 -->
dc421f3a
KY
1555 標準のカーネルファイルシステムで自動的にマウントするものを指定します。
1556 これは劇的に設定を容易にする可能性があります。
50a8555e
KY
1557 </para>
1558 <itemizedlist>
1559 <listitem>
50a8555e
KY
1560 <para>
1561 <option>proc:mixed</option> (or <option>proc</option>):
3f163e45 1562 <!--
50a8555e
KY
1563 mount <filename>/proc</filename> as read-write, but
1564 remount <filename>/proc/sys</filename> and
1565 <filename>/proc/sysrq-trigger</filename> read-only
1566 for security / container isolation purposes.
fb261f53 1567 -->
dc421f3a
KY
1568 <filename>/proc</filename> を読み書き可能でマウントします。
1569 ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。
fb261f53 1570 </para>
50a8555e
KY
1571 </listitem>
1572 <listitem>
50a8555e 1573 <para>
3f163e45
KY
1574 <option>proc:rw</option>:
1575 <!--
50a8555e 1576 <filename>/proc</filename> as read-write
fb261f53 1577 -->
dc421f3a 1578 <filename>/proc</filename> を読み書き可能でマウントします。
fb261f53 1579 </para>
50a8555e
KY
1580 </listitem>
1581 <listitem>
dd93ef87
KY
1582 <para>
1583 <option>sys:mixed</option> (or <option>sys</option>):
3f163e45 1584 <!--
dd93ef87
KY
1585 mount <filename>/sys</filename> as read-only but with
1586 /sys/devices/virtual/net writable.
50a8555e 1587 -->
50a8555e
KY
1588 /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。
1589 </para>
dd93ef87 1590 </listitem>
50a8555e 1591 <listitem>
50a8555e 1592 <para>
3f163e45
KY
1593 <option>sys:ro</option>:
1594 <!--
50a8555e
KY
1595 mount <filename>/sys</filename> as read-only
1596 for security / container isolation purposes.
fb261f53 1597 -->
dc421f3a 1598 <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。
fb261f53 1599 </para>
50a8555e
KY
1600 </listitem>
1601 <listitem>
50a8555e 1602 <para>
3f163e45
KY
1603 <option>sys:rw</option>:
1604 <!--
50a8555e 1605 <filename>/sys</filename> as read-write
fb261f53 1606 -->
dc421f3a 1607 <filename>/sys</filename> を読み書き可能でマウントします。
fb261f53 1608 </para>
50a8555e
KY
1609 </listitem>
1610 <listitem>
50a8555e
KY
1611 <para>
1612 <option>cgroup:mixed</option>:
3f163e45
KY
1613 <!--
1614 Mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1615 create directories for all hierarchies to which the container
1616 is added, create subdirectories in those hierarchies with the
1617 name of the cgroup, and bind-mount the container's own cgroup
1618 into that directory. The container will be able to write to
1619 its own cgroup directory, but not the parents, since they will
1620 be remounted read-only.
1621 -->
1622 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層に対するディレクトリを作成し、それらの階層内に cgroup 名でサブディレクトリを作成し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。
50a8555e 1623 </para>
3f163e45
KY
1624 </listitem>
1625
1626 <listitem>
fb261f53 1627 <para>
3f163e45
KY
1628 <option>cgroup:mixed:force</option>:
1629 <!--
1630 The <option>force</option> option will cause LXC to perform
1631 the cgroup mounts for the container under all circumstances.
1632 Otherwise it is similar to <option>cgroup:mixed</option>.
1633 This is mainly useful when the cgroup namespaces are enabled
1634 where LXC will normally leave mounting cgroups to the init
1635 binary of the container since it is perfectly safe to do so.
1636 -->
3e2bb54b 1637 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:mixed</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
fb261f53 1638 </para>
50a8555e 1639 </listitem>
3f163e45 1640
50a8555e 1641 <listitem>
50a8555e 1642 <para>
3f163e45
KY
1643 <option>cgroup:ro</option>:
1644 <!--
50a8555e
KY
1645 <option>cgroup:mixed</option>, but everything will
1646 be mounted read-only.
fb261f53 1647 -->
dc421f3a 1648 <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1649 </para>
50a8555e 1650 </listitem>
3f163e45 1651
50a8555e 1652 <listitem>
50a8555e 1653 <para>
3f163e45
KY
1654 <option>cgroup:ro:force</option>:
1655 <!--
1656 The <option>force</option> option will cause LXC to perform
1657 the cgroup mounts for the container under all circumstances.
1658 Otherwise it is similar to <option>cgroup:ro</option>.
1659 This is mainly useful when the cgroup namespaces are enabled
1660 where LXC will normally leave mounting cgroups to the init
1661 binary of the container since it is perfectly safe to do so.
1662 -->
3e2bb54b 1663 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:ro</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
50a8555e 1664 </para>
3f163e45
KY
1665 </listitem>
1666
1667 <listitem>
fb261f53 1668 <para>
50a8555e 1669 <option>cgroup:rw</option>:
3f163e45
KY
1670 <!--
1671 <option>cgroup:mixed</option>, but everything will be mounted
1672 read-write. Note that the paths leading up to the container's
1673 own cgroup will be writable, but will not be a cgroup
1674 filesystem but just part of the tmpfs of
1675 <filename>/sys/fs/cgroup</filename>
1676 -->
dc421f3a
KY
1677 <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。
1678 コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、
1679 <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。
fb261f53 1680 </para>
50a8555e 1681 </listitem>
3f163e45
KY
1682
1683 <listitem>
1684 <para>
1685 <option>cgroup:rw:force</option>:
1686 <!--
1687 The <option>force</option> option will cause LXC to perform
1688 the cgroup mounts for the container under all circumstances.
1689 Otherwise it is similar to <option>cgroup:rw</option>.
1690 This is mainly useful when the cgroup namespaces are enabled
1691 where LXC will normally leave mounting cgroups to the init
1692 binary of the container since it is perfectly safe to do so.
1693 -->
3e2bb54b 1694 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:rw</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
3f163e45
KY
1695 </para>
1696 </listitem>
1697
50a8555e
KY
1698 <listitem>
1699 <para>
3f163e45 1700 <option>cgroup</option> (マウントオプションなしの場合):
aafea1f7 1701 <!--
50a8555e
KY
1702 defaults to <option>cgroup:rw</option> if the
1703 container retains the CAP_SYS_ADMIN capability,
1704 <option>cgroup:mixed</option> otherwise.
aafea1f7 1705 -->
aafea1f7 1706 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。
50a8555e
KY
1707 </para>
1708 </listitem>
dc55f005 1709
50a8555e 1710 <listitem>
50a8555e
KY
1711 <para>
1712 <option>cgroup-full:mixed</option>:
3f163e45 1713 <!--
50a8555e
KY
1714 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1715 create directories for all hierarchies to which
1716 the container is added, bind-mount the hierarchies
1717 from the host to the container and make everything
1718 read-only except the container's own cgroup. Note
1719 that compared to <option>cgroup</option>, where
1720 all paths leading up to the container's own cgroup
1721 are just simple directories in the underlying
1722 tmpfs, here
1723 <filename>/sys/fs/cgroup/$hierarchy</filename>
1724 will contain the host's full cgroup hierarchy,
1725 albeit read-only outside the container's own cgroup.
1726 This may leak quite a bit of information into the
1727 container.
fb261f53 1728 -->
dc421f3a
KY
1729 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。
1730 <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。
1731 これにより、コンテナにはかなりの情報が漏洩します。
fb261f53 1732 </para>
50a8555e 1733 </listitem>
dc55f005
KY
1734
1735 <listitem>
1736 <para>
1737 <option>cgroup-full:mixed:force</option>:
1738 <!--
1739 The <option>force</option> option will cause LXC to perform
1740 the cgroup mounts for the container under all circumstances.
1741 Otherwise it is similar to <option>cgroup-full:mixed</option>.
1742 This is mainly useful when the cgroup namespaces are enabled
1743 where LXC will normally leave mounting cgroups to the init
1744 binary of the container since it is perfectly safe to do so.
1745 -->
1746 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:mixed</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1747 </para>
1748 </listitem>
1749
50a8555e 1750 <listitem>
50a8555e 1751 <para>
3f163e45
KY
1752 <option>cgroup-full:ro</option>:
1753 <!--
1754 similar to
50a8555e
KY
1755 <option>cgroup-full:mixed</option>, but everything
1756 will be mounted read-only.
fb261f53 1757 -->
dc421f3a 1758 <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
fb261f53 1759 </para>
50a8555e 1760 </listitem>
dc55f005
KY
1761
1762 <listitem>
1763 <para>
1764 <option>cgroup-full:ro:force</option>:
1765 <!--
1766 The <option>force</option> option will cause LXC to perform
1767 the cgroup mounts for the container under all circumstances.
1768 Otherwise it is similar to <option>cgroup-full:ro</option>.
1769 This is mainly useful when the cgroup namespaces are enabled
1770 where LXC will normally leave mounting cgroups to the init
1771 binary of the container since it is perfectly safe to do so.
1772 -->
1773 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:ro</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1774 </para>
1775 </listitem>
1776
50a8555e 1777 <listitem>
50a8555e 1778 <para>
3f163e45
KY
1779 <option>cgroup-full:rw</option>:
1780 <!--
1781 similar to
50a8555e
KY
1782 <option>cgroup-full:mixed</option>, but everything
1783 will be mounted read-write. Note that in this case,
1784 the container may escape its own cgroup. (Note also
1785 that if the container has CAP_SYS_ADMIN support
1786 and can mount the cgroup filesystem itself, it may
1787 do so anyway.)
fb261f53 1788 -->
50a8555e 1789 <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。
dc421f3a 1790 この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。
fb261f53 1791 </para>
50a8555e 1792 </listitem>
dc55f005
KY
1793
1794 <listitem>
1795 <para>
1796 <option>cgroup-full:rw:force</option>:
1797 <!--
1798 The <option>force</option> option will cause LXC to perform
1799 the cgroup mounts for the container under all circumstances.
1800 Otherwise it is similar to <option>cgroup-full:rw</option>.
1801 This is mainly useful when the cgroup namespaces are enabled
1802 where LXC will normally leave mounting cgroups to the init
1803 binary of the container since it is perfectly safe to do so.
1804 -->
1805 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:rw</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1806 </para>
1807 </listitem>
1808
50a8555e
KY
1809 <listitem>
1810 <para>
aafea1f7 1811 <!--
50a8555e
KY
1812 <option>cgroup-full</option> (without specifier):
1813 defaults to <option>cgroup-full:rw</option> if the
1814 container retains the CAP_SYS_ADMIN capability,
1815 <option>cgroup-full:mixed</option> otherwise.
aafea1f7 1816 -->
50a8555e 1817 <option>cgroup-full</option> (マウントオプションなしの場合):
aafea1f7 1818 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。
50a8555e
KY
1819 </para>
1820 </listitem>
dc55f005 1821
50a8555e
KY
1822 </itemizedlist>
1823 <para>
1824 <!--
1825 If cgroup namespaces are enabled, then any <option>cgroup</option>
1826 auto-mounting request will be ignored, since the container can
1827 mount the filesystems itself, and automounting can confuse the
1828 container init.
1829 -->
1830 cgroup 名前空間が有効の場合、<option>cgroup</option> の自動マウントの指定はどれも無視されます。これは、コンテナが自身でファイルシステムをマウントするため、自動マウントがコンテナの init を混乱させる可能性があるためです。
1831 </para>
1832 <para>
1833 <!--
1834 Note that if automatic mounting of the cgroup filesystem
1835 is enabled, the tmpfs under
1836 <filename>/sys/fs/cgroup</filename> will always be
1837 mounted read-write (but for the <option>:mixed</option>
1838 and <option>:ro</option> cases, the individual
1839 hierarchies,
1840 <filename>/sys/fs/cgroup/$hierarchy</filename>, will be
1841 read-only). This is in order to work around a quirk in
1842 Ubuntu's
1843 <citerefentry>
1844 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1845 <manvolnum>8</manvolnum>
1846 </citerefentry>
50a8555e
KY
1847 command that will cause containers to wait for user
1848 input at boot if
1849 <filename>/sys/fs/cgroup</filename> is mounted read-only
1850 and the container can't remount it read-write due to a
1851 lack of CAP_SYS_ADMIN.
cf5f3128
KY
1852 -->
1853 cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の
1854 <citerefentry>
50a8555e 1855 <refentrytitle>mountall</refentrytitle>
cf5f3128
KY
1856 <manvolnum>8</manvolnum>
1857 </citerefentry>
1858 コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。
50a8555e
KY
1859 </para>
1860 <para>
fb261f53 1861 <!--
50a8555e 1862 Examples:
fb261f53
KY
1863 -->
1864 例:
50a8555e
KY
1865 </para>
1866 <programlisting>
1867 lxc.mount.auto = proc sys cgroup
1868 lxc.mount.auto = proc:rw sys:rw cgroup-full:rw
1869 </programlisting>
1870 </listitem>
1871 </varlistentry>
fb261f53
KY
1872
1873 </variablelist>
1874 </refsect2>
1875
1876 <refsect2>
1877 <title><!-- Root file system -->ルートファイルシステム</title>
1878 <para>
1879 <!--
50a8555e
KY
1880 The root file system of the container can be different than that
1881 of the host system.
fb261f53 1882 -->
dc421f3a 1883 コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。
fb261f53
KY
1884 </para>
1885 <variablelist>
50a8555e
KY
1886 <varlistentry>
1887 <term>
a64f3157 1888 <option>lxc.rootfs.path</option>
50a8555e
KY
1889 </term>
1890 <listitem>
1891 <para>
1892 <!--
1893 specify the root file system for the container. It can
1894 be an image file, a directory or a block device. If not
1895 specified, the container shares its root file system
1896 with the host.
fb261f53 1897 -->
8b3374e5 1898 コンテナのルートファイルシステムを指定します。
dc421f3a
KY
1899 この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。
1900 もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。
50a8555e
KY
1901 </para>
1902 <para>
a4dbc45f
KY
1903 <!--
1904 For directory or simple block-device backed containers,
1905 a pathname can be used. If the rootfs is backed by a nbd
1906 device, then <filename>nbd:file:1</filename> specifies that
1907 <filename>file</filename> should be attached to a nbd device,
1908 and partition 1 should be mounted as the rootfs.
1909 <filename>nbd:file</filename> specifies that the nbd device
1910 itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
1911 specifies that the rootfs should be an overlay with <filename>/upper</filename>
1912 being mounted read-write over a read-only mount of <filename>/lower</filename>.
07a911c8 1913 For <filename>overlayfs</filename> multiple <filename>/lower</filename>
ddf81220 1914 directories can be specified. <filename>loop:/file</filename> tells lxc to attach
a4dbc45f
KY
1915 <filename>/file</filename> to a loop device and mount the loop device.
1916 -->
1917 ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。
1918 もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。
1919 <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。
1920 <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。
07a911c8 1921 <filename>overlayfs</filename> は、複数の <filename>/lower</filename> ディレクトリを指定できます。
a4dbc45f 1922 <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。
50a8555e
KY
1923 </para>
1924 </listitem>
1925 </varlistentry>
1926
1927 <varlistentry>
1928 <term>
1929 <option>lxc.rootfs.mount</option>
1930 </term>
1931 <listitem>
1932 <para>
1933 <!--
a64f3157 1934 where to recursively bind <option>lxc.rootfs.path</option>
50a8555e
KY
1935 before pivoting. This is to ensure success of the
1936 <citerefentry>
1937 <refentrytitle><command>pivot_root</command></refentrytitle>
1938 <manvolnum>8</manvolnum>
1939 </citerefentry>
1940 syscall. Any directory suffices, the default should
1941 generally work.
fb261f53 1942 -->
a64f3157 1943 root ファイルシステムの変更の前に、<option>lxc.rootfs.path</option> を再帰的にどこにバインドするのかを指定します。これは
50a8555e
KY
1944 <citerefentry>
1945 <refentrytitle><command>pivot_root</command></refentrytitle>
1946 <manvolnum>8</manvolnum>
1947 </citerefentry>
dc421f3a
KY
1948 システムコールが確実に成功する事を保証します。
1949 どんなディレクトリでも良く、デフォルトでも通常は動くはずです。
50a8555e
KY
1950 </para>
1951 </listitem>
1952 </varlistentry>
fb261f53 1953
50a8555e
KY
1954 <varlistentry>
1955 <term>
1956 <option>lxc.rootfs.options</option>
1957 </term>
1958 <listitem>
1959 <para>
b4c66de1 1960 <!--
50a8555e 1961 extra mount options to use when mounting the rootfs.
b4c66de1 1962 -->
dc421f3a 1963 rootfs をマウントするときに追加したいマウントオプション。
50a8555e
KY
1964 </para>
1965 </listitem>
e3136289
KY
1966 </varlistentry>
1967
1968 <varlistentry>
1969 <term>
1970 <option>lxc.rootfs.managed</option>
1971 </term>
1972 <listitem>
1973 <para>
1974 <!--
1975 Set this to 0 to indicate that LXC is not managing the
1976 container storage, then LXC will not modify the
1977 container storage. The default is 1.
1978 -->
1979 LXC がコンテナのストレージを管理していない場合は、この値を 0 に設定します。
1980 0 に設定すると、LXC はコンテナのストレージを変更しません。デフォルト値は 1 です。
1981 </para>
1982 </listitem>
50a8555e 1983 </varlistentry>
b4c66de1 1984
fb261f53
KY
1985 </variablelist>
1986 </refsect2>
1987
1988 <refsect2>
1989 <title>Control group</title>
1990 <para>
1991 <!--
50a8555e
KY
1992 The control group section contains the configuration for the
1993 different subsystem. <command>lxc</command> does not check the
1994 correctness of the subsystem name. This has the disadvantage
1995 of not detecting configuration errors until the container is
1996 started, but has the advantage of permitting any future
1997 subsystem.
fb261f53 1998 -->
dc421f3a
KY
1999 CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。
2000 <command>lxc</command> は、このサブシステム名の正しさはチェックしません。
2001 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。
fb261f53
KY
2002 </para>
2003 <variablelist>
50a8555e
KY
2004 <varlistentry>
2005 <term>
25fa6f8c 2006 <option>lxc.cgroup.[control name]</option>
50a8555e
KY
2007 </term>
2008 <listitem>
2009 <para>
2010 <!--
20216658
KY
2011 Specify the control group value to be set on a legacy cgroup
2012 hierarchy. The controller name is the literal name of the control
2013 group. The permitted names and the syntax of their values is not
2014 dictated by LXC, instead it depends on the features of the Linux
2015 kernel running at the time the container is started, eg.
2016 <option>lxc.cgroup.cpuset.cpus</option>
fb261f53 2017 -->
20216658
KY
2018 legacy な cgroup 階層 (cgroup v1) に設定する値を指定します。コントローラー名は control group そのままの名前です。
2019 許される名前や値の書式は LXC が指定することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
2020 例えば <option>lxc.cgroup.cpuset.cpus</option> のようになります。
2021 </para>
2022 </listitem>
2023 </varlistentry>
2024 <varlistentry>
2025 <term>
2026 <option>lxc.cgroup2.[controller name]</option>
2027 </term>
2028 <listitem>
2029 <para>
2030 <!--
2031 Specify the control group value to be set on the unified cgroup
d0d68468 2032 hierarchy. The controller name is the literal name of the control
20216658
KY
2033 group. The permitted names and the syntax of their values is not
2034 dictated by LXC, instead it depends on the features of the Linux
2035 kernel running at the time the container is started, eg.
2036 <option>lxc.cgroup2.memory.high</option>
2037 -->
2038 単一の cgroup 階層 (cgroup v2) に設定する値を指定します。
2039 許される名前や値の書式は LXC が指定することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
2040 例えば <option>lxc.cgroup2.memory.high</option> のようになります。
50a8555e
KY
2041 </para>
2042 </listitem>
2043 </varlistentry>
78be8d75
KY
2044 <varlistentry>
2045 <term>
2046 <option>lxc.cgroup.dir</option>
2047 </term>
2048 <listitem>
2049 <para>
4eeecbdb 2050 <!--
78be8d75
KY
2051 specify a directory or path in which the container's cgroup will
2052 be created. For example, setting
2053 <option>lxc.cgroup.dir = my-cgroup/first</option> for a container
2054 named "c1" will create the container's cgroup as a sub-cgroup of
2055 "my-cgroup". For example, if the user's current cgroup "my-user"
2056 is located in the root cgroup of the cpuset controllerin in a
2057 cgroup v1 hierarchy this would create the cgroup
2058 "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
2059 container. Any missing cgroups will be created by LXC. This
2060 presupposes that the user has write access to its current cgroup.
4eeecbdb
KY
2061 -->
2062 コンテナの cgroup を作成するパスやディレクトリを指定します。
2063 例えば、"c1" という名前のコンテナで <option>lxc.cgroup.dir = my-cgroup/first</option> のように設定すると、"my-cgroup" のサブ cgroup のようにコンテナの cgroup を作成します。
2064 例えば、ユーザのカレントの cgroup である "my-user" が cgroup v1 階層にある cpuset コントローラの root cgroup 内に存在する場合、この設定は "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" という cgroup をこのコンテナ向けに作成します。
2065 存在しない cgroup は LXC が作成しますが、ユーザがカレントの cgroup に書き込み権を持っていることが前提となります。
78be8d75
KY
2066 </para>
2067 </listitem>
2068 </varlistentry>
c3b7fd80
KY
2069 <varlistentry>
2070 <term>
2071 <option>lxc.cgroup.relative</option>
2072 </term>
2073 <listitem>
2074 <para>
2075 <!--
2076 Set this to 1 to instruct LXC to never escape to the
2077 root cgroup. This makes it easy for users to adhere to
2078 restrictions enforced by cgroup2 and
2079 systemd. Specifically, this makes it possible to run LXC
2080 containers as systemd services.
2081 -->
2082 LXC に root cgroup へのエスケープを行わないように指示するには、この値を 1 に設定してください。
2083 これにより、ユーザは cgroup2 と systemd が強制する制限を遵守するのが容易になります。
2084 具体的には、これにより LXC コンテナを systemd のサービスとして実行できます。
2085 </para>
2086 </listitem>
2087 </varlistentry>
fb261f53
KY
2088 </variablelist>
2089 </refsect2>
2090
2091 <refsect2>
2092 <title><!-- Capabilities -->ケーパビリティ</title>
2093 <para>
2094 <!--
50a8555e
KY
2095 The capabilities can be dropped in the container if this one
2096 is run as root.
fb261f53 2097 -->
dc421f3a 2098 コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。
fb261f53
KY
2099 </para>
2100 <variablelist>
50a8555e
KY
2101 <varlistentry>
2102 <term>
2103 <option>lxc.cap.drop</option>
2104 </term>
2105 <listitem>
2106 <para>
2107 <!--
2108 Specify the capability to be dropped in the container. A
2109 single line defining several capabilities with a space
2110 separation is allowed. The format is the lower case of
2111 the capability definition without the "CAP_" prefix,
2112 eg. CAP_SYS_MODULE should be specified as
2113 sys_module. See
2114 <citerefentry>
2115 <refentrytitle><command>capabilities</command></refentrytitle>
2116 <manvolnum>7</manvolnum>
2117 </citerefentry>,
9c3f2966
KY
2118 If used with no value, lxc will clear any drop capabilities
2119 specified up to this point.
fb261f53 2120 -->
dc421f3a
KY
2121 コンテナ内で削除するケーパビリティ (capability) を指定します。
2122 一行でスペース区切りで複数のケーパビリティを指定することも可能です。
2123 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。
2124 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。
2125 詳しくは以下を参照してください。
50a8555e
KY
2126 <citerefentry>
2127 <refentrytitle><command>capabilities</command></refentrytitle>
2128 <manvolnum>7</manvolnum>
2129 </citerefentry>
2130 この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。
2131 </para>
2132 </listitem>
2133 </varlistentry>
2134 <varlistentry>
2135 <term>
2136 <option>lxc.cap.keep</option>
2137 </term>
2138 <listitem>
2139 <para>
2140 <!--
2141 Specify the capability to be kept in the container. All other
2142 capabilities will be dropped. When a special value of "none" is
2143 encountered, lxc will clear any keep capabilities specified up
2144 to this point. A value of "none" alone can be used to drop all
2145 capabilities.
fb261f53 2146 -->
f36062dc
KY
2147 コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。
2148 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。
50a8555e
KY
2149 </para>
2150 </listitem>
2151 </varlistentry>
fb261f53
KY
2152 </variablelist>
2153 </refsect2>
2154
615e68b2 2155 <refsect2>
a2fbabed 2156 <title>名前空間 <!-- Namespace --></title>
615e68b2
KY
2157 <para>
2158 <!--
a2fbabed
KY
2159 A namespace can be cloned (<option>lxc.namespace.clone</option>),
2160 kept (<option>lxc.namespace.keep</option>) or shared
2161 (<option>lxc.namespace.share.[namespace identifier]</option>).
2162 -->
2163 名前空間は clone したり (<option>lxc.namespace.clone</option>)、keep したり (<option>lxc.namespace.keep</option>)、share したり (<option>lxc.namespace.share.[namespace identifier]</option>) できます。
615e68b2
KY
2164 </para>
2165 <variablelist>
a2fbabed
KY
2166 <varlistentry>
2167 <term>
2168 <option>lxc.namespace.clone</option>
2169 </term>
2170 <listitem>
2171 <para>
2172 <!--
2173 Specify namespaces which the container is supposed to be created
2174 with. The namespaces to create are specified as a space separated
2175 list. Each namespace must correspond to one of the standard
2176 namespace identifiers as seen in the
2177 <filename>/proc/PID/ns</filename> directory.
2178 When <option>lxc.namespace.clone</option> is not explicitly set all
2179 namespaces supported by the kernel and the current configuration
2180 will be used.
2181 -->
2182 コンテナ作成時に作成する名前空間を指定します。作成する名前空間はスペース区切りのリストで指定します。指定する名前空間名は、<filename>/proc/PID/ns</filename> ディレクトリ内に存在する標準の名前空間指示子でなければなりません。
2183 <option>lxc.namespace.clone</option> を明示的に設定していない場合は、カーネルがサポートするすべての名前空間と現在の設定が使われます。
2184 </para>
2185
2186 <para>
2187 <!--
2188 To create a new mount, net and ipc namespace set
2189 <option>lxc.namespace.clone=mount net ipc</option>.
2190 -->
2191 新しいマウント、ネット、IPC 名前空間を作る場合は <option>lxc.namespace.clone=mount net ipc</option> と指定します。
2192 </para>
2193 </listitem>
2194 </varlistentry>
2195
2196 <varlistentry>
2197 <term>
2198 <option>lxc.namespace.keep</option>
2199 </term>
2200 <listitem>
2201 <para>
2202 <!--
2203 Specify namespaces which the container is supposed to inherit from
2204 the process that created it. The namespaces to keep are specified as
2205 a space separated list. Each namespace must correspond to one of the
2206 standard namespace identifiers as seen in the
2207 <filename>/proc/PID/ns</filename> directory.
2208 The <option>lxc.namespace.keep</option> is a
2209 blacklist option, i.e. it is useful when enforcing that containers
2210 must keep a specific set of namespaces.
2211 -->
2212 コンテナが、作成元のプロセスから継承する (新しい名前空間を作らずに元のプロセスの名前空間のまま実行する) 名前空間を指定します。継承する名前空間はスペース区切りのリストで指定します。指定する名前空間名は、<filename>/proc/PID/ns</filename> ディレクトリ内に存在する標準の名前空間指示子でなければなりません。<option>lxc.namespace.keep</option> はブラックリストを指定するオプションです。つまり、コンテナに特定の名前空間を使い続けることを強制したい場合に便利です。
2213 </para>
2214
2215 <para>
2216 <!--
2217 To keep the network, user and ipc namespace set
2218 <option>lxc.namespace.keep=user net ipc</option>.
2219 -->
2220 ネットワーク、ユーザ、IPC 名前空間を元のプロセスの名前空間のままで実行したい場合は <option>lxc.namespace.keep=user net ipc</option> と指定します。
2221 </para>
2222
2223 <para>
2224 <!--
2225 Note that sharing pid namespaces will likely not work with most init
2226 systems.
2227 -->
2228 PID 名前空間を共有すると、ほとんどの init で動作しない可能性があることに注意してください。
2229 </para>
2230
2231 <para>
2232 <!--
2233 Note that if the container requests a new user namespace and the
2234 container wants to inherit the network namespace it needs to inherit
2235 the user namespace as well.
2236 -->
09dd49ab 2237 コンテナが新しいユーザ名前空間をリクエストし、そのコンテナがネットワーク名前空間は継承したい場合は、ユーザ名前空間も同様に継承する必要があることに注意してください。
a2fbabed
KY
2238 </para>
2239 </listitem>
2240 </varlistentry>
2241
615e68b2
KY
2242 <varlistentry>
2243 <term>
1fe33b7b 2244 <option>lxc.namespace.share.[namespace identifier]</option>
615e68b2
KY
2245 </term>
2246 <listitem>
2247 <para>
2248 <!--
2249 Specify a namespace to inherit from another container or process.
2250 The <option>[namespace identifier]</option> suffix needs to be
2251 replaced with one of the namespaces that appear in the
2252 <filename>/proc/PID/ns</filename> directory.
2253 -->
2254 他のコンテナやプロセスから継承する名前空間を指定します。<option>[namespace identifier]</option> には、<filename>/proc/PID/ns</filename> ディレクトリ内に現れる名前空間のひとつが入ります。
2255 </para>
2256
2257 <para>
2258 <!--
2259 To inherit the namespace from another process set the
1fe33b7b
KY
2260 <option>lxc.namespace.share.[namespace identifier]</option> to the PID of
2261 the process, e.g. <option>lxc.namespace.share.net=42</option>.
615e68b2 2262 -->
1fe33b7b 2263 他のプロセスから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> の値をプロセスの PID に設定します。例えば <option>lxc.namespace.share.net=42</option> のようになります。
615e68b2
KY
2264 </para>
2265
2266 <para>
2267 <!--
2268 To inherit the namespace from another container set the
1fe33b7b
KY
2269 <option>lxc.namespace.share.[namespace identifier]</option> to the name of
2270 the container, e.g. <option>lxc.namespace.share.pid=c3</option>.
615e68b2 2271 -->
1fe33b7b 2272 他のコンテナから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> の値をコンテナ名に設定します。例えば <option>lxc.namespace.share.pid=c3</option> のようになります。
615e68b2
KY
2273 </para>
2274
2275 <para>
2276 <!--
2277 To inherit the namespace from another container located in a
2278 different path than the standard liblxc path set the
1fe33b7b 2279 <option>lxc.namespace.share.[namespace identifier]</option> to the full
615e68b2 2280 path to the container, e.g.
1fe33b7b 2281 <option>lxc.namespace.share.user=/opt/c3</option>.
615e68b2 2282 -->
1fe33b7b 2283 標準の liblxc のパスとは異なるコンテナパスに存在する他のコンテナから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> をそのコンテナのフルパスで指定します。例えば <option>lxc.namespace.share.user=/opt/c3</option> のようになります。
615e68b2
KY
2284 </para>
2285
2286 <para>
2287 <!--
2288 In order to inherit namespaces the caller needs to have sufficient
2289 privilege over the process or container.
2290 -->
2291 名前空間を継承するためには、呼び出し元が継承元のプロセスまたはコンテナに対して十分な権限を持っている必要があります。
2292 </para>
2293
2294 <para>
2295 <!--
2296 Note that sharing pid namespaces between system containers will
2297 likely not work with most init systems.
2298 -->
2299 システムコンテナ間での PID 名前空間の共有は、ほとんどの init システムではうまく動作しない可能性があることに注意が必要です。
2300 </para>
2301
2302 <para>
2303 <!--
2304 Note that if two processes are in different user namespaces and one
2305 process wants to inherit the other's network namespace it usually
2306 needs to inherit the user namespace as well.
2307 -->
2308 ふたつのプロセスが異なるユーザ名前空間に存在し、そのうちのひとつが他のネットワーク名前空間を継承したい場合、通常はユーザ名前空間も同様に継承する必要があることに注意が必要です。
2309 </para>
3c452dec
KY
2310
2311 <para>
2312 <!--
2313 Note that without careful additional configuration of an LSM,
2314 sharing user+pid namespaces with a task may allow that task to
2315 escalate privileges to that of the task calling liblxc.
2316 -->
2317 LSM で慎重に設定を追加しないで、タスクでユーザ + PID 名前空間を共有すると、そのタスクは liblxc を呼び出したタスクの権限に昇格できることに注意が必要です。
2318 </para>
2319
615e68b2
KY
2320 </listitem>
2321 </varlistentry>
2322 </variablelist>
2323 </refsect2>
2324
e7267b53
KY
2325 <refsect2>
2326 <title>リソース制限 <!-- Resource limits --></title>
2327 <para>
50a8555e 2328 <!--
e7267b53
KY
2329 The soft and hard resource limits for the container can be changed.
2330 Unprivileged containers can only lower them. Resources which are not
2331 explicitly specified will be inherited.
50a8555e
KY
2332 -->
2333 コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。
e7267b53
KY
2334 </para>
2335 <variablelist>
2336 <varlistentry>
2337 <term>
240d4b74 2338 <option>lxc.prlimit.[limit name]</option>
e7267b53
KY
2339 </term>
2340 <listitem>
2341 <para>
2342 <!--
2343 Specify the resource limit to be set. A limit is specified as two
2344 colon separated values which are either numeric or the word
2345 'unlimited'. A single value can be used as a shortcut to set both
2346 soft and hard limit to the same value. The permitted names the
2347 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
2348 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
2349 <citerefentry>
2350 <refentrytitle><command>setrlimit</command></refentrytitle>
2351 <manvolnum>2</manvolnum>
2352 </citerefentry>.
2353 If used with no value, lxc will clear the resource limit
2354 specified up to this point. A resource with no explicitly
2355 configured limitation will be inherited from the process starting
2356 up the container.
2357 -->
2358 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは
2359 <citerefentry>
2360 <refentrytitle><command>setrlimit</command></refentrytitle>
2361 <manvolnum>2</manvolnum>
2362 </citerefentry> を参照してください。
2363 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。
2364 </para>
2365 </listitem>
2366 </varlistentry>
2367 </variablelist>
2368 </refsect2>
2369
b45e48f0
KY
2370 <refsect2>
2371 <title>Sysctl</title>
2372 <para>
4eeecbdb 2373 <!--
b45e48f0 2374 Configure kernel parameters for the container.
4eeecbdb
KY
2375 -->
2376 コンテナ用のカーネルパラメータを設定します。
b45e48f0
KY
2377 </para>
2378 <variablelist>
2379 <varlistentry>
2380 <term>
2381 <option>lxc.sysctl.[kernel parameters name]</option>
2382 </term>
2383 <listitem>
2384 <para>
2385 <!--
2386 Specify the kernel parameters to be set. The parameters available
2387 are those listed under /proc/sys/.
2388 Note that not all sysctls are namespaced. Changing Non-namespaced
2389 sysctls will cause the system-wide setting to be modified.
2390 -->
2391 設定したいカーネルパラメータを指定します。指定できるパラメータは /proc/sys 以下に存在するものです。
2392 すべての sysctl パラメータが仮想化(名前空間化)されているわけではないことに注意してください。仮想化されていない sysctl を設定すると、システムワイドで設定が変更されてしまいます。
2393 <citerefentry>
2394 <refentrytitle><command>sysctl</command></refentrytitle>
2395 <manvolnum>8</manvolnum>
2396 </citerefentry>.
2397 <!--
2398 If used with no value, lxc will clear the parameters specified up
2399 to this point.
2400 -->
2401 値を指定しないでこの設定を指定した場合は、この設定より前に設定されたパラメータをクリアします。
2402 </para>
2403 </listitem>
2404 </varlistentry>
2405 </variablelist>
2406 </refsect2>
2407
fb261f53
KY
2408 <refsect2>
2409 <title><!-- Apparmor profile -->Apparmor プロファイル</title>
2410 <para>
2411 <!--
50a8555e
KY
2412 If lxc was compiled and installed with apparmor support, and the host
2413 system has apparmor enabled, then the apparmor profile under which the
2414 container should be run can be specified in the container
9d101b3d 2415 configuration. The default is <command>lxc-container-default-cgns</command>
50a8555e 2416 if the host kernel is cgroup namespace aware, or
69e3b3be 2417 <command>lxc-container-default</command> otherwise.
fb261f53 2418 -->
dc421f3a 2419 lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。
cd548c9d 2420 デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。
fb261f53
KY
2421 </para>
2422 <variablelist>
50a8555e
KY
2423 <varlistentry>
2424 <term>
a1d5fdfd 2425 <option>lxc.apparmor.profile</option>
50a8555e
KY
2426 </term>
2427 <listitem>
2428 <para>
fb261f53 2429 <!--
50a8555e
KY
2430 Specify the apparmor profile under which the container should
2431 be run. To specify that the container should be unconfined,
2432 use
fb261f53 2433 -->
dc421f3a
KY
2434 コンテナが従うべき apparmor プロファイルを指定します。
2435 コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。
50a8555e 2436 </para>
a1d5fdfd 2437 <programlisting>lxc.apparmor.profile = unconfined</programlisting>
9d101b3d 2438 <para>
50a8555e 2439 <!--
9d101b3d 2440 If the apparmor profile should remain unchanged (i.e. if you
50a8555e
KY
2441 are nesting containers and are already confined), then use
2442 -->
2443 もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。
9d101b3d 2444 </para>
a1d5fdfd 2445 <programlisting>lxc.apparmor.profile = unchanged</programlisting>
8dca2bd3
KY
2446 <para>
2447 <!--
2448 If you instruct LXC to generate the apparmor profile,
2449 then use
2450 -->
2451 もし LXC に AppArmor プロファイルを生成するように指示するには次のように設定します。
2452 </para>
2453 <programlisting>lxc.apparmor.profile = generated</programlisting>
50a8555e
KY
2454 </listitem>
2455 </varlistentry>
2456 <varlistentry>
2457 <term>
69e38e00 2458 <option>lxc.apparmor.allow_incomplete</option>
50a8555e
KY
2459 </term>
2460 <listitem>
2461 <para>
2462 <!--
2463 Apparmor profiles are pathname based. Therefore many file
2464 restrictions require mount restrictions to be effective against
2465 a determined attacker. However, these mount restrictions are not
2466 yet implemented in the upstream kernel. Without the mount
2467 restrictions, the apparmor profiles still protect against accidental
2468 damager.
edf3a692
KY
2469 -->
2470 apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。
2471 しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。
50a8555e
KY
2472 </para>
2473 <para>
edf3a692 2474 <!--
50a8555e
KY
2475 If this flag is 0 (default), then the container will not be
2476 started if the kernel lacks the apparmor mount features, so that a
2477 regression after a kernel upgrade will be detected. To start the
2478 container under partial apparmor protection, set this flag to 1.
edf3a692
KY
2479 -->
2480 このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。
2481 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。
50a8555e
KY
2482 </para>
2483 </listitem>
2484 </varlistentry>
8dca2bd3
KY
2485
2486 <varlistentry>
2487 <term>
2488 <option>lxc.apparmor.allow_nesting</option>
2489 </term>
2490 <listitem>
2491 <para>
2492 <!--
2493 If set this to 1, causes the following changes. When
2494 generated apparmor profiles are used, they will contain
2495 the necessary changes to allow creating a nested
2496 container. In addition to the usual mount points,
2497 <filename>/dev/.lxc/proc</filename>
2498 and <filename>/dev/.lxc/sys</filename> will contain
2499 procfs and sysfs mount points without the lxcfs
2500 overlays, which, if generated apparmor profiles are
2501 being used, will not be read/writable directly.
2502 -->
2503 1 に設定すると次のような変更が行われます。
2504 generated な AppArmor プロファイルが使われる場合、ネストしたコンテナを使うのに必要な変更が含まれます。通常のマウントポイントに加えて、lxcfs のオーバーレイなしで、<filename>/dev/.lxc/proc</filename> と <filename>/dev/.lxc/sys</filename> が procfs と sysfs のマウントポイントに含まれます。
2505 generated な AppArmor プロファイルが使われている場合は、直接読み書きはできません
2506 </para>
2507 </listitem>
2508 </varlistentry>
2509
2510 <varlistentry>
2511 <term>
2512 <option>lxc.apparmor.raw</option>
2513 </term>
2514 <listitem>
2515 <para>
2516 <!--
2517 A list of raw AppArmor profile lines to append to the
2518 profile. Only valid when using generated profiles.
2519 -->
2520 プロファイルに加える、生の AppArmor プロファイル行のリストです。generated なプロファイルを使っているときのみ有効です。
2521 </para>
2522 </listitem>
2523 </varlistentry>
2524
fb261f53
KY
2525 </variablelist>
2526 </refsect2>
2527
2528 <refsect2>
2529 <title><!-- SELinux context -->SELinux コンテキスト</title>
2530 <para>
2531 <!--
50a8555e
KY
2532 If lxc was compiled and installed with SELinux support, and the host
2533 system has SELinux enabled, then the SELinux context under which the
2534 container should be run can be specified in the container
2535 configuration. The default is <command>unconfined_t</command>,
2536 which means that lxc will not attempt to change contexts.
2537 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
2538 information.
fb261f53 2539 -->
dc421f3a
KY
2540 lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。
2541 デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。
03c315af 2542 ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。
fb261f53
KY
2543 </para>
2544 <variablelist>
50a8555e
KY
2545 <varlistentry>
2546 <term>
b84702ab 2547 <option>lxc.selinux.context</option>
50a8555e
KY
2548 </term>
2549 <listitem>
2550 <para>
fb261f53 2551 <!--
50a8555e
KY
2552 Specify the SELinux context under which the container should
2553 be run or <command>unconfined_t</command>. For example
fb261f53 2554 -->
dc421f3a 2555 コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。
50a8555e 2556 </para>
b84702ab 2557 <programlisting>lxc.selinux.context = system_u:system_r:lxc_t:s0:c22</programlisting>
50a8555e
KY
2558 </listitem>
2559 </varlistentry>
fb261f53
KY
2560 </variablelist>
2561 </refsect2>
2562
2563 <refsect2>
2564 <title><!-- Seccomp configuration -->Seccomp の設定</title>
2565 <para>
2566 <!--
2567 A container can be started with a reduced set of available
50a8555e
KY
2568 system calls by loading a seccomp profile at startup. The
2569 seccomp configuration file must begin with a version number
2570 on the first line, a policy type on the second line, followed
2571 by the configuration.
fb261f53 2572 -->
dc421f3a
KY
2573 コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。
2574 seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。
fb261f53 2575 </para>
4473e38b
KY
2576 <para>
2577 <!--
2578 Versions 1 and 2 are currently supported. In version 1, the
50a8555e
KY
2579 policy is a simple whitelist. The second line therefore must
2580 read "whitelist", with the rest of the file containing one (numeric)
8927207b 2581 syscall number per line. Each syscall number is whitelisted,
50a8555e 2582 while every unlisted number is blacklisted for use in the container
4473e38b 2583 -->
dc421f3a
KY
2584 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。
2585 そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。
4473e38b
KY
2586 </para>
2587
2588 <para>
2589 <!--
2590 In version 2, the policy may be blacklist or whitelist,
2591 supports per-rule and per-policy default actions, and supports
2592 per-architecture system call resolution from textual names.
2593 -->
dc421f3a 2594 バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。
4473e38b
KY
2595 </para>
2596 <para>
2597 <!--
2598 An example blacklist policy, in which all system calls are
2599 allowed except for mknod, which will simply do nothing and
2600 return 0 (success), looks like:
2601 -->
dc421f3a 2602 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。
4473e38b 2603 </para>
2513f519
KY
2604
2605 <programlisting>
2606 2
2607 blacklist
2608 mknod errno 0
7dd6ead9 2609 ioctl notify
2513f519
KY
2610 </programlisting>
2611
7dd6ead9
KY
2612 <para>
2613 <!--
2614 Specifying "errno" as action will cause LXC to register a seccomp filter
2615 that will cause a specific errno to be returned to the caller. The errno
2616 value can be specified after the "errno" action word.
2617 -->
2618 アクションとして "errno" を指定すると、LXC は seccomp フィルタを登録します。これにより、指定した errno を呼び出し元に返します。
2619 errno の値は "errno" という単語の後に指定します。
2620 </para>
2621
2622 <para>
2623 <!--
2624 Specifying "notify" as action will cause LXC to register a seccomp
2625 listener and retrieve a listener file descriptor from the kernel. When a
2626 syscall is made that is registered as "notify" the kernel will generate a
2627 poll event and send a message over the file descriptor. The caller can
2628 read this message, inspect the syscalls including its arguments. Based on
2629 this information the caller is expected to send back a message informing
2630 the kernel which action to take. Until that message is sent the kernel
2631 will block the calling process. The format of the messages to read and
2632 sent is documented in seccomp itself.
2633 -->
2634 アクションとして "notify" を指定すると、LXC は seccomp リスナーを登録し、カーネルからリスナーのファイルディスクリプタを取得します。
2635 "notify" として指定しているシステムコールが作成されると、カーネルは poll イベントを生成し、ファイルディスクリプタを通してメッセージを送信します。
2636 呼び出し元はこのメッセージを読み、引数を含めてシステムコールを調査できます。
2637 呼び出し元はこの情報に基づき、どのアクションを取るべきかをカーネルに知らせるメッセージを送り返すことが期待されます。
2638 このメッセージが送られるまで、カーネルは呼び出し元のプロセスをブロックします。読み書きするメッセージのフォーマットは seccomp 自身に記述されています。
2639 </para>
2640
fb261f53 2641 <variablelist>
50a8555e
KY
2642 <varlistentry>
2643 <term>
e71b47b2 2644 <option>lxc.seccomp.profile</option>
50a8555e
KY
2645 </term>
2646 <listitem>
2647 <para>
fb261f53 2648 <!--
50a8555e
KY
2649 Specify a file containing the seccomp configuration to
2650 load before the container starts.
fb261f53 2651 -->
dc421f3a 2652 コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。
50a8555e
KY
2653 </para>
2654 </listitem>
2655 </varlistentry>
7a8f46e9
KY
2656 <varlistentry>
2657 <term>
2658 <option>lxc.seccomp.allow_nesting</option>
2659 </term>
2660 <listitem>
2661 <para>
7dd6ead9 2662 <!--
7a8f46e9
KY
2663 If this flag is set to 1, then seccomp filters will be stacked
2664 regardless of whether a seccomp profile is already loaded.
2665 This allows nested containers to load their own seccomp profile.
2666 The default setting is 0.
7dd6ead9
KY
2667 -->
2668 このオプションを 1 に設定すると、すでに seccomp プロファイルがロードされている、いないに関わらず、seccomp フィルタが重ね合わせられます。
2669 これにより、ネストされたコンテナが自身の seccomp プロファイルをロードできます。
2670 デフォルト値は 0 です。
2671 </para>
2672 </listitem>
2673 </varlistentry>
2674 <varlistentry>
2675 <term>
2676 <option>lxc.seccomp.notify.proxy</option>
2677 </term>
2678 <listitem>
2679 <para>
2680 <!--
2681 Specify a unix socket to which LXC will connect and forward
2682 seccomp events to. The path must by in the form
2683 unix:/path/to/socket or unix:@socket. The former specifies a
2684 path-bound unix domain socket while the latter specifies an
2685 abstract unix domain socket.
2686 -->
2687 LXC が接続し、seccomp イベントを転送する UNIX ソケットを指定します。
2688 パスは unix:/path/to/socket もしくは unix:@socket の形式でなければなりません。
2689 前者はパス指定の UNIX ドメインソケットを指定し、後者は抽象 (abstract) UNIX ドメインソケットの指定です。
7a8f46e9
KY
2690 </para>
2691 </listitem>
2692 </varlistentry>
fb261f53
KY
2693 </variablelist>
2694 </refsect2>
2695
16e58f07
KY
2696 <refsect2>
2697 <title>PR_SET_NO_NEW_PRIVS</title>
2698 <para>
2699 <!--
2700 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
2701 privileges to do anything that could not have been done without
2702 the execve() call (for example, rendering the set-user-ID and
2703 set-group-ID mode bits, and file capabilities non-functional).
2704 Once set, this bit cannot be unset. The setting of this bit is
2705 inherited by children created by fork() and clone(), and preserved
2706 across execve().
2707 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
2708 changed into its intended AppArmor profile or SElinux context.
2709 -->
2710 PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。
2711 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。
2712 PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。
2713 </para>
2714 <variablelist>
2715 <varlistentry>
2716 <term>
2717 <option>lxc.no_new_privs</option>
2718 </term>
2719 <listitem>
2720 <para>
50a8555e 2721 <!--
16e58f07
KY
2722 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
2723 container. Set to 1 to activate.
50a8555e
KY
2724 -->
2725 コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。
16e58f07
KY
2726 </para>
2727 </listitem>
2728 </varlistentry>
2729 </variablelist>
2730 </refsect2>
2731
fb261f53
KY
2732 <refsect2>
2733 <title><!-- UID mappings -->UID のマッピング</title>
2734 <para>
2735 <!--
2736 A container can be started in a private user namespace with
50a8555e
KY
2737 user and group id mappings. For instance, you can map userid
2738 0 in the container to userid 200000 on the host. The root
2739 user in the container will be privileged in the container,
2740 but unprivileged on the host. Normally a system container
2741 will want a range of ids, so you would map, for instance,
2742 user and group ids 0 through 20,000 in the container to the
2743 ids 200,000 through 220,000.
fb261f53 2744 -->
dc421f3a
KY
2745 コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。
2746 たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。
2747 コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。
2748 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。
2749 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。
fb261f53
KY
2750 </para>
2751 <variablelist>
50a8555e
KY
2752 <varlistentry>
2753 <term>
bdcbb6b3 2754 <option>lxc.idmap</option>
50a8555e
KY
2755 </term>
2756 <listitem>
2757 <para>
2758 <!--
2759 Four values must be provided. First a character, either
2760 'u', or 'g', to specify whether user or group ids are
2761 being mapped. Next is the first userid as seen in the
2762 user namespace of the container. Next is the userid as
2763 seen on the host. Finally, a range indicating the number
2764 of consecutive ids to map.
fb261f53 2765 -->
dc421f3a
KY
2766 4 つの値を記述する必要があります。
2767 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。
2768 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。
2769 その次は、そのユーザ ID のホスト上での値です。
2770 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。
50a8555e
KY
2771 </para>
2772 </listitem>
2773 </varlistentry>
fb261f53
KY
2774 </variablelist>
2775 </refsect2>
2776
2777 <refsect2>
2778 <title><!-- Container hooks -->コンテナのフック</title>
2779 <para>
a0a4f759 2780 <!--
fb261f53 2781 Container hooks are programs or scripts which can be executed
50a8555e 2782 at various times in a container's lifetime.
a0a4f759
KY
2783 -->
2784 コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。
fb261f53
KY
2785 </para>
2786 <para>
a0a4f759 2787 <!--
efcbd1a0
KY
2788 When a container hook is executed, additional information is passed
2789 along. The <option>lxc.hook.version</option> argument can be used to
2790 determine if the following arguments are passed as command line
2791 arguments or through environment variables. The arguments are:
a0a4f759
KY
2792 -->
2793 コンテナフックが実行されるとき、追加の情報が渡されます。追加の引数がコマンドライン引数で渡されるか、環境変数経由で渡されるかを判断するのに、<option>lxc.hook.version</option> が使えます。引数は:
50a8555e 2794 <itemizedlist>
efcbd1a0
KY
2795 <listitem><para> コンテナ名 <!-- Container name.--></para></listitem>
2796 <listitem><para> セクション (常に 'lxc') <!-- Section (always 'lxc'). --></para></listitem>
2797 <listitem><para> フックのタイプ ('clone' や 'pre-mount' など) <!-- The hook type (i.e. 'clone' or 'pre-mount'). --></para></listitem>
2798 <listitem><para> 追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。 <!-- Additional arguments. In the
50a8555e 2799 case of the clone hook, any extra arguments passed to
d0b2a434
KY
2800 lxc-clone will appear as further arguments to the hook.
2801 In the case of the stop hook, paths to filedescriptors
2802 for each of the container's namespaces along with their types
efcbd1a0 2803 are passed. --></para></listitem>
50a8555e 2804 </itemizedlist>
a0a4f759 2805 <!--
50a8555e 2806 The following environment variables are set:
a0a4f759
KY
2807 -->
2808 次の環境変数がセットされます。
50a8555e 2809 <itemizedlist>
efcbd1a0
KY
2810 <listitem><para> LXC_CGNS_AWARE: コンテナで cgroup namespace が使えるかどうか <!-- indicator whether the container is
2811 cgroup namespace aware. --></para></listitem>
2812 <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス <!-- the path to the container
2813 configuration file. --></para></listitem>
2814 <listitem><para> LXC_HOOK_TYPE: フックのタイプ (例えば 'clone'、'mount'、'pre-mount')。この環境変数が存在するかどうかは <option>lxc.hook.version</option> の値次第です。この値が 1 なら、LXC_HOOK_TYPE が設定されています。
a0a4f759 2815 <!-- the hook type (e.g. 'clone', 'mount',
efcbd1a0
KY
2816 'pre-mount'). Note that the existence of this environment variable is
2817 conditional on the value of <option>lxc.hook.version</option>. If it
2818 is set to 1 then LXC_HOOK_TYPE will be set. -->
2819 </para></listitem>
2820 <listitem><para> LXC_HOOK_SECTION: セクションタイプ (例えば 'lxc'、'net')。この環境変数が存在するかどうかは <option>lxc.hook.version</option> の値次第です。この値が 1 なら、LXC_HOOK_TYPE が設定されています。
a0a4f759 2821 <!-- the section type (e.g. 'lxc',
efcbd1a0
KY
2822 'net'). Note that the existence of this environment variable is
2823 conditional on the value of <option>lxc.hook.version</option>. If it
2824 is set to 1 then LXC_HOOK_SECTION will be set. -->
2825 </para></listitem>
2826 <listitem><para> LXC_HOOK_VERSION: フックのバージョン。この値は、コンテナの <option>lxc.hook.version</option> の値と同じです。もし、この値が 0 に設定されているなら、古いスタイルのフックが使われます。もし 1 に設定されているなら、新しいスタイルのフックが使われます。
a0a4f759 2827 <!-- the version of the hooks. This
efcbd1a0
KY
2828 value is identical to the value of the container's
2829 <option>lxc.hook.version</option> config item. If it is set to 0 then
2830 old-style hooks are used. If it is set to 1 then new-style hooks are
2831 used. --></para></listitem>
2832 <listitem><para> LXC_LOG_LEVEL: コンテナのログレベル <!-- the container's log level. --></para></listitem>
2833 <listitem><para> LXC_NAME: コンテナ名 <!-- is the container's name. --></para></listitem>
2834 <listitem><para> LXC_[NAMESPACE IDENTIFIER]_NS: コンテナの名前空間が参照する /proc/PID/fd/ 以下のファイルディスクリプタのパス。それぞれの名前空間ごとに別々の環境変数になります。これらの環境変数は <option>lxc.hook.version</option> が 1 に設定されてる場合のみ設定されます。
a0a4f759 2835 <!-- path under
efcbd1a0
KY
2836 /proc/PID/fd/ to a file descriptor referring to the container's
2837 namespace. For each preserved namespace type there will be a separate
2838 environment variable. These environment variables will only be set if
2839 <option>lxc.hook.version</option> is set to 1. --></para></listitem>
2840 <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス <!-- the path to the mounted root filesystem. --></para></listitem>
2841 <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs.path エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。 <!-- this is the lxc.rootfs.path entry
2842 for the container. Note this is likely not where the mounted rootfs is
2843 to be found, use LXC_ROOTFS_MOUNT for that. --></para></listitem>
2844 <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前 <!-- in the case of the clone hook, this is
2845 the original container's name. --></para></listitem>
fb261f53
KY
2846 </itemizedlist>
2847 </para>
2848 <para>
a0a4f759 2849 <!--
fb261f53
KY
2850 Standard output from the hooks is logged at debug level.
2851 Standard error is not logged, but can be captured by the
2852 hook redirecting its standard error to standard output.
a0a4f759
KY
2853 -->
2854 スクリプトからの標準出力は debug レベルでロギングされます。
dc421f3a
KY
2855 標準エラー出力はロギングされません。
2856 しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
fb261f53 2857 </para>
efcbd1a0
KY
2858 <variablelist>
2859 <varlistentry>
2860 <term>
2861 <option>lxc.hook.version</option>
2862 </term>
2863 <listitem>
2864 <para>
a0a4f759 2865 <!--
efcbd1a0
KY
2866 To pass the arguments in new style via environment variables set to
2867 1 otherwise set to 0 to pass them as arguments.
2868 This setting affects all hooks arguments that were traditionally
2869 passed as arguments to the script. Specifically, it affects the
2870 container name, section (e.g. 'lxc', 'net') and hook type (e.g.
2871 'clone', 'mount', 'pre-mount') arguments. If new-style hooks are
2872 used then the arguments will be available as environment variables.
2873 The container name will be set in LXC_NAME. (This is set
2874 independently of the value used for this config item.) The section
2875 will be set in LXC_HOOK_SECTION and the hook type will be set in
2876 LXC_HOOK_TYPE.
2877 It also affects how the paths to file descriptors referring to the
2878 container's namespaces are passed. If set to 1 then for each
2879 namespace a separate environment variable LXC_[NAMESPACE
2880 IDENTIFIER]_NS will be set. If set to 0 then the paths will be
2881 passed as arguments to the stop hook.
a0a4f759
KY
2882 -->
2883 環境変数経由の新しいスタイルで引数を渡すには 1 に設定します。そうでなく、引数として渡すには 0 に設定します。この設定は、古い方法でスクリプトに引数として渡されているすべてのフック引数に影響します。特に、コンテナ名のセクション (例: 'lxc', 'net') とフックタイプ (例: 'clone', 'mount', 'pre-mount') 引数に影響します。新しいスタイルのフックが使われる場合、引数は環境変数として利用できます。
2884 コンテナ名は LXC_NAME に設定されます(これはこの設定項目に設定されている値とは関係なく設定されます)。セクションは LXC_HOOK_SECTION に設定されます。そしてフックタイプは LXC_HOOK_TYPE に設定されます。
2885 この設定は、コンテナの名前空間を参照するファイルディスクリプタのパスをどのように渡すかにも影響します。1 に設定した場合、名前空間ごとに別の環境変数 LXC_[NAMESPACE IDENTIFIER]_NS に設定されます。0 に設定すると、パスは stop フックの引数として渡されます。
efcbd1a0
KY
2886 </para>
2887 </listitem>
2888 </varlistentry>
2889 </variablelist>
fb261f53 2890 <variablelist>
50a8555e
KY
2891 <varlistentry>
2892 <term>
2893 <option>lxc.hook.pre-start</option>
2894 </term>
2895 <listitem>
2896 <para>
fb261f53 2897 <!--
50a8555e
KY
2898 A hook to be run in the host's namespace before the
2899 container ttys, consoles, or mounts are up.
fb261f53 2900 -->
dc421f3a 2901 コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。
50a8555e
KY
2902 </para>
2903 </listitem>
2904 </varlistentry>
fb261f53
KY
2905 </variablelist>
2906 <variablelist>
50a8555e
KY
2907 <varlistentry>
2908 <term>
2909 <option>lxc.hook.pre-mount</option>
2910 </term>
2911 <listitem>
2912 <para>
2913 <!--
2914 A hook to be run in the container's fs namespace but before
2915 the rootfs has been set up. This allows for manipulation
2916 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
2917 done in this hook will not be reflected on the host (apart from
2918 mounts propagation), so they will be automatically cleaned up
2919 when the container shuts down.
fb261f53 2920 -->
dc421f3a
KY
2921 コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。
2922 これにより rootfs の操作が可能になります。
2923 例えば、暗号化されたファイルシステムのマウントなどです。
2924 このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。
2925 なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。
50a8555e
KY
2926 </para>
2927 </listitem>
2928 </varlistentry>
fb261f53
KY
2929 </variablelist>
2930 <variablelist>
50a8555e
KY
2931 <varlistentry>
2932 <term>
2933 <option>lxc.hook.mount</option>
2934 </term>
2935 <listitem>
2936 <para>
fb261f53 2937 <!--
50a8555e
KY
2938 A hook to be run in the container's namespace after
2939 mounting has been done, but before the pivot_root.
fb261f53 2940 -->
dc421f3a 2941 マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。
50a8555e
KY
2942 </para>
2943 </listitem>
2944 </varlistentry>
fb261f53
KY
2945 </variablelist>
2946 <variablelist>
50a8555e
KY
2947 <varlistentry>
2948 <term>
2949 <option>lxc.hook.autodev</option>
2950 </term>
2951 <listitem>
2952 <para>
2953 <!--
2954 A hook to be run in the container's namespace after
2955 mounting has been done and after any mount hooks have
2956 run, but before the pivot_root, if
2957 <option>lxc.autodev</option> == 1.
2958 The purpose of this hook is to assist in populating the
2959 /dev directory of the container when using the autodev
2960 option for systemd based containers. The container's /dev
2961 directory is relative to the
2962 ${<option>LXC_ROOTFS_MOUNT</option>} environment
2963 variable available when the hook is run.
fb261f53 2964 -->
dc421f3a
KY
2965 <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。
2966 このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。
50a8555e
KY
2967 </para>
2968 </listitem>
1e074e8e
KY
2969 </varlistentry>
2970 </variablelist>
2971 <variablelist>
2972 <varlistentry>
2973 <term>
2974 <option>lxc.hook.start-host</option>
2975 </term>
2976 <listitem>
2977 <para>
2978 <!--
2979 A hook to be run in the host's namespace after the
2980 container has been setup, and immediately before starting
2981 the container init.
2982 -->
2983 コンテナのセットアップが済んだあと、コンテナの init を実行する直前に、ホストの名前空間で実行するためのフックです。
2984 </para>
2985 </listitem>
50a8555e 2986 </varlistentry>
fb261f53
KY
2987 </variablelist>
2988 <variablelist>
50a8555e
KY
2989 <varlistentry>
2990 <term>
2991 <option>lxc.hook.start</option>
2992 </term>
2993 <listitem>
2994 <para>
fb261f53 2995 <!--
50a8555e
KY
2996 A hook to be run in the container's namespace immediately
2997 before executing the container's init. This requires the
2998 program to be available in the container.
fb261f53 2999 -->
dc421f3a
KY
3000 コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。
3001 コンテナ内で利用可能なプログラムである必要があります。
50a8555e
KY
3002 </para>
3003 </listitem>
3004 </varlistentry>
fb261f53 3005 </variablelist>
d0b2a434
KY
3006 <variablelist>
3007 <varlistentry>
3008 <term>
3009 <option>lxc.hook.stop</option>
3010 </term>
3011 <listitem>
3012 <para>
50a8555e 3013 <!--
d0b2a434
KY
3014 A hook to be run in the host's namespace with references
3015 to the container's namespaces after the container has been shut
3016 down. For each namespace an extra argument is passed to the hook
3017 containing the namespace's type and a filename that can be used to
3018 obtain a file descriptor to the corresponding namespace, separated
3019 by a colon. The type is the name as it would appear in the
3020 <filename>/proc/PID/ns</filename> directory.
3021 For instance for the mount namespace the argument usually looks
3022 like <filename>mnt:/proc/PID/fd/12</filename>.
50a8555e
KY
3023 -->
3024 コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。
3025 それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。
3026 タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。
3027 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。
d0b2a434
KY
3028 </para>
3029 </listitem>
3030 </varlistentry>
3031 </variablelist>
fb261f53 3032 <variablelist>
50a8555e
KY
3033 <varlistentry>
3034 <term>
3035 <option>lxc.hook.post-stop</option>
3036 </term>
3037 <listitem>
3038 <para>
fb261f53 3039 <!--
50a8555e
KY
3040 A hook to be run in the host's namespace after the
3041 container has been shut down.
fb261f53 3042 -->
dc421f3a 3043 コンテナがシャットダウンされた後にホストの名前空間で実行するフック。
50a8555e
KY
3044 </para>
3045 </listitem>
3046 </varlistentry>
fb261f53
KY
3047 </variablelist>
3048 <variablelist>
50a8555e
KY
3049 <varlistentry>
3050 <term>
3051 <option>lxc.hook.clone</option>
3052 </term>
3053 <listitem>
3054 <para>
fb261f53 3055 <!--
50a8555e
KY
3056 A hook to be run when the container is cloned to a new one.
3057 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
3058 <manvolnum>1</manvolnum></citerefentry> for more information.
fb261f53 3059 -->
dc421f3a 3060 コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは
fb261f53
KY
3061 <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
3062 <manvolnum>1</manvolnum></citerefentry>
dc421f3a 3063 を参照してください。
50a8555e
KY
3064 </para>
3065 </listitem>
3066 </varlistentry>
fb261f53 3067 </variablelist>
de0dc533
KY
3068 <variablelist>
3069 <varlistentry>
3070 <term>
3071 <option>lxc.hook.destroy</option>
3072 </term>
3073 <listitem>
3074 <para>
3075 <!--
3076 A hook to be run when the container is destroyed.
3077 -->
3078 コンテナを破壊する際に実行されるフックです。
3079 </para>
3080 </listitem>
3081 </varlistentry>
3082 </variablelist>
fb261f53
KY
3083 </refsect2>
3084
3085 <refsect2>
3086 <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title>
3087 <para>
3088 <!--
3089 A number of environment variables are made available to the startup
3090 hooks to provide configuration information and assist in the
3091 functioning of the hooks. Not all variables are valid in all
3092 contexts. In particular, all paths are relative to the host system
3093 and, as such, not valid during the <option>lxc.hook.start</option> hook.
3094 -->
dc421f3a
KY
3095 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。
3096 全ての変数が全てのコンテキストで利用可能なわけではありません。
3097 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。
fb261f53
KY
3098 </para>
3099 <variablelist>
50a8555e
KY
3100 <varlistentry>
3101 <term>
3102 <option>LXC_NAME</option>
3103 </term>
3104 <listitem>
3105 <para>
fb261f53 3106 <!--
50a8555e
KY
3107 The LXC name of the container. Useful for logging messages
3108 in common log environments. [<option>-n</option>]
fb261f53 3109 -->
dc421f3a 3110 LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>]
50a8555e
KY
3111 </para>
3112 </listitem>
3113 </varlistentry>
fb261f53
KY
3114 </variablelist>
3115 <variablelist>
50a8555e
KY
3116 <varlistentry>
3117 <term>
3118 <option>LXC_CONFIG_FILE</option>
3119 </term>
3120 <listitem>
3121 <para>
3122 <!--
3123 Host relative path to the container configuration file. This
3124 gives the container to reference the original, top level,
3125 configuration file for the container in order to locate any
3126 additional configuration information not otherwise made
3127 available. [<option>-f</option>]
fb261f53 3128 -->
dc421f3a
KY
3129 コンテナの設定ファイルのホスト上でのパス。
3130 これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>]
50a8555e
KY
3131 </para>
3132 </listitem>
3133 </varlistentry>
fb261f53
KY
3134 </variablelist>
3135 <variablelist>
50a8555e
KY
3136 <varlistentry>
3137 <term>
3138 <option>LXC_CONSOLE</option>
3139 </term>
3140 <listitem>
3141 <para>
fb261f53 3142 <!--
50a8555e 3143 The path to the console output of the container if not NULL.
e71b47b2 3144 [<option>-c</option>] [<option>lxc.console.path</option>]
fb261f53 3145 -->
dc421f3a 3146 設定されている場合のコンテナのコンソール出力のパス。
e71b47b2 3147 [<option>-c</option>] [<option>lxc.console.path</option>]
50a8555e
KY
3148 </para>
3149 </listitem>
3150 </varlistentry>
fb261f53
KY
3151 </variablelist>
3152 <variablelist>
50a8555e
KY
3153 <varlistentry>
3154 <term>
3155 <option>LXC_CONSOLE_LOGPATH</option>
3156 </term>
3157 <listitem>
3158 <para>
fb261f53 3159 <!--
50a8555e
KY
3160 The path to the console log output of the container if not NULL.
3161 [<option>-L</option>]
fb261f53 3162 -->
dc421f3a 3163 設定されている場合のコンテナのコンソールログ出力のパス。
50a8555e
KY
3164 [<option>-L</option>]
3165 </para>
3166 </listitem>
3167 </varlistentry>
fb261f53
KY
3168 </variablelist>
3169 <variablelist>
50a8555e
KY
3170 <varlistentry>
3171 <term>
3172 <option>LXC_ROOTFS_MOUNT</option>
3173 </term>
3174 <listitem>
3175 <para>
3176 <!--
3177 The mount location to which the container is initially bound.
3178 This will be the host relative path to the container rootfs
3179 for the container instance being started and is where changes
3180 should be made for that instance.
3181 [<option>lxc.rootfs.mount</option>]
fb261f53 3182 -->
dc421f3a
KY
3183 初期にコンテナがマウントされる場所。
3184 これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。
50a8555e
KY
3185 [<option>lxc.rootfs.mount</option>]
3186 </para>
3187 </listitem>
3188 </varlistentry>
fb261f53
KY
3189 </variablelist>
3190 <variablelist>
50a8555e
KY
3191 <varlistentry>
3192 <term>
3193 <option>LXC_ROOTFS_PATH</option>
3194 </term>
3195 <listitem>
3196 <para>
fb261f53 3197 <!--
50a8555e
KY
3198 The host relative path to the container root which has been
3199 mounted to the rootfs.mount location.
a64f3157 3200 [<option>lxc.rootfs.path</option>]
fb261f53 3201 -->
dc421f3a 3202 rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。
a64f3157 3203 [<option>lxc.rootfs.path</option>]
50a8555e
KY
3204 </para>
3205 </listitem>
3206 </varlistentry>
fb261f53 3207 </variablelist>
07945418
KY
3208 <variablelist>
3209 <varlistentry>
3210 <term>
3211 <option>LXC_SRC_NAME</option>
3212 </term>
3213 <listitem>
3214 <para>
3215 <!--
3216 Only for the clone hook. Is set to the original container name.
3217 -->
3218 clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。
3219 </para>
3220 </listitem>
3221 </varlistentry>
3222 </variablelist>
3c08e893
KY
3223 <variablelist>
3224 <varlistentry>
3225 <term>
3226 <option>LXC_TARGET</option>
3227 </term>
3228 <listitem>
3229 <para>
50a8555e 3230 <!--
3c08e893
KY
3231 Only for the stop hook. Is set to "stop" for a container
3232 shutdown or "reboot" for a container reboot.
50a8555e
KY
3233 -->
3234 stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。
3c08e893
KY
3235 </para>
3236 </listitem>
3237 </varlistentry>
3238 </variablelist>
63f2635d
KY
3239 <variablelist>
3240 <varlistentry>
3241 <term>
3242 <option>LXC_CGNS_AWARE</option>
3243 </term>
3244 <listitem>
3245 <para>
3246 <!--
3247 If unset, then this version of lxc is not aware of cgroup
3248 namespaces. If set, it will be set to 1, and lxc is aware
3249 of cgroup namespaces. Note this does not guarantee that
3250 cgroup namespaces are enabled in the kernel. This is used
3251 by the lxcfs mount hook.
3252 -->
cd548c9d
KY
3253 この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。
3254 この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。
63f2635d
KY
3255 </para>
3256 </listitem>
3257 </varlistentry>
3258 </variablelist>
fb261f53
KY
3259 </refsect2>
3260
3261 <refsect2>
3262 <title><!-- Logging -->ロギング</title>
3263 <para>
3264 <!--
3265 Logging can be configured on a per-container basis. By default,
3266 depending upon how the lxc package was compiled, container startup
3267 is logged only at the ERROR level, and logged to a file named after
3268 the container (with '.log' appended) either under the container path,
3269 or under @LOGPATH@.
3270 -->
dc421f3a
KY
3271 ロギングはコンテナごとに設定することが可能です。
3272 デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。
fb261f53
KY
3273 </para>
3274 <para>
3275 <!--
3276 Both the default log level and the log file can be specified in the
3277 container configuration file, overriding the default behavior. Note
3278 that the configuration file entries can in turn be overridden by the
3279 command line options to <command>lxc-start</command>.
3280 -->
dc421f3a
KY
3281 デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。
3282 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。
fb261f53
KY
3283 </para>
3284 <variablelist>
50a8555e
KY
3285 <varlistentry>
3286 <term>
46cc906d 3287 <option>lxc.log.level</option>
50a8555e
KY
3288 </term>
3289 <listitem>
3290 <para>
3291 <!--
3292 The level at which to log. The log level is an integer in
3293 the range of 0..8 inclusive, where a lower number means more
3294 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
3295 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
3296 alert, and 8 = fatal. If unspecified, the level defaults
3297 to 5 (error), so that only errors and above are logged.
fb261f53 3298 -->
dc421f3a
KY
3299 ログを取得するレベル。
3300 ログレベルは 0..8 の範囲の整数です。
3301 数字が小さいほど冗長なデバッグを意味します。
3302 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。
3303 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。
50a8555e
KY
3304 </para>
3305 <para>
fb261f53 3306 <!--
50a8555e
KY
3307 Note that when a script (such as either a hook script or a
3308 network interface up or down script) is called, the script's
3309 standard output is logged at level 1, debug.
fb261f53 3310 -->
dc421f3a 3311 (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。
50a8555e
KY
3312 </para>
3313 </listitem>
3314 </varlistentry>
3315 <varlistentry>
3316 <term>
fb736bbe 3317 <option>lxc.log.file</option>
50a8555e
KY
3318 </term>
3319 <listitem>
3320 <para>
3321 <!--
3322 The file to which logging info should be written.
fb261f53 3323 -->
dc421f3a 3324 ログ情報を書き込むファイル。
50a8555e
KY
3325 </para>
3326 </listitem>
3327 </varlistentry>
917420dd
KY
3328 <varlistentry>
3329 <term>
46cc906d 3330 <option>lxc.log.syslog</option>
917420dd
KY
3331 </term>
3332 <listitem>
3333 <para>
50a8555e 3334 <!--
917420dd 3335 Send logging info to syslog. It respects the log level defined in
46cc906d 3336 <command>lxc.log.level</command>. The argument should be the syslog
917420dd
KY
3337 facility to use, valid ones are: daemon, local0, local1, local2,
3338 local3, local4, local5, local5, local7.
50a8555e 3339 -->
46cc906d 3340 ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
917420dd
KY
3341 </para>
3342 </listitem>
3343 </varlistentry>
fb261f53
KY
3344 </variablelist>
3345 </refsect2>
3346
3347 <refsect2>
3348 <title><!-- Autostart -->自動起動</title>
3349 <para>
3350 <!--
3351 The autostart options support marking which containers should be
3352 auto-started and in what order. These options may be used by LXC tools
3353 directly or by external tooling provided by the distributions.
3354 -->
dc421f3a
KY
3355 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。
3356 このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。
fb261f53
KY
3357 </para>
3358
3359 <variablelist>
3360 <varlistentry>
3361 <term>
3362 <option>lxc.start.auto</option>
3363 </term>
3364 <listitem>
3365 <para>
3366 <!--
3367 Whether the container should be auto-started.
3368 Valid values are 0 (off) and 1 (on).
3369 -->
dc421f3a
KY
3370 コンテナを自動起動させるかどうかを設定します。
3371 有効な値は 0(オフ) か 1(オン) です。
fb261f53
KY
3372 </para>
3373 </listitem>
3374 </varlistentry>
3375 <varlistentry>
3376 <term>
3377 <option>lxc.start.delay</option>
3378 </term>
3379 <listitem>
3380 <para>
3381 <!--
3382 How long to wait (in seconds) after the container is
3383 started before starting the next one.
3384 -->
dc421f3a 3385 コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。
fb261f53
KY
3386 </para>
3387 </listitem>
3388 </varlistentry>
3389 <varlistentry>
3390 <term>
3391 <option>lxc.start.order</option>
3392 </term>
3393 <listitem>
3394 <para>
3395 <!--
3396 An integer used to sort the containers when auto-starting
3397 a series of containers at once.
3398 -->
dc421f3a 3399 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。
fb261f53
KY
3400 </para>
3401 </listitem>
3402 </varlistentry>
86b484e9
KY
3403 <varlistentry>
3404 <term>
3405 <option>lxc.monitor.unshare</option>
3406 </term>
3407 <listitem>
3408 <para>
3409 <!--
3410 If not zero the mount namespace will be unshared from the host
3411 before initializing the container (before running any pre-start
3412 hooks). This requires the CAP_SYS_ADMIN capability at startup.
3413 Default is 0.
3414 -->
3415 この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。
3416 </para>
3417 </listitem>
3418 </varlistentry>
fd5de029
KY
3419 <varlistentry>
3420 <term>
3421 <option>lxc.monitor.signal.pdeath</option>
3422 </term>
3423 <listitem>
3424 <para>
3425 <!--
3426 Set the signal to be sent to the container's init when the lxc
3427 monitor exits. By default it is set to SIGKILL which will cause
3428 all container processes to be killed when the lxc monitor process
3429 dies.
3430 To ensure that containers stay alive even if lxc monitor dies set
3431 this to 0.
3432 -->
3433 lxc のモニタプロセスが終了した際に、コンテナの init プロセスに送出するシグナルを指定します。デフォルトでは、lxc のモニタプロセスが終了した場合には、すべてのコンテナ内のプロセスが停止するように SIGKILL が設定されています。
3434 lxc のモニタプロセスが終了しても、コンテナがすべて確実に動作しつづけるようにするには、この値を 0 に設定します。
3435 </para>
3436 </listitem>
3437 </varlistentry>
fb261f53
KY
3438 <varlistentry>
3439 <term>
3440 <option>lxc.group</option>
3441 </term>
3442 <listitem>
3443 <para>
3444 <!--
3445 A multi-value key (can be used multiple times) to put the
3446 container in a container group. Those groups can then be
3447 used (amongst other things) to start a series of related
3448 containers.
3449 -->
dc421f3a 3450 コンテナを追加したいコンテナグループ名を指定します。
4db216f7 3451 複数の値を設定でき、複数回指定することもできます。
dc421f3a 3452 設定されたグループは、関連する一連のコンテナを起動させるために使われます。
fb261f53
KY
3453 </para>
3454 </listitem>
3455 </varlistentry>
3456 </variablelist>
3457 </refsect2>
3458
f57517ef
KY
3459 <refsect2>
3460 <title><!-- Autostart and System Boot -->自動起動とシステムブート</title>
3461 <para>
3462 <!--
3463 Each container can be part of any number of groups or no group at all.
3464 Two groups are special. One is the NULL group, i.e. the container does
3465 not belong to any group. The other group is the "onboot" group.
3466 -->
3467 コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。
3468 </para>
3469
3470 <para>
3471 <!--
3472 When the system boots with the LXC service enabled, it will first
3473 attempt to boot any containers with lxc.start.auto == 1 that is a member
3474 of the "onboot" group. The startup will be in order of lxc.start.order.
3475 If an lxc.start.delay has been specified, that delay will be honored
3476 before attempting to start the next container to give the current
3477 container time to begin initialization and reduce overloading the host
3478 system. After starting the members of the "onboot" group, the LXC system
3479 will proceed to boot containers with lxc.start.auto == 1 which are not
3480 members of any group (the NULL group) and proceed as with the onboot
3481 group.
3482 -->
3483 LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。
3484 lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。
3485 "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。
3486 </para>
3487
3488 </refsect2>
9231d3a4
KY
3489
3490 <refsect2>
3491 <title><!-- Container Environment -->コンテナの環境変数</title>
3492 <para>
3493 <!--
50a8555e
KY
3494 If you want to pass environment variables into the container (that
3495 is, environment variables which will be available to init and all of
3496 its descendents), you can use <command>lxc.environment</command>
3497 parameters to do so. Be careful that you do not pass in anything
3498 sensitive; any process in the container which doesn't have its
3499 environment scrubbed will have these variables available to it, and
3500 environment variables are always available via
3501 <command>/proc/PID/environ</command>.
9231d3a4
KY
3502 -->
3503 コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。
3504 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。
3505 </para>
3506
3507 <para>
3508 <!--
3509 This configuration parameter can be specified multiple times; once
3510 for each environment variable you wish to configure.
3511 -->
3512 この設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。
3513 </para>
3514
3515 <variablelist>
50a8555e
KY
3516 <varlistentry>
3517 <term>
3518 <option>lxc.environment</option>
3519 </term>
3520 <listitem>
3521 <para>
9231d3a4 3522 <!--
50a8555e
KY
3523 Specify an environment variable to pass into the container.
3524 Example:
9231d3a4
KY
3525 -->
3526 コンテナに渡したい環境変数を指定します。
3527 例:
50a8555e
KY
3528 </para>
3529 <programlisting>
3530 lxc.environment = APP_ENV=production
3531 lxc.environment = SYSLOG_SERVER=192.0.2.42
3532 </programlisting>
3533 </listitem>
3534 </varlistentry>
9231d3a4
KY
3535 </variablelist>
3536 </refsect2>
3537
fb261f53
KY
3538 </refsect1>
3539
3540 <refsect1>
3541 <title><!-- Examples -->例</title>
3542 <para>
3543 <!--
50a8555e
KY
3544 In addition to the few examples given below, you will find
3545 some other examples of configuration file in @DOCDIR@/examples
fb261f53 3546 -->
dc421f3a 3547 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。
fb261f53
KY
3548 </para>
3549 <refsect2>
3550 <title><!-- Network -->ネットワーク</title>
3551 <para>
3552 <!--
3553 This configuration sets up a container to use a veth pair
50a8555e
KY
3554 device with one side plugged to a bridge br0 (which has been
3555 configured before on the system by the administrator). The
3556 virtual network device visible in the container is renamed to
3557 eth0.
fb261f53 3558 -->
dc421f3a
KY
3559 この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。
3560 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。
fb261f53
KY
3561 </para>
3562 <programlisting>
b67771bc 3563 lxc.uts.name = myhostname
7fa3f2e9 3564 lxc.net.0.type = veth
3565 lxc.net.0.flags = up
3566 lxc.net.0.link = br0
3567 lxc.net.0.name = eth0
3568 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
e71b47b2
KY
3569 lxc.net.0.ipv4.address = 1.2.3.5/24 1.2.3.255
3570 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
fb261f53
KY
3571 </programlisting>
3572 </refsect2>
3573
3574 <refsect2>
3575 <title><!-- UID/GID mapping -->UID/GID のマッピング</title>
3576 <para><!-- This configuration will map both user and group ids in the
3577 range 0-9999 in the container to the ids 100000-109999 on the host. -->
dc421f3a 3578 この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。
fb261f53
KY
3579 </para>
3580 <programlisting>
bdcbb6b3
CB
3581 lxc.idmap = u 0 100000 10000
3582 lxc.idmap = g 0 100000 10000
fb261f53
KY
3583 </programlisting>
3584 </refsect2>
3585
3586 <refsect2>
3587 <title>Control group</title>
3588 <para>
3589 <!-- This configuration will setup several control groups for
3590 the application, cpuset.cpus restricts usage of the defined cpu,
3591 cpus.share prioritize the control group, devices.allow makes
3592 usable the specified devices.-->
dc421f3a
KY
3593 この設定は、アプリケーションのための control group をいくつか設定します。
3594 cpuset.cpus は定義された cpu のみ使用できるように制限します。
3595 cpus.share は、control group の (cpu) 優先度を指定します。
3596 devices.allow は、特定のデバイスを使用可能にします。
fb261f53
KY
3597 </para>
3598 <programlisting>
50a8555e
KY
3599 lxc.cgroup.cpuset.cpus = 0,1
3600 lxc.cgroup.cpu.shares = 1234
3601 lxc.cgroup.devices.deny = a
3602 lxc.cgroup.devices.allow = c 1:3 rw
3603 lxc.cgroup.devices.allow = b 8:0 rw
fb261f53
KY
3604 </programlisting>
3605 </refsect2>
3606
3607 <refsect2>
3608 <title><!-- Complex configuration -->複雑な設定</title>
3609 <para>
3610 <!-- This example show a complex configuration making a complex
3611 network stack, using the control groups, setting a new hostname,
3612 mounting some locations and a changing root file system. -->
dc421f3a 3613 この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。
fb261f53
KY
3614 </para>
3615 <programlisting>
b67771bc 3616 lxc.uts.name = complex
7fa3f2e9 3617 lxc.net.0.type = veth
3618 lxc.net.0.flags = up
3619 lxc.net.0.link = br0
3620 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
e71b47b2
KY
3621 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
3622 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
3623 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
7fa3f2e9 3624 lxc.net.1.type = macvlan
3625 lxc.net.1.flags = up
3626 lxc.net.1.link = eth0
3627 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
e71b47b2
KY
3628 lxc.net.1.ipv4.address = 10.2.3.4/24
3629 lxc.net.1.ipv4.address = 192.168.10.125/24
3630 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
7fa3f2e9 3631 lxc.net.2.type = phys
3632 lxc.net.2.flags = up
3633 lxc.net.2.link = dummy0
3634 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
e71b47b2
KY
3635 lxc.net.2.ipv4.address = 10.2.3.6/24
3636 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
2513f519
KY
3637 lxc.cgroup.cpuset.cpus = 0,1
3638 lxc.cgroup.cpu.shares = 1234
3639 lxc.cgroup.devices.deny = a
3640 lxc.cgroup.devices.allow = c 1:3 rw
3641 lxc.cgroup.devices.allow = b 8:0 rw
e71b47b2 3642 lxc.mount.fstab = /etc/fstab.complex
2513f519 3643 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
a64f3157 3644 lxc.rootfs.path = dir:/mnt/rootfs.complex
2513f519
KY
3645 lxc.cap.drop = sys_module mknod setuid net_raw
3646 lxc.cap.drop = mac_override
fb261f53
KY
3647 </programlisting>
3648 </refsect2>
3649
3650 </refsect1>
3651
3652 <refsect1>
3653 <title>See Also</title>
3654 <simpara>
3655 <citerefentry>
50a8555e
KY
3656 <refentrytitle><command>chroot</command></refentrytitle>
3657 <manvolnum>1</manvolnum>
fb261f53
KY
3658 </citerefentry>,
3659
3660 <citerefentry>
50a8555e
KY
3661 <refentrytitle><command>pivot_root</command></refentrytitle>
3662 <manvolnum>8</manvolnum>
fb261f53
KY
3663 </citerefentry>,
3664
3665 <citerefentry>
50a8555e
KY
3666 <refentrytitle><filename>fstab</filename></refentrytitle>
3667 <manvolnum>5</manvolnum>
fb261f53
KY
3668 </citerefentry>
3669
3670 <citerefentry>
50a8555e
KY
3671 <refentrytitle><filename>capabilities</filename></refentrytitle>
3672 <manvolnum>7</manvolnum>
fb261f53
KY
3673 </citerefentry>
3674
3675 </simpara>
3676 </refsect1>
3677
3678 &seealso;
3679
3680 <refsect1>
3681 <title><!-- Author -->作者</title>
3682 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
3683 </refsect1>
3684
3685</refentry>
3686
3687<!-- Keep this comment at the end of the file
3688Local variables:
3689mode: sgml
3690sgml-omittag:t
3691sgml-shorttag:t
3692sgml-minimize-attributes:nil
3693sgml-always-quote-attributes:t
3694sgml-indent-step:2
3695sgml-indent-data:t
3696sgml-parent-document:nil
3697sgml-default-dtd-file:nil
3698sgml-exposed-tags:nil
3699sgml-local-catalogs:nil
3700sgml-local-ecat-files:nil
3701End:
3702-->