]> git.proxmox.com Git - mirror_lxc.git/blob - doc/ja/lxc-attach.sgml.in
Add Japanese man pages.
[mirror_lxc.git] / doc / ja / lxc-attach.sgml.in
1 <!--
2
3 lxc: linux Container library
4
5 (C) Copyright IBM Corp. 2007, 2008
6
7 Authors:
8 Daniel Lezcano <daniel.lezcano at free.fr>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
24 Translated into Japanese
25 by KATOH Yasufumi <karma at jazz.email.ne.jp>
26
27 -->
28
29 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
30
31 <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
32 <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
33 ]>
34
35 <refentry>
36
37 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
38
39 <refmeta>
40 <refentrytitle>lxc-attach</refentrytitle>
41 <manvolnum>1</manvolnum>
42 </refmeta>
43
44 <refnamediv>
45 <refname>lxc-attach</refname>
46
47 <refpurpose>
48 <!--
49 start a process inside a running container.
50 -->
51 実行中のコンテナ内でプロセスを開始する
52 </refpurpose>
53 </refnamediv>
54
55 <refsynopsisdiv>
56 <cmdsynopsis>
57 <command>lxc-attach</command>
58 <arg choice="req">-n <replaceable>name</replaceable></arg>
59 <arg choice="opt">-a <replaceable>arch</replaceable></arg>
60 <arg choice="opt">-e</arg>
61 <arg choice="opt">-s <replaceable>namespaces</replaceable></arg>
62 <arg choice="opt">-R</arg>
63 <arg choice="opt">--keep-env</arg>
64 <arg choice="opt">--clear-env</arg>
65 <arg choice="opt">-- <replaceable>command</replaceable></arg>
66 </cmdsynopsis>
67 </refsynopsisdiv>
68
69 <refsect1>
70 <title><!-- Description -->説明</title>
71
72 <para>
73 <!--
74 <command>lxc-attach</command> runs the specified
75 <replaceable>command</replaceable> inside the container
76 specified by <replaceable>name</replaceable>. The container
77 has to be running already.
78 -->
79 <command>lxc-attach</command> は <replaceable>name</replaceable> で指定したコンテナ内で指定した <replaceable>command</replaceable> を実行します.実行する時点でコンテナが実行中でなければなりません.
80 </para>
81 <para>
82 <!--
83 If no <replaceable>command</replaceable> is specified, the
84 current default shell of the user running
85 <command>lxc-attach</command> will be looked up inside the
86 container and executed. This will fail if no such user exists
87 inside the container or the container does not have a working
88 nsswitch mechanism.
89 -->
90 もし <replaceable>command</replaceable> が指定されていない場合,<command>lxc-attach</command> コマンドを実行したユーザのデフォルトシェルをコンテナ内で調べて実行します.もしコンテナ内にユーザが存在しない場合や,コンテナで nsswitch 機構が働いていない場合はこの動作は失敗します.
91 </para>
92
93 </refsect1>
94
95 <refsect1>
96
97 <title><!-- Options -->オプション</title>
98
99 <variablelist>
100
101 <varlistentry>
102 <term>
103 <option>-a, --arch <replaceable>arch</replaceable></option>
104 </term>
105 <listitem>
106 <para>
107 <!--
108 Specify the architecture which the kernel should appear to be
109 running as to the command executed. This option will accept the
110 same settings as the <option>lxc.arch</option> option in
111 container configuration files, see
112 <citerefentry>
113 <refentrytitle><filename>lxc.conf</filename></refentrytitle>
114 <manvolnum>5</manvolnum>
115 </citerefentry>. By default, the current archictecture of the
116 running container will be used.
117 -->
118 コマンドを実行するコンテナのアーキテクチャを指定します.このオプションは,コンテナの設定ファイルで指定する <option>lxc.arch</option> オプションと同じものとして受け入れられます.
119 <citerefentry>
120 <refentrytitle><filename>lxc.conf</filename></refentrytitle>
121 <manvolnum>5</manvolnum>
122 </citerefentry> を参照してください.デフォルトでは,実行しているコンテナのアーキテクチャになります.
123 </para>
124 </listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term>
129 <option>-e, --elevated-privileges</option>
130 </term>
131 <listitem>
132 <para>
133 <!--
134 Do not drop privileges when running
135 <replaceable>command</replaceable> inside the container. If
136 this option is specified, the new process will
137 <emphasis>not</emphasis> be added to the container's cgroup(s)
138 and it will not drop its capabilities before executing.
139 -->
140 コンテナの内部で <replaceable>command</replaceable> を実行する時に特権を削除しません.もしこのオプションが指定された場合,新しいプロセスはコンテナの cgroup に追加 <emphasis>されず</emphasis>,実行する前にケーパビリティ (capability) も削除しません.
141 </para>
142 <para>
143 <!--
144 <emphasis>Warning:</emphasis> This may leak privileges into the
145 container if the command starts subprocesses that remain active
146 after the main process that was attached is terminated. The
147 (re-)starting of daemons inside the container is problematic,
148 especially if the daemon starts a lot of subprocesses such as
149 <command>cron</command> or <command>sshd</command>.
150 <emphasis>Use with great care.</emphasis>
151 -->
152 <emphasis>警告:</emphasis>もし実行するコマンドが,アタッチするメインプロセスが終了した後も実行されたままのサブプロセスを開始するような場合,このオプションの指定はコンテナ内への特権のリークとなる可能性があります.コンテナ内でのデーモンの開始(もしくは再起動)は問題となります.デーモンが多数のサブプロセスを開始する <command>cron</command> や <command>sshd</command> のような場合は特に問題となります.<emphasis>充分な注意を払って使用してください.</emphasis>
153 </para>
154 </listitem>
155 </varlistentry>
156
157 <varlistentry>
158 <term>
159 <option>-s, --namespaces <replaceable>namespaces</replaceable></option>
160 </term>
161 <listitem>
162 <para>
163 <!--
164 Specify the namespaces to attach to, as a pipe-separated list,
165 e.g. <replaceable>NETWORK|IPC</replaceable>. Allowed values are
166 <replaceable>MOUNT</replaceable>, <replaceable>PID</replaceable>,
167 <replaceable>UTSNAME</replaceable>, <replaceable>IPC</replaceable>,
168 <replaceable>USER </replaceable> and
169 <replaceable>NETWORK</replaceable>. This allows one to change
170 the context of the process to e.g. the network namespace of the
171 container while retaining the other namespaces as those of the
172 host.
173 -->
174 アタッチする名前空間をパイプで連結したリストで指定します.例えば <replaceable>NETWORK|IPC</replaceable> のようにです.ここで使用可能な値は <replaceable>MOUNT</replaceable>, <replaceable>PID</replaceable>, <replaceable>UTSNAME</replaceable>, <replaceable>IPC</replaceable>, <replaceable>USER </replaceable>, <replaceable>NETWORK</replaceable> です.これにより指定した名前空間にプロセスのコンテキストを変更できます.例えばコンテナのネットワーク名前空間に変更する一方で,他の名前空間はホストの名前空間のままにするというような事が可能です.
175 </para>
176 <para>
177 <!--
178 <emphasis>Important:</emphasis> This option implies
179 <option>&#045;e</option>.
180 -->
181 <emphasis>重要:</emphasis> このオプションは <option>-e</option> オプションを指定しなくても指定している場合と同様の動作をします.
182 </para>
183 </listitem>
184 </varlistentry>
185
186 <varlistentry>
187 <term>
188 <option>-R, --remount-sys-proc</option>
189 </term>
190 <listitem>
191 <para>
192 <!--
193 When using <option>&#045;s</option> and the mount namespace is not
194 included, this flag will cause <command>lxc-attach</command>
195 to remount <replaceable>/proc</replaceable> and
196 <replaceable>/sys</replaceable> to reflect the current other
197 namespace contexts.
198 -->
199 <option>-s</option> を指定し,そこにマウント名前空間が含まれない時,このオプションにより <command>lxc-attach</command> は <replaceable>/proc</replaceable> と <replaceable>/sys</replaceable> をリマウントします.これは現在の他の名前空間のコンテキストを反映させるためです.
200 </para>
201 <para>
202 <!--
203 Please see the <emphasis>Notes</emphasis> section for more
204 details.
205 -->
206 もっと詳細な説明は <emphasis>注意</emphasis> を参照してください.
207 </para>
208 <para>
209 <!--
210 This option will be ignored if one tries to attach to the
211 mount namespace anyway.
212 -->
213 このオプションは,マウント名前空間へのアタッチが行われる場合は無視されます.
214 </para>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry>
219 <term>
220 <option>--keep-env</option>
221 </term>
222 <listitem>
223 <para>
224 <!--
225 Keep the current environment for attached programs. This is
226 the current default behaviour (as of version 0.9), but is
227 is likely to change in the future, since this may leak
228 undesirable information into the container. If you rely on
229 the environment being available for the attached program,
230 please use this option to be future-proof. In addition to
231 current environment variables, container=lxc will be set.
232 -->
233 アタッチされるプログラムに対して現在の環境を保持したままにします.これは現在 (バージョン 0.9 時点) のデフォルトの動作ですが,将来は変更される予定です.この動作がコンテナ内への望ましくない情報の漏洩につながる可能性があるためです.アタッチするプログラムで環境変数が利用可能であることを期待している場合,将来的にもそれが保証されるようにこのオプションを使用するようにしてください.現在の環境変数に加えて,container=lxc が設定されます.
234 </para>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry>
239 <term>
240 <option>--clear-env</option>
241 </term>
242 <listitem>
243 <para>
244 <!--
245 Clear the environment before attaching, so no undesired
246 environment variables leak into the container. The variable
247 container=lxc will be the only environment with which the
248 attached program starts.
249 -->
250 アタッチする前に環境変数をクリアします.これによりコンテナへの不要な環境変数の漏洩が起こらなくなります.変数 container=lxc のみがアタッチするプログラムの開始の時の環境変数となります.
251 </para>
252 </listitem>
253 </varlistentry>
254
255 </variablelist>
256
257 </refsect1>
258
259 &commonoptions;
260
261 <refsect1>
262 <title><!-- Examples -->例</title>
263 <para>
264 <!--
265 To spawn a new shell running inside an existing container, use
266 <programlisting>
267 lxc-attach -n container
268 </programlisting>
269 -->
270 存在するコンテナ内で新しいシェルを生成するには,以下のようにします.
271 <programlisting>
272 lxc-attach -n container
273 </programlisting>
274 </para>
275 <para>
276 <!--
277 To restart the cron service of a running Debian container, use
278 <programlisting>
279 lxc-attach -n container &#045;&#045; /etc/init.d/cron restart
280 </programlisting>
281 -->
282 実行中の Debian コンテナの cron サービスを再起動するには,以下のように実行します.
283 <programlisting>
284 lxc-attach -n container -- /etc/init.d/cron restart
285 </programlisting>
286 </para>
287 <para>
288 <!--
289 To deactivate the network link eth1 of a running container that
290 does not have the NET_ADMIN capability, use either the
291 <option>-e</option> option to use increased capabilities,
292 assuming the <command>ip</command> tool is installed:
293 <programlisting>
294 lxc-attach -n container -e &#045;&#045; /sbin/ip link delete eth1
295 </programlisting>
296 -->
297 NET_ADMIN ケーパビリティを持たない実行中のコンテナのネットワークインターフェース eth1 の動作を停止させるには,ケーパビリティを増加させるために <option>-e</option> オプションを指定し,<command>ip</command> ツールがインストールされていることを前提に,以下のように実行します.
298 <programlisting>
299 lxc-attach -n container -e -- /sbin/ip link delete eth1
300 </programlisting>
301 </para>
302 </refsect1>
303
304 <refsect1>
305 <title><!-- Compatibility -->互換性</title>
306 <para>
307 <!--
308 Attaching completely (including the pid and mount namespaces) to a
309 container requires a patched kernel, please see the lxc website for
310 details. <command>lxc-attach</command> will fail in that case if
311 used with an unpatched kernel.
312 -->
313 (pid とマウント名前空間を含む) コンテナに対する完全なアタッチを行うにはパッチを適用したカーネルが必要となります.詳しくは lxc のウェブサイトを参照してください.(訳注: 3.8 カーネルから PID, マウント名前空間に対するアタッチも可能になっている)
314 </para>
315 <para>
316 <!--
317 Nevertheless, it will succeed on an unpatched kernel of version 3.0
318 or higher if the <option>-s</option> option is used to restrict the
319 namespaces that the process is to be attached to to one or more of
320 <replaceable>NETWORK</replaceable>, <replaceable>IPC</replaceable>
321 and <replaceable>UTSNAME</replaceable>.
322 -->
323 しかし,もし <option>-s</option> を使用して,アタッチするものを <replaceable>NETWORK</replaceable>, <replaceable>IPC</replaceable>, <replaceable>UTSNAME</replaceable> の 1 つか複数の名前空間に限定して使用すれば,バージョン 3.0 以上のパッチを適用していないカーネルでもアタッチが成功するでしょう.
324 </para>
325 <para>
326 <!--
327 Attaching to user namespaces is currently completely unsupported
328 by the kernel. <command>lxc-attach</command> should however be able
329 to do this once once future kernel versions implement this.
330 -->
331 ユーザ名前空間へのアタッチは,現時点ではカーネルで完全にサポートされていません.しかし,<command>lxc-attach</command> は,将来のカーネルがこの機能を実装した時点ですぐに,アタッチが可能になるはずです.
332 </para>
333 </refsect1>
334
335 <refsect1>
336 <title><!-- Notes -->注意</title>
337 <para>
338 <!--
339 The Linux <replaceable>/proc</replaceable> and
340 <replaceable>/sys</replaceable> filesystems contain information
341 about some quantities that are affected by namespaces, such as
342 the directories named after process ids in
343 <replaceable>/proc</replaceable> or the network interface infromation
344 in <replaceable>/sys/class/net</replaceable>. The namespace of the
345 process mounting the pseudo-filesystems determines what information
346 is shown, <emphasis>not</emphasis> the namespace of the process
347 accessing <replaceable>/proc</replaceable> or
348 <replaceable>/sys</replaceable>.
349 -->
350 Linux の <replaceable>/proc</replaceable> と <replaceable>/sys</replaceable> ファイルシステムは名前空間によって影響を受けるいくつかの情報を持っています.これは <replaceable>/proc</replaceable> 内のプロセス ID の名前のディレクトリや,<replaceable>/sys/class/net</replaceable> 内のネットワークインターフェース名のディレクトリなどです.擬似ファイルシステムをマウントしているプロセスの名前空間が,どのような情報を表示するかを決定します.<replaceable>/proc</replaceable> や <replaceable>/sys</replaceable> にアクセスしているプロセスの名前空間が決定するのではありません.
351 </para>
352 <para>
353 <!--
354 If one uses the <option>-s</option> option to only attach to
355 the pid namespace of a container, but not its mount namespace
356 (which will contain the <replaceable>/proc</replaceable> of the
357 container and not the host), the contents of <option>/proc</option>
358 will reflect that of the host and not the container. Analogously,
359 the same issue occurs when reading the contents of
360 <replaceable>/sys/class/net</replaceable> and attaching to just
361 the network namespace.
362 -->
363 <option>-s</option> を使ってコンテナの pid 名前空間のみをアタッチし,マウント名前空間 (これはコンテナの <replaceable>/proc</replaceable> を含み,ホストのは含まないでしょう) はアタッチしない場合,<option>/proc</option> のコンテンツはコンテナのものではなく,ホストのものとなります.似たような事例として,ネットワーク名前空間のみをアタッチして,<replaceable>/sys/class/net</replaceable> のコンテンツを読んだ場合も同じような事が起こるでしょう.
364 </para>
365 <para>
366 <!--
367 To work around this problem, the <option>-R</option> flag provides
368 the option to remount <replaceable>/proc</replaceable> and
369 <replaceable>/sys</replaceable> in order for them to reflect the
370 network/pid namespace context of the attached process. In order
371 not to interfere with the host's actual filesystem, the mount
372 namespace will be unshared (like <command>lxc-unshare</command>
373 does) before this is done, esentially giving the process a new
374 mount namespace, which is identical to the hosts's mount namespace
375 except for the <replaceable>/proc</replaceable> and
376 <replaceable>/sys</replaceable> filesystems.
377 -->
378 この問題への対処のために,<option>-R</option> オプションが <replaceable>/proc</replaceable> と <replaceable>/sys</replaceable> が提供されています.これにより,アタッチするプロセスのネットワーク/pid 名前空間のコンテキストを反映させることができます.ホストの実際のファイルシステムに影響を与えないために,実行前にはマウント名前空間は unshare されます (<command>lxc-unshare</command> のように).これは,<replaceable>/proc</replaceable> と <replaceable>/sys</replaceable> ファイルシステム以外はホストのマウント名前空間と同じである,新しいマウント名前空間がプロセスに与えられるということです.
379 </para>
380 </refsect1>
381
382 <refsect1>
383 <title><!-- Security -->セキュリティ</title>
384 <para>
385 <!--
386 The <option>-e</option> and <option>-s</option> options should
387 be used with care, as it may break the isolation of the containers
388 if used improperly.
389 -->
390 <option>-e</option> と <option>-s</option> オプションの使用には注意を払うべきです.不適切に使用した場合,コンテナの隔離を破壊してしまう可能性があります.
391 </para>
392 </refsect1>
393
394 &seealso;
395
396 <refsect1>
397 <title><!-- Author -->作者</title>
398 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
399 </refsect1>
400
401 </refentry>
402
403 <!-- Keep this comment at the end of the file
404 Local variables:
405 mode: sgml
406 sgml-omittag:t
407 sgml-shorttag:t
408 sgml-minimize-attributes:nil
409 sgml-always-quote-attributes:t
410 sgml-indent-step:2
411 sgml-indent-data:t
412 sgml-parent-document:nil
413 sgml-default-dtd-file:nil
414 sgml-exposed-tags:nil
415 sgml-local-catalogs:nil
416 sgml-local-ecat-files:nil
417 End:
418 -->