Debian Codegraph @

doc/ja/lxc-unshare.sgml.in

raw
1 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
2
3 <!DOCTYPE refentry PUBLIC @docdtd@ [
4
5 <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
6 <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
7 ]>
8
9 <refentry>
10
11 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
12
13 <refmeta>
14 <refentrytitle>lxc-unshare</refentrytitle>
15 <manvolnum>1</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>lxc-unshare</refname>
20
21 <refpurpose>
22 <!--
23 Run a task in a new set of namespaces.
24 -->
25 タスクの新しい名前空間の組の中ので実行
26 </refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <cmdsynopsis>
31 <command>lxc-unshare</command>
32 <arg choice="req">-s, --namespaces <replaceable>namespaces</replaceable></arg>
33 <arg choice="opt">-u, --user <replaceable>user</replaceable></arg>
34 <arg choice="opt">-H, --hostname <replaceable>hostname</replaceable></arg>
35 <arg choice="opt">-i, --ifname <replaceable>ifname</replaceable></arg>
36 <arg choice="opt">-d, --daemon</arg>
37 <arg choice="opt">-M, --remount</arg>
38 <arg choice="req">command</arg>
39 </cmdsynopsis>
40 </refsynopsisdiv>
41
42 <refsect1>
43 <title><!-- Description -->説明</title>
44
45 <para>
46 <!--
47 <command>lxc-unshare</command> can be used to run a task in a cloned set
48 of namespaces. This command is mainly provided for testing purposes.
49 Despite its name, it always uses clone rather than unshare to create
50 the new task with fresh namespaces. Apart from testing kernel
51 regressions this should make no difference.
52 -->
53 <command>lxc-unshare</command> はクローンされた名前空間の組の中でタスクを実行するのに使います。
54 このコマンドは主にテスト目的で使います。
55 このような名前であるにもかかわらず、このコマンドは常に、新しい名前空間で新しいタスクを作成するために unshare ではなく clone を使います。
56 テスト中のカーネルの退行は別として、これで違いは生じないはずです。
57 </para>
58
59 </refsect1>
60
61 <refsect1>
62
63 <title><!-- Options -->オプション</title>
64
65 <variablelist>
66
67 <varlistentry>
68 <term>
69 <option>-s, --namespaces <replaceable>namespaces</replaceable></option>
70 </term>
71 <listitem>
72 <para>
73 <!--
74 Specify the namespaces to attach to, as a pipe-separated list,
75 e.g. <replaceable>NETWORK|IPC</replaceable>. Allowed values are
76 <replaceable>MOUNT</replaceable>, <replaceable>PID</replaceable>,
77 <replaceable>UTSNAME</replaceable>, <replaceable>IPC</replaceable>,
78 <replaceable>USER </replaceable> and
79 <replaceable>NETWORK</replaceable>. This allows one to change
80 the context of the process to e.g. the network namespace of the
81 container while retaining the other namespaces as those of the
82 host. (The pipe symbol needs to be escaped, e.g.
83 <replaceable>MOUNT\|PID</replaceable> or quoted, e.g.
84 <replaceable>"MOUNT|PID"</replaceable>.)
85 -->
86 アタッチする名前空間を、パイプでつなげたリストで指定します。
87 例えば <replaceable>NETWORK|IPC</replaceable> のようにです。
88 指定できる値は <replaceable>MOUNT</replaceable>、<replaceable>PID</replaceable>、<replaceable>UTSNAME</replaceable>、<replaceable>IPC</replaceable>、<replaceable>USER </replaceable>、<replaceable>NETWORK</replaceable> です。
89 これにより、プロセスのコンテキストを変更することができます。
90 例えば、コンテナのネットワーク名前空間だけを変更し、他の名前空間をホストのものと同じものに保ったままにするというようなことです。
91 (パイプ記号を <replaceable>MOUNT\|PID</replaceable> のようにエスケー
92 プするか、<replaceable>"MOUNT|PID"</replaceable> のように引用符号を付ける必要が>あります。)
93 </para>
94 </listitem>
95 </varlistentry>
96
97 <varlistentry>
98 <term>
99 <option>-u, --user <replaceable>user</replaceable></option>
100 </term>
101 <listitem>
102 <para>
103 <!--
104 Specify a user which the new task should become.
105 -->
106 新しいタスクを実行するユーザを指定します。
107 </para>
108 </listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term>
113 <option>-H, --hostname <replaceable>hostname</replaceable></option>
114 </term>
115 <listitem>
116 <para>
117 <!--
118 Set the hostname in the new container. Only allowed if
119 the UTSNAME namespace is set.
120 -->
121 新しいコンテナ内でのホスト名を設定します。UTSNAME 名前空間を指定している時のみ有効です。
122 </para>
123 </listitem>
124 </varlistentry>
125
126 <varlistentry>
127 <term>
128 <option>-i, --ifname <replaceable>interfacename</replaceable></option>
129 </term>
130 <listitem>
131 <para>
132 <!--
133 Move the named interface into the container. Only allowed
134 if the NETWORK namespace is set. You may specify this
135 argument multiple times to move multiple interfaces into
136 container.
137 -->
138 指定したインターフェースをコンテナ内に移動させます。ネットワーク (NETWORK) 名前空間を指定している時のみ有効です。複数のインターフェースをコンテナに移動させるために複数回指定することも可能です。
139 </para>
140 </listitem>
141 </varlistentry>
142
143 <varlistentry>
144 <term>
145 <option>-d, --daemon</option>
146 </term>
147 <listitem>
148 <para>
149 <!--
150 Daemonize (do not wait for the container to exit before exiting)
151 -->
152 デーモンにします (コマンドはコンテナの終了を待ちません)。
153 </para>
154 </listitem>
155 </varlistentry>
156
157 <varlistentry>
158 <term>
159 <option>-M, --remount</option>
160 </term>
161 <listitem>
162 <para>
163 <!--
164 Mount default filesystems (/proc /dev/shm and /dev/mqueue)
165 in the container. Only allowed if MOUNT namespace is set.
166 -->
167 コンテナ内でデフォルトのファイルシステム (/proc, /dev/shm, /dev/mqueue) をマウントします。マウント (MOUNT) 名前空間を指定している時のみ有効です。
168 </para>
169 </listitem>
170 </varlistentry>
171
172 </variablelist>
173
174 </refsect1>
175
176 <refsect1>
177 <title><!-- Examples -->例</title>
178 <para>
179 <!--
180 To spawn a new shell with its own UTS (hostname) namespace,
181 <programlisting>
182 lxc-unshare -s UTSNAME /bin/bash
183 </programlisting>
184 If the hostname is changed in that shell, the change will not be
185 reflected on the host.
186 -->
187 自身の UTS(hostname)名前空間でシェルを起動するには以下のように実行します。
188 <programlisting>
189 lxc-unshare -s UTSNAME /bin/bash
190 </programlisting>
191 もし、そのシェル上でホスト名を変更しても、その変更はホストには反映されません。
192 </para>
193 <para>
194 <!--
195 To spawn a shell in a new network, pid, and mount namespace,
196 <programlisting>
197 lxc-unshare -s "NETWORK|PID|MOUNT" /bin/bash
198 </programlisting>
199 The resulting shell will have pid 1 and will see no network interfaces.
200 After re-mounting /proc in that shell,
201 <programlisting>
202 mount -t proc proc /proc
203 </programlisting>
204 ps output will show there are no other processes in the namespace.
205 -->
206 新しいネットワーク、pid、マウント名前空間でシェルを起動するには以下のように実行します。
207 <programlisting>
208 lxc-unshare -s "NETWORK|PID|MOUNT" /bin/bash
209 </programlisting>
210 その結果起動するシェルは pid が 1 となり、ネットワークインターフェースがないでしょう。
211 そのシェル上で /proc を再マウントした後
212 <programlisting>
213 mount -t proc proc /proc
214 </programlisting>
215 ps の出力は、その名前空間内には他のプロセスが存在しない事を表示するでしょう。
216 </para>
217 <para>
218 <!--
219 To spawn a shell in a new network, pid, mount, and hostname
220 namespace.
221 <programlisting>
222 lxc-unshare -s "NETWORK|PID|MOUNT|UTSNAME" -M -H myhostname -i veth1 /bin/bash
223 </programlisting>
224 -->
225 新しいネットワーク、PID、マウント、ホスト名 (UTS) 名前空間でシェルを起動するには、
226 <programlisting>
227 lxc-unshare -s "NETWORK|PID|MOUNT|UTSNAME" -M -H myhostname -i veth1 /bin/bash
228 </programlisting>
229
230 <!--
231 The resulting shell will have pid 1 and will see two network
232 interfaces (lo and veth1). The hostname will be "myhostname" and
233 /proc will have been remounted. ps output will show there are
234 no other processes in the namespace.
235 -->
236 起動したシェルは PID 1 を持ち、2 つのネットワークインターフェース (lo と veth1) を持ちます。
237 ホスト名は "myhostname" となり、/proc は再マウントされます。ps コマンドは、名前空間内には他のプロセスがない状態を表示するでしょう。
238 </para>
239 </refsect1>
240
241 &seealso;
242
243 </refentry>
244
245 <!-- Keep this comment at the end of the file
246 Local variables:
247 mode: sgml
248 sgml-omittag:t
249 sgml-shorttag:t
250 sgml-minimize-attributes:nil
251 sgml-always-quote-attributes:t
252 sgml-indent-step:2
253 sgml-indent-data:t
254 sgml-parent-document:nil
255 sgml-default-dtd-file:nil
256 sgml-exposed-tags:nil
257 sgml-local-catalogs:nil
258 sgml-local-ecat-files:nil
259 End:
260 -->