Merge pull request #1793 from tenforward/japanese

Update Japanese man pages
This commit is contained in:
Christian Brauner 2017-09-06 12:48:25 +02:00 committed by GitHub
commit a00b86ac4a
3 changed files with 344 additions and 528 deletions

View File

@ -1561,6 +1561,31 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>lxc.cgroup.dir</option>
</term>
<listitem>
<para>
<!--
specify a directory or path in which the container's cgroup will
be created. For example, setting
<option>lxc.cgroup.dir = my-cgroup/first</option> for a container
named "c1" will create the container's cgroup as a sub-cgroup of
"my-cgroup". For example, if the user's current cgroup "my-user"
is located in the root cgroup of the cpuset controllerin in a
cgroup v1 hierarchy this would create the cgroup
"/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
container. Any missing cgroups will be created by LXC. This
presupposes that the user has write access to its current cgroup.
-->
コンテナの cgroup を作成するパスやディレクトリを指定します。
例えば、"c1" という名前のコンテナで <option>lxc.cgroup.dir = my-cgroup/first</option> のように設定すると、"my-cgroup" のサブ cgroup のようにコンテナの cgroup を作成します。
例えば、ユーザのカレントの cgroup である "my-user" が cgroup v1 階層にある cpuset コントローラの root cgroup 内に存在する場合、この設定は "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" という cgroup をこのコンテナ向けに作成します。
存在しない cgroup は LXC が作成しますが、ユーザがカレントの cgroup に書き込み権を持っていることが前提となります。
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect2> </refsect2>

View File

