<listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
<listitem><para> フックのタイプ ('clone' や 'pre-mount' など) <!-- The hook type (i.e. 'clone' or 'pre-mount'). --></para></listitem>
<listitem><para> Additional arguments. In the
<listitem><para> 追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。 <!-- Additional arguments. In the
case of the clone hook, any extra arguments passed to
case of the clone hook, any extra arguments passed to
lxc-clone will appear as further arguments to the hook.
lxc-clone will appear as further arguments to the hook.
In the case of the stop hook, paths to filedescriptors
In the case of the stop hook, paths to filedescriptors
for each of the container's namespaces along with their types
for each of the container's namespaces along with their types
are passed. </para></listitem>
are passed. --></para></listitem>
</itemizedlist>
</itemizedlist>
<!--
The following environment variables are set:
The following environment variables are set:
-->
次の環境変数がセットされます。
<itemizedlist>
<itemizedlist>
<listitem><para> LXC_NAME: is the container's name. </para></listitem>
<listitem><para> LXC_CGNS_AWARE: コンテナで cgroup namespace が使えるかどうか <!-- indicator whether the container is
<listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
cgroup namespace aware. --></para></listitem>
<listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem>
<listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス <!-- the path to the container
<listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
configuration file. --></para></listitem>
<listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs.path 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>
/proc/PID/fd/ to a file descriptor referring to the container's
namespace. For each preserved namespace type there will be a separate
environment variable. These environment variables will only be set if
<option>lxc.hook.version</option> is set to 1. --></para></listitem>
<listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス <!-- the path to the mounted root filesystem. --></para></listitem>
<listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs.path エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。 <!-- this is the lxc.rootfs.path 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>
<listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前 <!-- in the case of the clone hook, this is
the original container's name. --></para></listitem>
</itemizedlist>
</itemizedlist>
</para>
</para>
<para>
<para>
...
@@ -2218,7 +2413,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
...
@@ -2218,7 +2413,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
Standard output from the hooks is logged at debug level.
Standard output from the hooks is logged at debug level.
Standard error is not logged, but can be captured by the
Standard error is not logged, but can be captured by the
hook redirecting its standard error to standard output.
hook redirecting its standard error to standard output.
-->
-->
スクリプトからの標準出力は debug レベルでロギングされます。
スクリプトからの標準出力は debug レベルでロギングされます。
標準エラー出力はロギングされません。
標準エラー出力はロギングされません。
しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
...
@@ -2226,6 +2421,38 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
...
@@ -2226,6 +2421,38 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.version</option>
</term>
<listitem>
<para>
<!--
To pass the arguments in new style via environment variables set to
1 otherwise set to 0 to pass them as arguments.
This setting affects all hooks arguments that were traditionally
passed as arguments to the script. Specifically, it affects the
container name, section (e.g. 'lxc', 'net') and hook type (e.g.
'clone', 'mount', 'pre-mount') arguments. If new-style hooks are
used then the arguments will be available as environment variables.
The container name will be set in LXC_NAME. (This is set
independently of the value used for this config item.) The section
will be set in LXC_HOOK_SECTION and the hook type will be set in
LXC_HOOK_TYPE.
It also affects how the paths to file descriptors referring to the
container's namespaces are passed. If set to 1 then for each
namespace a separate environment variable LXC_[NAMESPACE
IDENTIFIER]_NS will be set. If set to 0 then the paths will be