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