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