<arg choice="opt">-P <replaceable>newlxcpath</replaceable></arg>
<arg choice="req">-o <replaceable>orig</replaceable></arg>
<arg choice="req">-n <replaceable>new</replaceable></arg>
+ <arg choice="opt">-- hook arguments</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>lxc-clone</command>
<arg choice="opt">-P <replaceable>newlxcpath</replaceable></arg>
<arg choice="req">orig</arg>
<arg choice="req">new</arg>
+ <arg choice="opt">-- hook arguments</arg>
</cmdsynopsis>
</refsynopsisdiv>
</refsect1>
+ <refsect1>
+ <title>Clone hook</title>
+ <para>
+ If the container being cloned has one or more <filename>lxc.hook.clone</filename>
+ specified, then the specified hooks will be called for the new container. The
+ first 3 arguments passed to the clone hook will be the container name, a section
+ ('lxc'), and the hook type ('clone'). Extra arguments passed
+ <command>lxc-clone</command> will be passed to the hook program starting at
+ argument 4. The <filename>LXC_ROOTFS_MOUNT</filename> environment variable gives
+ the path under which the container's root filesystem is mounted. The
+ configuration file pathname is stored in <filename>LXC_CONFIG_FILE</filename>, the
+ container name in <filename>LXC_NAME</filename>, and the path or device on which
+ the rootfs is located is in <filename>LXC_ROOTFS_PATH</filename>.
+ </para>
+ </refsect1>
+
&seealso;
<refsect1>
</refsect2>
<refsect2>
- <title>Startup hooks</title>
+ <title>Container hooks</title>
<para>
- Startup hooks are programs or scripts which can be executed
+ Container hooks are programs or scripts which can be executed
at various times in a container's lifetime.
</para>
<variablelist>
</listitem>
</varlistentry>
</variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <option>lxc.hook.clone</option>
+ </term>
+ <listitem>
+ <para>
+ A hook to be run when the container is cloned to a new one.
+ See <refentrytitle><command>lxc-clone</command></refentrytitle>
+ <manvolnum>1</manvolnum> for more information.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</refsect2>
<refsect2>
- <title>Startup hooks Environment Variables</title>
+ <title>Container hooks Environment Variables</title>
<para>
A number of environment variables are made available to the startup
hooks to provide configuration information and assist in the