[lxc-devel] [lxc/master] Update Japanese man pages

tenforward on Github lxc-bot at linuxcontainers.org
Fri Sep 20 09:17:41 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 457 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190920/a4a6e682/attachment.bin>
-------------- next part --------------
From 6da6d73e44a116e9f469e1ea789c00a0fae14a12 Mon Sep 17 00:00:00 2001
From: KATOH Yasufumi <karma at jazz.email.ne.jp>
Date: Fri, 20 Sep 2019 01:15:12 +0900
Subject: [PATCH 1/2] doc: Add Japanese pam_cgfs(8) man page

* translate pam_cgfs(8)
* support --{enable,disable}-{commands,tools} in doc/ja

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
---
 .gitignore              |   1 +
 configure.ac            |   2 +
 doc/ja/Makefile.am      |  81 +++++-----
 doc/ja/pam_cgfs.sgml.in | 327 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 376 insertions(+), 35 deletions(-)
 create mode 100644 doc/ja/pam_cgfs.sgml.in

diff --git a/.gitignore b/.gitignore
index ce33d3459c..b2d4657c43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ doc/*.8
 doc/ja/*.1
 doc/ja/*.5
 doc/ja/*.7
+doc/ja/*.8
 doc/ko/*.1
 doc/ko/*.5
 doc/ko/*.7
diff --git a/configure.ac b/configure.ac
index e546443ade..02fac6ed78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -913,6 +913,8 @@ AC_CONFIG_FILES([
 	doc/ja/lxc-usernsexec.sgml
 	doc/ja/lxc-wait.sgml
 
+	doc/ja/pam_cgfs.sgml
+
 	doc/ja/lxc.conf.sgml
 	doc/ja/lxc.container.conf.sgml
 	doc/ja/lxc.system.conf.sgml
diff --git a/doc/ja/Makefile.am b/doc/ja/Makefile.am
index 89eae5ad54..ee46c8bcf3 100644
--- a/doc/ja/Makefile.am
+++ b/doc/ja/Makefile.am
@@ -7,40 +7,47 @@ EXTRA_DIST = \
 	FAQ.txt
 
 if ENABLE_DOCBOOK
-man_MANS = \
-	lxc-attach.1 \
-	lxc-autostart.1 \
-	lxc-cgroup.1 \
-	lxc-checkconfig.1 \
-	lxc-checkpoint.1 \
-	lxc-config.1 \
-	lxc-console.1 \
-	lxc-copy.1 \
-	lxc-create.1 \
-	lxc-destroy.1 \
-	lxc-device.1 \
-	lxc-execute.1 \
-	lxc-freeze.1 \
-	lxc-info.1 \
-	lxc-ls.1 \
-	lxc-monitor.1 \
-	lxc-snapshot.1 \
-	lxc-start.1 \
-	lxc-stop.1 \
-	lxc-top.1 \
-	lxc-unfreeze.1 \
-	lxc-unshare.1 \
-	lxc-update-config.1 \
-	lxc-user-nic.1 \
-	lxc-usernsexec.1 \
-	lxc-wait.1 \
-	\
-	lxc.conf.5 \
-	lxc.container.conf.5 \
-	lxc.system.conf.5 \
-	lxc-usernet.5 \
-	\
-	lxc.7
+man_MANS = lxc.conf.5 \
+	   lxc.container.conf.5 \
+	   lxc.system.conf.5 \
+	   lxc-usernet.5 \
+	   lxc.7
+
+if ENABLE_TOOLS
+man_MANS += lxc-attach.1 \
+	    lxc-autostart.1 \
+	    lxc-cgroup.1 \
+	    lxc-checkconfig.1 \
+	    lxc-checkpoint.1 \
+	    lxc-config.1 \
+	    lxc-console.1 \
+	    lxc-copy.1 \
+	    lxc-create.1 \
+	    lxc-destroy.1 \
+	    lxc-device.1 \
+	    lxc-execute.1 \
+	    lxc-freeze.1 \
+	    lxc-info.1 \
+	    lxc-ls.1 \
+	    lxc-monitor.1 \
+	    lxc-snapshot.1 \
+	    lxc-start.1 \
+	    lxc-stop.1 \
+	    lxc-top.1 \
+	    lxc-unfreeze.1 \
+	    lxc-unshare.1 \
+	    lxc-wait.1
+endif
+
+if ENABLE_PAM
+man_MANS += pam_cgfs.8
+endif
+
+if ENABLE_COMMANDS
+man_MANS += lxc-update-config.1 \
+	    lxc-user-nic.1 \
+	    lxc-usernsexec.1
+endif
 
 %.1 : %.sgml
 	$(db2xman) --encoding=UTF-8 $<
@@ -54,8 +61,12 @@ man_MANS = \
 	$(db2xman) --encoding=UTF-8 $<
 	test "$(shell basename $@)" != "$@" && mv $(shell basename $@) $@ || true
 
+%.8 : %.sgml
+	$(db2xman) --encoding=UTF-8 $<
+	test "$(shell basename $@)" != "$@" && mv $(shell basename $@) $@ || true
+
 lxc-%.sgml : common_options.sgml see_also.sgml
 
 clean-local:
-	$(RM) manpage.* *.7 *.5 *.1 $(man_MANS)
+	$(RM) manpage.* *.7 *.5 *.1 *.8 $(man_MANS)
 endif
diff --git a/doc/ja/pam_cgfs.sgml.in b/doc/ja/pam_cgfs.sgml.in
new file mode 100644
index 0000000000..bc8c470def
--- /dev/null
+++ b/doc/ja/pam_cgfs.sgml.in
@@ -0,0 +1,327 @@
+<!--
+
+lxc: linux Container library
+
+(C) Copyright Canonical Inc. 2019
+
+Authors:
+Venkata Harshavardhan Reddy Allu <venkataharshavardhan_ven at srmuniv.edu.in>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Translated into Japanese
+by KATOH Yasufumi <karma at jazz.email.ne.jp>
+
+-->
+
+<!DOCTYPE refentry PUBLIC @docdtd@ [
+
+<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
+]>
+
+<refentry>
+
+  <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
+
+  <refmeta>
+    <refentrytitle>pam_cgfs</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>pam_cgfs</refname>
+
+    <refpurpose>
+      <!--
+      cgroup management for unprivileged LXC containers.
+        -->
+      非特権の LXC コンテナのための cgroup を管理する
+    </refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>pam_cgfs.so</command>
+      <arg choice="req">-c <replaceable>kernel_controller,name=named_controller</replaceable></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title><!-- Description -->説明</title>
+
+    <para>
+      <!--
+      LXC has supported fully unprivileged containers since LXC 1.0.
+      Fully unprivileged containers are the safest containers and are run by
+      normal (non-root) users.  This is achieved by using user namespaces by
+      mapping between a range of UIDs and GIDs on the host to a different
+      (unprivileged) range of UIDs and GIDs in the container. That means the uid
+      0 (root) in the container is mapped to an unprivileged user id (something
+      like 1000000) outside of the container and only has rights on resources
+      that it owns itself.
+      -->
+      LXC は LXC 1.0 以降、完全な非特権コンテナをサポートしてきました。完全な非特権コンテナは安全なコンテナであり、一般ユーザ(非 root)で実行できます。これはホスト上の特権のない UID と GID の範囲を、それとは異なるコンテナ内の UID と GID の範囲にマッピングするユーザ名前空間を使うことで実現しています。これは、コンテナ内の UID 0 (root) が、コンテナの外では 1000000 のような特権のないユーザ ID にマッピングされ、自身の所有するリソースに対してのみ権限を有することを意味します。
+    </para>
+    <para>
+      <!--
+      Cgroup management of fully unprivileged containers means restricting the
+      resources used by these containers like limiting the CPU usage of a
+      container, or the number of processes it is allowed to spawn, or the
+      memory it is allowed to consume. It is clear that the fully
+      unprivileged containers are run by normal users and there is a need to
+      limit and manage resource consumption among the containers.
+      But unprivileged cgroup management is not easy with most init systems.
+      So, the pam_cgfs.so came into existence.
+      -->
+      完全な非特権コンテナの cgroup 管理は、このようなコンテナが使用するリソースを制限するということです。例えば、コンテナの CPU 使用量を制限したり、コンテナ内で起動するプロセスの数を制限したり、コンテナが消費できるメモリを制限したりということです。
+      完全な非特権コンテナは一般ユーザによって実行され、コンテナ間のリソース消費を制限、管理する必要があるということは明らかです。
+      しかし、非特権での cgroup 管理はほとんどの init システムでは簡単ではありません。
+      そこで、pam_cgfs.so が誕生したのです。
+    </para>
+
+    <para>
+      <!--
+      The <command>pam_cgfs.so</command> module can handle both pure cgroupfs v1
+      (<filename>/sys/fs/cgroup/$controller</filename>) and pure cgroupfs
+      v2 (<filename>/sys/fs/cgroup</filename>), as well as mixed mounts,
+      where some controllers are mounted in a standard cgroupfs v1 hierarchy
+      (<filename>/sys/fs/cgroup/$controller</filename>) and others in
+      cgroupfs v2 hierarchy (<filename>/sys/fs/cgroup/unified</filename>).
+      Writeable cgroups are either created for all controllers or, if specified,
+      for only controllers listed as arguments on the command line.
+      -->
+      <command>pam_cgfs.so</command> モジュールは、cgroupfs v1 (<filename>/sys/fs/cgroup/$controller</filename>) と cgroupfs v2 (<filename>/sys/fs/cgroup</filename>) のいずれも扱えます。また、コントローラのいくつかが cgroupfs v1 ツリー (<filename>/sys/fs/cgroup/$controller</filename>) で、それ以外が cgroupfs v2 (<filename>/sys/fs/cgroup/unified</filename>) ツリーと言ったようなミックスでも扱えます。
+      書き込み可能な cgroup がすべてのコントローラ用に作られます。また、引数で指定すれば、指定したコントローラのみ書き込み可能な cgroup が作られます。
+    </para>
+
+    <para>
+      <!--
+      The cgroup created <filename>user/$user/n</filename> will be for the nth
+      session under cgroup kernel controller hierarchy.
+      -->
+      作成された cgroup <filename>user/$user/n</filename> は cgroup カーネルコントローラ階層配下の n 番目のセッション用です。
+    </para>
+
+    <para>
+      <!--
+      Systems with a systemd init system are treated specifically, both with
+      respect to cgroupfs v1 and cgroupfs v2. For  both, cgroupfs v1 and
+      cgroupfs v2, the module checks whether systemd already placed the user in
+      a cgroup it created <filename>user.slice/user-$uid/session-n.scope
+      </filename> by checking whether $uid == login uid. If so, the login
+      user chown the <filename>session-n.scope</filename>, else a cgroup is
+      created as outlined above (<filename>user/$user/n</filename>) and chown it
+      to login uid. If the init system has already placed the login user inside
+      a session specific group, the <command>pam_cgfs.so</command> module is
+      smart enough to detect it and re-use the cgroup.
+      -->
+      init システムが systemd であるシステムは、cgroupfs v1 と v2 の両方が特別に扱われます。cgroupfs v1 と v2 の両方に対して、このモジュールは systemd が既に、<filename>user.slice/user-$uid/session-n.scope</filename> を cgroup 内に作成しているかどうか、$uid == login uid であるかどうかをチェックします。もし $uid == login uid であるなら、<filename>session-n.scope</filename> をユーザに chown します。そうでなければ、前述のような cgroup (<filename>user/$user/n</filename>) が作成され、ログイン uid で chown されます。
+      もし、init システムがすでにセッション特有のグループ内にログインユーザーの cgroup を配置しているなら、<command>pam_cgfs.so</command> モジュールはそれを検出して再利用する機能を持っています。
+    </para>
+
+    <para>
+      <!--
+      In essence,  the <command>pam_cgfs.so</command> module takes care of
+      placing unprivileged (non-root) users into writable cgroups at login
+      and also cleaning up these cgroup hierarchies on logout, so they are free
+      to delegate resources to containers as needed that have been provided to
+      them.
+        -->
+      基本的には <command>pam_cgfs.so</command> モジュールは、ログイン時に非特権(非 root)ユーザが書き込みできる cgroup を配置し、ログアウト時にもその cgroup ツリーをクリーンアップする処理を行います。したがって、必要に応じて提供されているリソースをコンテナに自由に委譲できます。
+    </para>
+
+  </refsect1>
+
+  <refsect1>
+
+    <title><!-- Options -->オプション</title>
+
+    <variablelist>
+
+          <varlistentry>
+            <term> <option>-c <replaceable>controller-list</replaceable></option> </term>
+           <listitem>
+             <para>
+               <!--
+        Takes a string argument which sets the list of kernel controllers and
+        named controllers delimited by commas in-between “,”. Named controllers
+        need to be specified in the form “name=$namedcontroller”. Can use “all”
+        enable all cgroup resource controller hierarchies. Specifying “all” and
+        other controllers explicitly returns PAM_SESSION_ERR.
+                 -->
+               カンマ(",")で区切られたカーネルコントローラと名前付きコントローラ(訳注: mount オプションとして name オプションで名前を指定してマウントした cgroup v1 ツリー)のリストを設定した文字列の引数を取ります。名前付きコントローラは "name=$namedcontroller" の形で指定する必要があります。"all" を指定して、すべての cgroup リソースコントローラーのツリーを有効にできます。"all" と他のコントローラを同時に指定すると、明確に PAM_SESSION_ERR が返ります。
+             </para>
+           </listitem>
+          </varlistentry>
+
+    </variablelist>
+
+  </refsect1>
+
+  <refsect1>
+    <title>Module types provided</title>
+    <para>
+      <!--
+      Only <option>session</option> module type is provided (and needed).
+        -->
+      モジュールタイプとして <option>session</option> のみが提供されます(そして必要です)。
+    </para>
+  </refsect1>
+
+  <refsect1>
+
+    <title><!-- Return Values -->返り値</title>
+
+    <variablelist>
+
+      <varlistentry>
+        <term>PAM_SUCCESS</term>
+        <listitem>
+          <para>
+            <!--
+            Writeable cgroups have been created for the user.
+              -->
+            ユーザ用の書き込み可能な cgroup が作成されました。
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>PAM_SESSION_ERR</term>
+        <listitem>
+          <para>
+            <!--
+            Failed to create writable cgroups for the user.
+              -->
+            ユーザ用の書き込み可能な cgroup の作成が失敗しました。
+          </para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+  </refsect1>
+
+  <refsect1>
+
+    <title><!-- Files -->ファイル</title>
+
+    <variablelist>
+
+      <varlistentry>
+        <term>/etc/pam.d/common-session{,-noninteractive}</term>
+        <listitem>
+          <para>
+            <!--
+            Default configuration is added at the end of these files.
+              -->
+            これらのファイルの最後にデフォルト設定が追加されます。
+          </para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+  </refsect1>
+
+  <refsect1>
+    <title><!-- EXAMPLE -->例</title>
+    <!--
+    <programlisting>
+session optional        pam_cgfs.so -c freezer,memory,named=systemd
+# default configuration
+# user writable cgroups are created under freezer, memory and named cgroup systemd hierarchies.
+# /sys/fs/cgroup/$controller/user/$user/n for freezer,memory.
+# /sys/fs/cgroup/systemd/user.slice/user-$uid/session-n.scope for systemd.
+
+session optional        pam_cgfs.so -c all
+# user writable cgroups are created under all cgroup controllers.
+
+session optional        pam_cgfs.so -c all,memory,freezer
+# invalid argument and returns PAM_SESSION_ERR
+    </programlisting>
+    -->
+    <programlisting>
+session optional        pam_cgfs.so -c freezer,memory,named=systemd
+# デフォルト設定
+# ユーザが書き込み可能な cgroup が freezer, memory, 名前付き cgroup "systemd" ツリー以下に作成されます。
+# freezer と memory に対しては /sys/fs/cgroup/$controller/user/$user/n
+# systemd に対しては /sys/fs/cgroup/systemd/user.slice/user-$uid/session-n.scope
+
+session optional        pam_cgfs.so -c all
+# すべての cgroup コントローラ以下にユーザが書き込み可能な cgroup が作成されます
+
+session optional        pam_cgfs.so -c all,memory,freezer
+# 不正な引数なので PAM_SESSION_ERR が返ります
+    </programlisting>
+  </refsect1>
+
+  <refsect1>
+    <title>See Also</title>
+
+    <simpara>
+      <citerefentry>
+      <refentrytitle><command>lxc-cgroup</command></refentrytitle>
+      <manvolnum>1</manvolnum>
+      </citerefentry>,
+
+      <citerefentry>
+      <refentrytitle><command>cgroups</command></refentrytitle>
+      <manvolnum>7</manvolnum>
+      </citerefentry>,
+
+      <citerefentry>
+      <refentrytitle><command>user_namespaces</command></refentrytitle>
+      <manvolnum>7</manvolnum>
+      </citerefentry>,
+
+      <citerefentry>
+      <refentrytitle><command>namespaces</command></refentrytitle>
+      <manvolnum>7</manvolnum>
+      </citerefentry>,
+
+      <citerefentry>
+      <refentrytitle><command>pam</command></refentrytitle>
+      <manvolnum>8</manvolnum>
+      </citerefentry>
+    </simpara>
+
+
+  </refsect1>
+
+
+  <refsect1>
+    <title>Author</title>
+    <para>Venkata Harshavardhan Reddy Allu <email>venkataharshavardhan_ven at srmuniv.edu.in</email></para>
+  </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->

From 0cf801fb65fc3c68e62b9da43daaa75dd7785d0a Mon Sep 17 00:00:00 2001
From: KATOH Yasufumi <karma at jazz.email.ne.jp>
Date: Fri, 20 Sep 2019 18:14:06 +0900
Subject: [PATCH 2/2] doc: Add the lxc.net.[i].veth.mode option in Japanese
 lxc.container.conf(5)

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
---
 doc/ja/lxc.container.conf.sgml.in | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/ja/lxc.container.conf.sgml.in b/doc/ja/lxc.container.conf.sgml.in
index 1f19dab7e7..72301fc911 100644
--- a/doc/ja/lxc.container.conf.sgml.in
+++ b/doc/ja/lxc.container.conf.sgml.in
@@ -588,14 +588,23 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
               <!--
               <option>veth:</option> a virtual ethernet pair
               device is created with one side assigned to the container
-              and the other side attached to a bridge specified by
+              and the other side on the host.
+              <option>lxc.net.[i].veth.mode</option> specifies the
+              mode the veth parent will use on the host.
+              The accepted  modes are <option>bridge</option> and <option>router</option>.
+              The mode defaults to bridge if not specified.
+              In <option>bridge</option> mode the host side is attached to a bridge specified by
               the <option>lxc.net.[i].link</option> option.
-              If the bridge is not specified, then the veth pair device
+              If the bridge link is not specified, then the veth pair device
               will be created but not attached to any bridge.
               Otherwise, the bridge has to be created on the system
               before starting the container.
               <command>lxc</command> won't handle any
               configuration outside of the container.
+              In <option>router</option> mode static routes are created on the host for the
+              container's IP addresses pointing to the host side veth interface.
+              Additionally Proxy ARP and Proxy NDP entries are added on the host side veth interface
+              for the gateway IPs defined in the container to allow the container to reach the host.
               By default, <command>lxc</command> chooses a name for the
               network device belonging to the outside of the
               container, but if you wish to handle
@@ -611,10 +620,16 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
               Several lines specify several routes.
               The route is in format x.y.z.t/m, eg. 192.168.1.0/24.
               -->
-              <option>veth:</option > 一方がコンテナに、もう一方が <option>lxc.net.[i].link</option> オプションで指定されたブリッジに接続されるペアの仮想イーサネットデバイスを作成します。
+              <option>veth:</option> 一方がコンテナに、もう一方がホストに接続されるペアの仮想イーサネットデバイスを作成します。
+              <option>lxc.net.[i].veth.mode</option> は、veth の親(ホスト側)がホスト上で使うモードを指定します。
+              指定できるモードは <option>bridge</option> と <option>router</option> です。
+              指定しない場合のデフォルトのモードは bridge です。
+              <option>bridge</option> モードでは、ホスト側は、<option>lxc.net.[i].link</option> オプションで指定したブリッジに接続されます。
               もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。
               ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。
               <command>lxc</command> はコンテナ外の設定を扱うことはありません。
+              <option>router</option> モードでは、ホスト側の veth インターフェースを指すコンテナの IP アドレスに対して、ホスト上でスタティックルートが作成されます。
+              加えて、コンテナがホストに到達できるために、コンテナ内で定義されたゲートウェイの IP アドレスに対して、Proxy ARP と Proxy NDP エントリがホスト側の veth インターフェースに追加されます。
               デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。
               しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。
 


More information about the lxc-devel mailing list