@ -57,193 +57,100 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsect1>
<title><!-- Quick start -->クイックスタート</title>
<para>
<!--
You are in a hurry, and you don't want to read this man page. Ok,
without warranty, here are the commands to launch a shell inside
a container with a predefined configuration template, it may
work.
<command>@BINDIR@/lxc-execute -n foo -f
@DOCDIR@/examples/lxc-macvlan.conf /bin/bash</command>
-->
急いでいて、この man ページすら読みたくないという場合は、いいでしょう、
保証はないですが、あらかじめ準備されている設定テンプレートを使ったコンテナ内でシェルを動かすためのコマンドを紹介しましょう。
<command>@BINDIR@/lxc-execute -n foo -f
@DOCDIR@/examples/lxc-macvlan.conf /bin/bash</command>
</para>
</refsect1>
<refsect1> <refsect1>
<title><!-- Overview -->概要</title> <title><!-- Overview -->概要</title>
<para> <para>
<!-- <!--
The container technology is actively being pushed into the The container technology is actively being pushed into the mainstream
mainstream linux kernel. It provides the resource management Linux kernel. It provides resource management through control groups and
through the control groups aka process containers and resource resource isolation via namespaces.
isolation through the namespaces.
--> -->
コンテナ技術は、メインストリームの linux kernel で活発に開発が進んでいる技術です。 コンテナ技術は、メインストリームの Linux Kernel で活発に開発が進んでいる技術です。コンテナ技術は、cgroup によりリソースを管理する機能を提供し、名前空間によりリソースを隔離する機能を提供します。
コンテナ技術は、process container という名前でも知られる control groups の機能を使って、リソース管理を提供し、名前空間を使って、リソースの隔離を提供します。
</para> </para>
<para> <para>
<!-- <!--
The linux containers, <command>lxc</command>, aims to use these <command>lxc</command>, aims to use these new functionalities to provide a
new functionalities to provide a userspace container object userspace container object which provides full resource isolation and
which provides full resource isolation and resource control for resource control for an applications or a full system.
an applications or a system.
--> -->
linux コンテナ (<command>lxc</command>) は、ユーザースペースのコンテナオブジェクトを提供するための新しい機能を使う事を目指しています。 <command>lxc</command> は、アプリケーションまたはシステムのために完全なリソースの隔離やコントロールを提供する、ユーザースペースのコンテナオブジェクトを提供するためのこれらの新しい機能を使う事を目指しています。
この新しい機能とは、アプリケーションやシステムでの利用を目的とした、完全なリソースの隔離やリソースコントロールを提供する機能です。
</para> </para>
<para> <para>
<!-- <!--
The first objective of this project is to make the life easier <command>lxc</command> is small enough to easily manage a container with
for the kernel developers involved in the containers project and simple command lines and complete enough to be used for other purposes.
especially to continue working on the Checkpoint/Restart new
features. The <command>lxc</command> is small enough to easily
manage a container with simple command lines and complete enough
to be used for other purposes.
--> -->
このプロジェクトの第一の目的は、コンテナプロジェクトに参加するカーネル開発者の作業を快適にすることと、特に新機能である Checkpoint/Restart 機能への取り組みを続ける事です。 <command>lxc</command> は、シンプルなコマンドラインでコンテナを簡単に管理できるほど軽量で、他の用途に使うのにも十分に機能がそろっています。
<command>lxc</command> コマンドは、シンプルなコマンドでコンテナの管理を簡単に行えるように小さく、他の目的のために使うのに充分な機能を持っています。
</para> </para>
</refsect1> </refsect1>
<refsect1> <refsect1>
<title><!-- Requirements -->必要条件</title> <title><!-- Requirements -->動作条件</title>
<para> <para>
<!-- <!--
The <command>lxc</command> relies on a set of functionalities The kernel version >= 3.10 shipped with the distros, will work with
provided by the kernel which needs to be active. Depending of <command>lxc</command>, this one will have less functionalities but enough
the missing functionalities the <command>lxc</command> will to be interesting.
work with a restricted number of functionalities or will simply
fail.
--> -->
<command>lxc</command> は、カーネルが提供するいくつかの機能に依存しており、その機能がアクティブになっている必要があります。 カーネルのバージョンが 3.10 以上のディストリビューションであれば、<command>lxc</command> が動作するでしょう。このバージョンは機能は少ないですが、それでも十分楽しめるでしょう。
機能が足りない場合は、<command>lxc</command> は、いくつかの機能が制限されるか、単純に動作が失敗します。
</para> </para>
<para> <para>
<!-- <!--
The following list gives the kernel features to be enabled in <command>lxc</command> relies on a set of functionalities provided by the
the kernel to have the full features container: kernel. The helper script <command>lxc-checkconfig</command> will give
you information about your kernel configuration, required, and missing
features.
--> -->
以下のリストは、コンテナの全機能を有効にするために、カーネルで有効にする必要のある機能の一覧です。 <command>lxc</command> はカーネルが提供する様々な機能に依存します。<command>lxc-checkconfig</command> がカーネルの設定や、必要な機能、足りない機能についての情報を提供してくれるでしょう
</para> </para>
<programlisting>
* General setup
* Control Group support
-> Namespace cgroup subsystem
-> Freezer cgroup subsystem
-> Cpuset support
-> Simple CPU accounting cgroup subsystem
-> Resource counters
-> Memory resource controllers for Control Groups
* Group CPU scheduler
-> Basis for grouping tasks (Control Groups)
* Namespaces support
-> UTS namespace
-> IPC namespace
-> User namespace
-> Pid namespace
-> Network namespace
* Device Drivers
* Character devices
-> Support multiple instances of devpts
* Network device support
-> MAC-VLAN support
-> Virtual ethernet pair device
* Networking
* Networking options
-> 802.1d Ethernet Bridging
* Security options
-> File POSIX Capabilities
</programlisting>
<para>
<!--
The kernel version >= 3.10 shipped with the distros, will
work with <command>lxc</command>, this one will have less
functionalities but enough to be interesting.
The helper script <command>lxc-checkconfig</command> will give
you information about your kernel configuration.
-->
3.10 以上のバージョンが採用されているディストリビューションならば、<command>lxc</command> は動作するでしょう。
機能的には若干少ない形ですが、充分に楽しめるはずです。
ヘルパースクリプトの <command>lxc-checkconfig</command> を使って、あなたのカーネルの設定に関する情報を取得できるでしょう。
</para>
<para>
<!--
The control group can be mounted anywhere, eg:
<command>mount -t cgroup cgroup /cgroup</command>.
It is however recommended to use cgmanager, cgroup-lite or systemd
to mount the cgroup hierarchy under /sys/fs/cgroup.
-->
control group は、どこにでもマウント可能です。
例えば、<command>mount -t cgroup cgroup /cgroup</command> のようにです。
しかし、cgroup の階層構造を /sys/fs/cgroup 以下にマウントするために cgmanager や cgroup-lite や systemd の使用が推奨されています。
</para>
</refsect1> </refsect1>
<refsect1> <refsect1>
<title><!-- Functional specification -->機能仕様</title> <title><!-- Functional specification -->機能仕様</title>
<para> <para>
<!-- <!--
A container is an object isolating some resources of the host, A container is an object isolating some resources of the host, for the
for the application or system running in it. application or system running in it.
--> -->
コンテナは、コンテナ内で実行されているシステムやアプリケーションに対するホストのリソースのいくつかが、隔離されているオブジェクトです。 コンテナは、ホストのリソースのいくつかを隔離して、内部でアプリケーションやシステムを実行します。
</para> </para>
<para> <para>
<!-- <!--
The application / system will be launched inside a The application / system will be launched inside a container specified by
container specified by a configuration that is either a configuration that is either initially created or passed as a parameter
initially created or passed as parameter of the starting of the commands.
commands.
--> -->
アプリケーション/システムは、あらかじめ作成された設定もしくは開始コマンドのパラメータで指定された設定で、コンテナ内で実行されます。 アプリケーションやシステムは、あらかじめ作成した設定や、コマンドへのパラメータで与えた設定で、コンテナ内で実行されます。
</para> </para>
<para> <para>
<!-- <!--
How to run an application in a container ? How to run an application in a container
--> -->
どうやってコンテナ内でアプリケーションを実行するのでしょう? コンテナ内でアプリケーションを実行する方法
</para> </para>
<para> <para>
<!-- <!--
Before running an application, you should know what are the Before running an application, you should know what are the resources you
resources you want to isolate. The default configuration is to want to isolate. The default configuration is to isolate PIDs, the sysv
isolate the pids, the sysv ipc and the mount points. If you want IPC and mount points. If you want to run a simple shell inside a
to run a simple shell inside a container, a basic configuration container, a basic configuration is needed, especially if you want to
is needed, especially if you want to share the rootfs. If you share the rootfs. If you want to run an application like
want to run an application like <command>sshd</command>, you <command>sshd</command>, you should provide a new network stack and a new
should provide a new network stack and a new hostname. If you hostname. If you want to avoid conflicts with some files eg.
want to avoid conflicts with some files <filename>/var/run/httpd.pid</filename>, you should remount
eg. <filename>/var/run/httpd.pid</filename>, you should <filename>/var/run</filename> with an empty directory. If you want to
remount <filename>/var/run</filename> with an empty avoid the conflicts in all the cases, you can specify a rootfs for the
directory. If you want to avoid the conflicts in all the cases, container. The rootfs can be a directory tree, previously bind mounted
you can specify a rootfs for the container. The rootfs can be a with the initial rootfs, so you can still use your distro but with your
directory tree, previously bind mounted with the initial rootfs,
so you can still use your distro but with your
own <filename>/etc</filename> and <filename>/home</filename> own <filename>/etc</filename> and <filename>/home</filename>
--> -->
アプリケーションを実行する前に、隔離したいリソースについて知っておくべきです。 アプリケーションを実行する前に、隔離したいリソースについて知っておくべきです。デフォルトの設定では、PID、sysv IPC、マウントポイントが隔離されます。コンテナ内でシンプルなシェルを実行したい場合で、特に rootfs を共有したい場合、基本的な設定が必要です。
デフォルトの設定では、pid、sysv ipc、マウントポイントが隔離されます。 もし、<command>sshd</command> のようなアプリケーションを実行したい場合、新しいネットワークスタックと、新しいホスト名を準備しなくてはなりません。もし、同じファイル (<filename>/var/run/httpd.pid</filename> 等) の衝突を避けたい場合、空の <filename>/var/run/</filename> を再度マウントしなければなりません。
コンテナ内でシンプルなシェルを実行したい場合で、特に rootfs を共有したい場合、基本的な設定が必要です。 どんな場合でも衝突を避けたい場合、コンテナ専用の rootfs を指定することができます。rootfs はディレクトリツリーとする事も可能で、前もって元の rootfs を bind マウントし、<filename>/etc</filename> や <filename>/home</filename>だけは自身のディレクトリを使って、自身のディストリビューションを使えます。
もし、<command>sshd</command> のようなアプリケーションを実行したい場合、新しいネットワークスタックと、新しいホスト名を準備しなくてはなりません。
もし、同じファイル (<filename>/var/run/httpd.pid</filename> 等) の衝突を避けたい場合、空の <filename>/var/run/</filename> を再度マウントしなければなりません。
どんな場合でも、衝突を避けたい場合、コンテナ専用の rootfs を指定することができます。
rootfs はディレクトリツリーとなる事も可能で、前もって元の rootfs を bind マウントし、しかし、自身の <filename>/etc</filename> や <filename>/home</filename>を使って。自身のディストリビューションを使うことが可能です。
</para> </para>
<para> <para>
<!-- <!--
@ -268,7 +175,7 @@ rootfs
|&#045;&#045; usr |&#045;&#045; usr
`&#045;&#045; var `&#045;&#045; var
|&#045;&#045; empty |&#045;&#045; empty
| `&#045;&#045; sshd | `&#045;&#045; sshddd
|&#045;&#045; lib |&#045;&#045; lib
| `&#045;&#045; empty | `&#045;&#045; empty
| `&#045;&#045; sshd | `&#045;&#045; sshd
@ -327,41 +234,27 @@ rootfs
<para> <para>
<!-- <!--
How to run a system in a container ? How to run a system in a container
--> -->
コンテナ内でシステムを実行する方法は? コンテナ内でシステムを実行する方法
</para> </para>
<para> <para>
<!-- <!--
Running a system inside a container is paradoxically easier Running a system inside a container is paradoxically easier
than running an application. Why ? Because you don't have to care than running an application. Why? Because you don't have to care
about the resources to be isolated, everything need to be about the resources to be isolated, everything needs to be
isolated, the other resources are specified as being isolated but isolated, the other resources are specified as being isolated but
without configuration because the container will set them without configuration because the container will set them
up. eg. the ipv4 address will be setup by the system container up. eg. the ipv4 address will be setup by the system container
init scripts. Here is an example of the mount points file: init scripts. Here is an example of the mount points file:
<programlisting>
[root@lxc debian]$ cat fstab
/dev /home/root/debian/rootfs/dev none bind 0 0
/dev/pts /home/root/debian/rootfs/dev/pts none bind 0 0
</programlisting>
More information can be added to the container to facilitate the
configuration. For example, make accessible from the container
the resolv.conf file belonging to the host.
<programlisting>
/etc/resolv.conf /home/root/debian/rootfs/etc/resolv.conf none bind 0 0
</programlisting>
--> -->
コンテナ内でシステムを実行するのは、逆説的ではありますが、アプリケーションを実行するよりも簡単です。 コンテナ内でシステムを実行するのは、逆説的ではありますが、アプリケーションを実行するよりも簡単です。
それは、隔離するリソースについて考える必要がないからで、全てを隔離する必要があるからです。 それは、隔離するリソースについて考える必要がないからで、全てを隔離する必要があるからです。
他のリソースは、コンテナが設定を行うので、設定なしで隔離されるように指定されます。 他のリソースは、コンテナが設定を行うので、設定なしで隔離されるように指定されます。
例えば、IPv4 アドレスはコンテナの init スクリプトでシステムによってセットアップされるでしょう。 例えば、IPv4 アドレスはコンテナの init スクリプトでシステムによってセットアップされるでしょう。
以下に、(システムを実行するときの) マウントポイントファイルを示します。 以下に、(システムを実行するときの) マウントポイントファイルを示します。
</para>
<programlisting> <programlisting>
[root@lxc debian]$ cat fstab [root@lxc debian]$ cat fstab
@ -370,31 +263,21 @@ rootfs
/dev/pts /home/root/debian/rootfs/dev/pts none bind 0 0 /dev/pts /home/root/debian/rootfs/dev/pts none bind 0 0
</programlisting> </programlisting>
設定を手助けするために、コンテナに更なる情報を追加することも可能です。
例えば、ホスト上に存在する resolv.conf ファイルをコンテナからアクセス可能にするには、以下のようにします。
<programlisting>
/etc/resolv.conf /home/root/debian/rootfs/etc/resolv.conf none bind 0 0
</programlisting>
</para>
<refsect2> <refsect2>
<title><!-- Container life cycle -->コンテナのライフサイクル</title> <title><!-- Container life cycle -->コンテナのライフサイクル</title>
<para> <para>
<!-- <!--
When the container is created, it contains the configuration When the container is created, it contains the configuration
information. When a process is launched, the container will be information. When a process is launched, the container will be starting
starting and running. When the last process running inside the and running. When the last process running inside the container exits,
container exits, the container is stopped. the container is stopped.
--> -->
コンテナが作成されるとき、コンテナは設定情報を含みます。 コンテナが作成されるとき、コンテナは設定情報を含みます。プロセスが生成されるとき、コンテナは開始し、実行されるでしょう。コンテナ内で実行されている最後のプロセスが終了したとき、コンテナは停止します。
プロセスが生成されるとき、コンテナは開始し、実行されるでしょう。
コンテナ内で実行されている最後のプロセスが終了したとき、コンテナは停止します。
</para> </para>
<para> <para>
<!-- <!--
In case of failure when the container is initialized, it will In case of failure when the container is initialized, it will pass
pass through the aborting state. through the aborting state.
--> -->
コンテナの初期化時の失敗の場合は、(以下の図の) 中断の状態を通ります。 コンテナの初期化時の失敗の場合は、(以下の図の) 中断の状態を通ります。
</para> </para>
@ -441,35 +324,27 @@ rootfs
</citerefentry> </citerefentry>
--> -->
</para> </para>
コンテナは設定ファイル経由で設定します。設定の書式は以下で説明しています。 コンテナは設定ファイル経由で設定します。設定の書式は
<citerefentry> <citerefentry>
<refentrytitle><filename>lxc.conf</filename></refentrytitle> <refentrytitle><filename>lxc.conf</filename></refentrytitle>
<manvolnum>5</manvolnum> <manvolnum>5</manvolnum>
</citerefentry> </citerefentry>
で説明しています。
</refsect2> </refsect2>
<refsect2> <refsect2>
<title><!--Creating / Destroying container <title><!-- Creating / Destroying containers -->コンテナの作成と削除</title>
(persistent container) -->コンテナの生成と終了 (持続性のコンテナ)</title>
<para> <para>
<!-- <!--
A persistent container object can be A persistent container object can be created via the
created via the <command>lxc-create</command> <command>lxc-create</command> command. It takes a container name as
command. It takes a container name as parameter and parameter and optional configuration file and template. The name is
optional configuration file and template. used by the different commands to refer to this container. The
The name is used by the different <command>lxc-destroy</command> command will destroy the container
commands to refer to this object.
container. The <command>lxc-destroy</command> command will
destroy the container object.
<programlisting>
lxc-create -n foo
lxc-destroy -n foo
</programlisting>
--> -->
持続性のコンテナオブジェクトは <command>lxc-create</command> コマンドで作成することができます。 持続性のコンテナオブジェクトは <command>lxc-create</command> コマンドで作成できます。コマンドにはコンテナ名をパラメータとして与え、オプションで設定ファイルとテンプレートを指定します。ここで指定する名前は、他のコマンドからこのコンテナを参照する際に使います。
コマンドにはコンテナ名をパラメータとして、オプションで設定ファイルとテンプレートを指定します。 <command>lxc-destroy</command> コマンドはコンテナオブジェクトを削除します。
ここで指定する名前は、他のコマンドからこのコンテナを参照する際に使います。
<command>lxc-destroy</command> コマンドはコンテナオブジェクトを破壊します。
<programlisting> <programlisting>
lxc-create -n foo lxc-create -n foo
lxc-destroy -n foo lxc-destroy -n foo
@ -478,55 +353,42 @@ rootfs
</refsect2> </refsect2>
<refsect2> <refsect2>
<title><!-- Volatile container -->揮発性のコンテナ</title> <title><!-- Volatile container -->一時的な (揮発性の) コンテナ</title>
<para> <para>
<!-- <!--
It is not mandatory to create a container object It is not mandatory to create a container object before starting it.
before to start it. The container can be directly started with a configuration file as
The container can be directly started with a parameter.
configuration file as parameter.
--> -->
コンテナを開始する前にコンテナオブジェクトを作成する必要はありません。 コンテナを開始する前にコンテナオブジェクトを作成する必要はありません。パラメータとして設定ファイルを指定して、コンテナを直接起動できます。
コンテナを設定ファイルのパラメータで指定して直接開始することができます。
</para> </para>
</refsect2> </refsect2>
<refsect2> <refsect2>
<title><!-- Starting / Stopping container -->コンテナの開始と終了</title> <title><!-- Starting / Stopping container -->コンテナの起動と停止</title>
<para> <para>
<!-- <!--
When the container has been created, it is ready to run an When the container has been created, it is ready to run an application /
application / system. system. This is the purpose of the <command>lxc-execute</command> and
This is the purpose of the <command>lxc-execute</command> and <command>lxc-start</command> commands. If the container was not created
<command>lxc-start</command> commands. before starting the application, the container will use the
If the container was not created before configuration file passed as parameter to the command, and if there is
starting the application, the container will use the no such parameter either, then it will use a default isolation. If the
configuration file passed as parameter to the command, application ended, the container will be stopped, but if needed the
and if there is no such parameter either, then <command>lxc-stop</command> command can be used to stop the container.
it will use a default isolation.
If the application is ended, the container will be stopped also,
but if needed the <command>lxc-stop</command> command can
be used to kill the still running application.
--> -->
コンテナが作成されると、アプリケーションもしくはシステムとして実行することができます。 コンテナが作成されると、アプリケーションもしくはシステムを実行できます。このために使用するのが <command>lxc-execute</command> と <command>lxc-start</command> コマンドです。
このために使用するのが <command>lxc-execute</command> と <command>lxc-start</command> コマンドです。 アプリケーションを開始する前にコンテナを作成しなかった場合、コンテナはコマンドにパラメータとして渡した設定ファイルを使用します。もし、このようなパラメータもない場合は、デフォルトで指定されている通りに隔離されます。
アプリケーションが開始する前にコンテナが作成されなかった場合、コンテナはコマンドへ与えるパラメータを取得するのに設定ファイルを使うでしょう。 アプリケーションが終了した場合、コンテナも停止します。<command>lxc-stop</command> コマンドを使って、実行中のアプリケーションを停止することもできます。
もし、このようなパラメータもない場合は、デフォルトで指定されている通りに隔離されます。
アプリケーションが終了した場合、コンテナも停止しますが、実行中のアプリケーションを停止するには <command>lxc-stop</command> を使用する必要があります。
</para> </para>
<para> <para>
<!-- <!--
Running an application inside a container is not exactly the Running an application inside a container is not exactly the same thing
same thing as running a system. For this reason, there are two as running a system. For this reason, there are two different commands
different commands to run an application into a container: to run an application into a container:
<programlisting>
lxc-execute -n foo [-f config] /bin/bash
lxc-start -n foo [-f config] [/bin/bash]
</programlisting>
--> -->
コンテナ内のアプリケーションの実行は、正確にはシステムとして実行するのとは異なります。 コンテナ内でアプリケーションを実行することは、正確にはシステムとして実行するのとは異なります。このため、コンテナ内でアプリケーションを実行するためのコマンドには、2 種類の違ったものがあります。
そのような理由で、コンテナ内でアプリケーションを実行するためのコマンドには、2 種類の違ったものがあります。
<programlisting> <programlisting>
lxc-execute -n foo [-f config] /bin/bash lxc-execute -n foo [-f config] /bin/bash
lxc-start -n foo [-f config] [/bin/bash] lxc-start -n foo [-f config] [/bin/bash]
@ -535,39 +397,35 @@ rootfs
<para> <para>
<!-- <!--
<command>lxc-execute</command> command will run the The <command>lxc-execute</command> command will run the specified command
specified command into the container via an intermediate into a container via an intermediate process,
process, <command>lxc-init</command>. <command>lxc-init</command>.
This lxc-init after launching the specified command, This lxc-init after launching the specified command, will wait for its
will wait for its end and all other reparented processes. end and all other reparented processes. (to support daemons in the
(to support daemons in the container). container). In other words, in the container,
In other words, in the <command>lxc-init</command> has PID 1 and the first process of the
container, <command>lxc-init</command> has the pid 1 and the application has PID 2.
first process of the application has the pid 2.
--> -->
<command>lxc-execute</command> コマンドは、<command>lxc-init</command> プロセス経由で、コンテナ内で特定のコマンドを実行します。 <command>lxc-execute</command> コマンドは、間に <command>lxc-init</command> プロセスを介して、コンテナ内で指定したコマンドを実行します。
lxc-init はコマンドを実行した後、(コンテナ内でのデーモンの実行をサポートするために) 実行したコマンドと生成された全てのプロセスが終了するのを待ちます。 lxc-init はコマンドを実行した後、(コンテナ内でのデーモンの実行をサポートするために) 実行したコマンドと生成された全てのプロセスが終了するのを待ちます。
言いかえると、コンテナ内では <command>lxc-init</command> は pid 1 を持ち、アプリケーションの最初のプロセスは pid 2 をもちます。 言いかえると、コンテナ内では <command>lxc-init</command> は PID 1 を持ち、アプリケーションの最初のプロセスは PID 2 をもちます。
</para> </para>
<para> <para>
<!-- <!--
<command>lxc-start</command> command will run directly the specified The <command>lxc-start</command> command will directly run the specified
command into the container. command in the container. The PID of the first process is 1. If no
The pid of the first process is 1. If no command is command is specified <command>lxc-start</command> will run the command
specified <command>lxc-start</command> will defined in lxc.init.cmd or if not set, <filename>/sbin/init</filename> .
run the command defined in lxc.init.cmd or if not set,
<filename>/sbin/init</filename> .
--> -->
<command>lxc-start</command> コマンドは、コンテナ内の特定のコマンドを直接実行します。 <command>lxc-start</command> コマンドは、コンテナ内の特定のコマンドを直接実行します。最初のプロセスの PID が 1 となります。
最初のプロセスの pid が 1 となります。 もし、実行するコマンドが指定されていない場合は、<command>lxc-start</command> は lxc.init.cmd で設定されたコマンドを実行します。もし lxc.init.cmd が設定されていない場合は <filename>/sbin/init</filename> を実行します。
もし、実行するコマンドが指定されない場合は、<command>lxc-start</command> は lxc.init.cmd で設定されたコマンドを実行します。もし lxc.init.cmd が設定されていない場合は <filename>/sbin/init</filename> を実行します。
</para> </para>
<para> <para>
<!-- <!--
To summarize, <command>lxc-execute</command> is for running To summarize, <command>lxc-execute</command> is for running an
an application and <command>lxc-start</command> is better suited for application and <command>lxc-start</command> is better suited for
running a system. running a system.
--> -->
まとめると、<command>lxc-execute</command> はアプリケーションを実行するためのコマンドであり、<command>lxc-start</command> はシステムを実行するのにより適したコマンドです。 まとめると、<command>lxc-execute</command> はアプリケーションを実行するためのコマンドであり、<command>lxc-start</command> はシステムを実行するのにより適したコマンドです。
@ -575,15 +433,15 @@ rootfs
<para> <para>
<!-- <!--
If the application is no longer responding, is inaccessible or is If the application is no longer responding, is inaccessible or is not
not able to finish by itself, a able to finish by itself, a wild <command>lxc-stop</command> command
wild <command>lxc-stop</command> command will kill all the will kill all the processes in the container without pity.
processes in the container without pity.
<programlisting>
lxc-stop -n foo
</programlisting>
--> -->
もしアプリケーションの反応がなくなった場合や、アクセスできなくなった場合、自分で終了することができない場合は、荒っぽいですが、<command>lxc-stop</command> コマンドがコンテナ内の全てのプロセスを容赦なく停止させてくれるでしょう。 もしアプリケーションの反応がなくなった場合や、アクセスできなくなった場合、自分で終了できない場合は、荒っぽいですが、<command>lxc-stop</command> コマンドがコンテナ内の全てのプロセスを容赦なく停止させてくれるでしょう。
<programlisting>
lxc-stop -n foo -k
</programlisting>
</para> </para>
</refsect2> </refsect2>
@ -591,17 +449,13 @@ rootfs
<title><!-- Connect to an available tty -->利用可能な tty への接続</title> <title><!-- Connect to an available tty -->利用可能な tty への接続</title>
<para> <para>
<!-- <!--
If the container is configured with the ttys, it is possible If the container is configured with ttys, it is possible to access it
to access it through them. It is up to the container to through them. It is up to the container to provide a set of available
provide a set of available tty to be used by the following ttys to be used by the following command. When the tty is lost, it is
command. When the tty is lost, it is possible to reconnect it possible to reconnect to it without login again.
without login again.
<programlisting>
lxc-console -n foo -t 3
</programlisting>
--> -->
コンテナが tty を持つように設定されているならば、tty を通してコンテナにアクセスすることができます。 コンテナが tty を持つように設定されているならば、tty を通してコンテナにアクセスすることができます。
それは以下のコマンドが使う tty がコンテナで利用可能に設定されているか次第です。 アクセスできるかどうかは、以下のコマンドが使う tty がコンテナで利用できるように設定されているか次第です。
tty が失われたとき、再度のログインなしでその tty に再接続することが可能です。 tty が失われたとき、再度のログインなしでその tty に再接続することが可能です。
<programlisting> <programlisting>
lxc-console -n foo -t 3 lxc-console -n foo -t 3
@ -643,10 +497,10 @@ rootfs
<para> <para>
<!-- <!--
This feature is enabled if the cgroup freezer is enabled in the This feature is enabled if the freezer cgroup v1 controller is enabled
kernel. in the kernel.
--> -->
この機能は、カーネルで cgroup freezer 機能が有効になっている場合に使用可能です。 この機能は、カーネルで cgroup v1 の freezer コントローラが有効になっている場合に使用できます。
</para> </para>
</refsect2> </refsect2>
@ -655,47 +509,34 @@ rootfs
コンテナに関する情報の取得</title> コンテナに関する情報の取得</title>
<para> <para>
<!-- <!--
When there are a lot of containers, it is hard to follow When there are a lot of containers, it is hard to follow what has been
what has been created or destroyed, what is running or what are created or destroyed, what is running or what are the PIDs running in a
the pids running into a specific container. For this reason, the specific container. For this reason, the following commands may be useful:
following commands may be useful:
<programlisting>
lxc-ls
lxc-info -n foo
</programlisting>
--> -->
多数のコンテナが存在する場合、それらが実行されたり破壊されたりすること、何が実行されていて、特定のコンテナ内で実行されている pid が何であるかをフォローするのは大変です。 多数のコンテナが存在する場合、それらが実行されたり削除されたりすること、何が実行されていて、特定のコンテナ内で実行されている PID が何であるかをフォローするのは大変です。このような時には、以下のようなコマンドが役に立つかもしれません。
このような時には、以下のようなコマンドが役に立つかもしれません。
<programlisting> <programlisting>
lxc-ls lxc-ls -f
lxc-info -n foo lxc-info -n foo
</programlisting> </programlisting>
</para> </para>
<para> <para>
<!-- <!--
<command>lxc-ls</command> lists the containers of the <command>lxc-ls</command> lists containers.
system.
--> -->
<command>lxc-ls</command> は、システムのコンテナを一覧します。 <command>lxc-ls</command> はコンテナをリスト表示します。
</para> </para>
<para> <para>
<!-- <!--
<command>lxc-info</command> gives information for a specific <command>lxc-info</command> gives information for a specific container.
container.
--> -->
<command>lxc-info</command> は、指定したコンテナに関する情報を取得します。 <command>lxc-info</command> は、指定したコンテナに関する情報を表示します。
</para> </para>
<para> <para>
<!-- <!--
Here is an example on how the combination of these commands Here is an example on how the combination of these commands
allows one to list all the containers and retrieve their state. allows one to list all the containers and retrieve their state.
<programlisting>
for i in $(lxc-ls -1); do
lxc-info -n $i
done
</programlisting>
--> -->
ここで、以上のコマンドを組み合わせて、どのようにしたら全てのコンテナのリストと、それぞれの状態が得られるかの例を示します。 ここで、以上のコマンドを組み合わせて、どのようにしたら全てのコンテナのリストと、それぞれの状態が得られるかの例を示します。
<programlisting> <programlisting>
@ -711,49 +552,38 @@ rootfs
<title><!-- Monitoring container -->コンテナのモニタリング</title> <title><!-- Monitoring container -->コンテナのモニタリング</title>
<para> <para>
<!-- <!--
It is sometime useful to track the states of a container, It is sometime useful to track the states of a container, for example to
for example to monitor it or just to wait for a specific monitor it or just to wait for a specific state in a script.
state in a script.
--> -->
時々、コンテナの状態を追跡することが出来ると便利な事があります。 時々、コンテナの状態を追跡することが出来ると便利な事があります。例えば、状態をモニタリングしたり、スクリプト内で特定の状態を待ったりするような場合です。
例えば、状態をモニタリングしたり、スクリプト内で特定の状態を待ったりするような場合です。
</para> </para>
<para> <para>
<!-- <!--
<command>lxc-monitor</command> command will monitor one or <command>lxc-monitor</command> command will monitor one or several
several containers. The parameter of this command accept a containers. The parameter of this command accepts a regular expression
regular expression for example: for example:
<programlisting>
lxc-monitor -n "foo|bar"
</programlisting>
will monitor the states of containers named 'foo' and 'bar', and:
<programlisting>
lxc-monitor -n ".*"
</programlisting>
will monitor all the containers.
--> -->
<command>lxc-monitor</command> コマンドは、一つもしくはいくつかのコンテナをモニタリングします。 <command>lxc-monitor</command> コマンドは、一つもしくは複数のコンテナをモニタリングします。このコマンドのパラメータは、正規表現を受け付けます。例えば
このコマンドのパラメータは、正規表現を受け付けます。例えば
<programlisting> <programlisting>
lxc-monitor -n "foo|bar" lxc-monitor -n "foo|bar"
</programlisting> </programlisting>
<!--
will monitor the states of containers named 'foo' and 'bar', and:
-->
は 'foo' と 'bar' という名前のコンテナの状態をモニタリングします。そして、 は 'foo' と 'bar' という名前のコンテナの状態をモニタリングします。そして、
<programlisting> <programlisting>
lxc-monitor -n ".*" lxc-monitor -n ".*"
</programlisting> </programlisting>
<!--
will monitor all the containers.
-->
は全てのコンテナの状態をモニタリングします。 は全てのコンテナの状態をモニタリングします。
</para> </para>
<para> <para>
<!-- <!--
For a container 'foo' starting, doing some work and exiting, For a container 'foo' starting, doing some work and exiting,
the output will be in the form: the output will be in the form:
<programlisting>
'foo' changed state to [STARTING]
'foo' changed state to [RUNNING]
'foo' changed state to [STOPPING]
'foo' changed state to [STOPPED]
</programlisting>
--> -->
コンテナ 'foo' が開始され、いくつか処理を行い、終了した場合、出力は以下のようになります。 コンテナ 'foo' が開始され、いくつか処理を行い、終了した場合、出力は以下のようになります。
<programlisting> <programlisting>
@ -769,29 +599,10 @@ rootfs
state change and exit. This is useful for scripting to state change and exit. This is useful for scripting to
synchronize the launch of a container or the end. The synchronize the launch of a container or the end. The
parameter is an ORed combination of different states. The parameter is an ORed combination of different states. The
following example shows how to wait for a container if he went following example shows how to wait for a container if it successfully
to the background. started as a daemon.
<programlisting>
<![CDATA[
# launch lxc-wait in background
lxc-wait -n foo -s STOPPED &
LXC_WAIT_PID=$!
# this command goes in background
lxc-execute -n foo mydaemon &
# block until the lxc-wait exits
# and lxc-wait exits when the container
# is STOPPED
wait $LXC_WAIT_PID
echo "'foo' is finished"
]]>
</programlisting>
--> -->
<command>lxc-wait</command> コマンドは指定した状態を待って、終了します。 <command>lxc-wait</command> コマンドは指定した状態を待って終了します。これは、コンテナの開始や終了に同期したいスクリプトで役に立ちます。パラメータは、異なった状態の論理和 (OR) を指定します。
これは、コンテナの開始や終了に同期したいスクリプトで役に立ちます。
パラメータは、異なった状態の論理和 (OR) を指定します。
以下の例は、バックグラウンドで実行されたコンテナをどのようにして待つかを示します。 以下の例は、バックグラウンドで実行されたコンテナをどのようにして待つかを示します。
<programlisting> <programlisting>
@ -814,19 +625,16 @@ rootfs
</refsect2> </refsect2>
<refsect2> <refsect2>
<title><!-- Setting the control group for container --> <title><!-- cgroup settings for containers -->コンテナの cgroup の設定</title>
コンテナの control group の設定
</title>
<para> <para>
<!-- <!--
The container is tied with the control groups, when a The container is tied with the control groups, when a container is
container is started a control group is created and associated started a control group is created and associated with it. The control
with it. The control group properties can be read and modified group properties can be read and modified when the container is running
when the container is running by using the lxc-cgroup command. by using the lxc-cgroup command.
--> -->
コンテナは control group と結合しています。 コンテナは control group と結合しています。コンテナを開始すると cgroup が生成され、結びつけられます。
コンテナが開始すると control group が生成され、それと結びつけられます。 cgroup のプロパティは、lxc-cgroup コマンドを使って、コンテナが実行中に読み取ったり変更したりできます。
control group のプロパティは、lxc-cgroup コマンドを使って、コンテナが実行中に読み取ったり、変更したりすることができます。
</para> </para>
<para> <para>
<!-- <!--
@ -836,52 +644,35 @@ rootfs
command won't do any syntax checking on the subsystem name, if command won't do any syntax checking on the subsystem name, if
the subsystem name does not exists, the command will fail. the subsystem name does not exists, the command will fail.
--> -->
<command>lxc-cgroup</command> コマンドは、コンテナと結びつけられている control group サブシステムを設定したり、取得したりするのに使います。 <command>lxc-cgroup</command> コマンドは、コンテナと結びつけられている control group サブシステムを設定したり、取得したりするのに使います。サブシステム名の指定はユーザが行ない、このコマンドはサブシステム名の文法チェックは一切行ないません。もし、指定したサブシステム名が存在しない場合は、コマンドの実行は失敗します。
サブシステム名の指定はユーザが行ない、このコマンドはサブシステム名の文法チェックは一切行ないません。
もし、指定したサブシステム名が存在しない場合は、コマンドの実行は失敗します。
</para> </para>
<para> <para>
<programlisting>
lxc-cgroup -n foo cpuset.cpus
</programlisting>
<!-- <!--
<programlisting>
lxc-cgroup -n foo cpuset.cpus
</programlisting>
will display the content of this subsystem. will display the content of this subsystem.
<programlisting>
lxc-cgroup -n foo cpu.shares 512
</programlisting>
will set the subsystem to the specified value.
--> -->
<programlisting>
lxc-cgroup -n foo cpuset.cpus
</programlisting>
は、このサブシステムの内容を表示します。 は、このサブシステムの内容を表示します。
<programlisting> <programlisting>
lxc-cgroup -n foo cpu.shares 512 lxc-cgroup -n foo cpu.shares 512
</programlisting> </programlisting>
<!--
will set the subsystem to the specified value.
-->
は、このサブシステムに指定した値を設定します。 は、このサブシステムに指定した値を設定します。
</para> </para>
</refsect2> </refsect2>
</refsect1> </refsect1>
<refsect1>
<title><!-- Bugs -->バグ</title>
<para>
<!--
The <command>lxc</command> is still in development, so the
command syntax and the API can change. The version 1.0.0 will be
the frozen version.
-->
<command>lxc</command> はまだ開発中です。
従って、コマンドの文法や API は変更される可能性があります。
バージョン 1.0.0 がそれらを凍結するバージョンとなるでしょう。
</para>
</refsect1>
&seealso; &seealso;
<refsect1> <refsect1>
<title><!-- Author -->作者</title> <title><!-- Author -->作者</title>
<para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para> <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
<para>Christian Brauner <email>christian.brauner@ubuntu.com</email></para>
<para>Serge Hallyn <email>serge@hallyn.com</email></para>
<para>Stéphane Graber <email>stgraber@ubuntu.com</email></para>
</refsect1> </refsect1>
</refentry> </refentry>

View File

@ -1140,7 +1140,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<option>lxc.cgroup.dir = my-cgroup/first</option> for a container <option>lxc.cgroup.dir = my-cgroup/first</option> for a container
named "c1" will create the container's cgroup as a sub-cgroup of named "c1" will create the container's cgroup as a sub-cgroup of
"my-cgroup". For example, if the user's current cgroup "my-user" "my-cgroup". For example, if the user's current cgroup "my-user"
is located in the root cgroup of the cpuset controllerin in a is located in the root cgroup of the cpuset controller in a
cgroup v1 hierarchy this would create the cgroup cgroup v1 hierarchy this would create the cgroup
"/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
container. Any missing cgroups will be created by LXC. This container. Any missing cgroups will be created by LXC. This