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