]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
document clone hooks
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 16 May 2013 13:22:41 +0000 (08:22 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 16 May 2013 13:22:41 +0000 (08:22 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
doc/lxc-clone.sgml.in
doc/lxc.conf.sgml.in

index 3ad7698804357723f9dde3395e600239a7c7a668..2d2fda3283a33c3243307291fbf0126b02a674b2 100644 (file)
@@ -60,6 +60,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
       <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>
@@ -73,6 +74,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
       <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>
 
@@ -242,6 +244,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
   </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>
index 509ca2df0904286394c73126bf46365e44573830..af8663addaa58795db833b46a8240f8cfbfec4e6 100644 (file)
@@ -770,9 +770,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     </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>
@@ -866,10 +866,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
          </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