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