<listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
<listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
<listitem><para> Additional arguments In the
<listitem><para> 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. </para></listitem>
lxc-clone will appear as further arguments to the hook. </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_NAME: is the container's name. </para></listitem>
<listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
<listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </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 configuration file. </para></listitem>
<listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
<listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
<listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs 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_ROOTFS_PATH: this is the lxc.rootfs 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>
</itemizedlist>
</itemizedlist>
</para>
</para>
<para>
<para>
Standard output from the hooks is logged at debug level.
Standard output from the hooks is logged at debug level.
...
@@ -1179,109 +1179,109 @@ mknod errno 0
...
@@ -1179,109 +1179,109 @@ mknod errno 0
hook redirecting its standard error to standard output.
hook redirecting its standard error to standard output.
</para>
</para>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.pre-start</option>
<option>lxc.hook.pre-start</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the host's namespace before the
A hook to be run in the host's namespace before the
container ttys, consoles, or mounts are up.
container ttys, consoles, or mounts are up.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.pre-mount</option>
<option>lxc.hook.pre-mount</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the container's fs namespace but before
A hook to be run in the container's fs namespace but before
the rootfs has been set up. This allows for manipulation
the rootfs has been set up. This allows for manipulation
of the rootfs, i.e. to mount an encrypted filesystem. Mounts
of the rootfs, i.e. to mount an encrypted filesystem. Mounts
done in this hook will not be reflected on the host (apart from
done in this hook will not be reflected on the host (apart from
mounts propagation), so they will be automatically cleaned up
mounts propagation), so they will be automatically cleaned up
when the container shuts down.
when the container shuts down.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.mount</option>
<option>lxc.hook.mount</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the container's namespace after
A hook to be run in the container's namespace after
mounting has been done, but before the pivot_root.
mounting has been done, but before the pivot_root.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.autodev</option>
<option>lxc.hook.autodev</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the container's namespace after
A hook to be run in the container's namespace after
mounting has been done and after any mount hooks have
mounting has been done and after any mount hooks have
run, but before the pivot_root, if
run, but before the pivot_root, if
<option>lxc.autodev</option> == 1.
<option>lxc.autodev</option> == 1.
The purpose of this hook is to assist in populating the
The purpose of this hook is to assist in populating the
/dev directory of the container when using the autodev
/dev directory of the container when using the autodev
option for systemd based containers. The container's /dev
option for systemd based containers. The container's /dev
directory is relative to the
directory is relative to the
${<option>LXC_ROOTFS_MOUNT</option>} environment
${<option>LXC_ROOTFS_MOUNT</option>} environment
variable available when the hook is run.
variable available when the hook is run.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.start</option>
<option>lxc.hook.start</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the container's namespace immediately
A hook to be run in the container's namespace immediately
before executing the container's init. This requires the
before executing the container's init. This requires the
program to be available in the container.
program to be available in the container.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.post-stop</option>
<option>lxc.hook.post-stop</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run in the host's namespace after the
A hook to be run in the host's namespace after the
container has been shut down.
container has been shut down.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.hook.clone</option>
<option>lxc.hook.clone</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
A hook to be run when the container is cloned to a new one.
A hook to be run when the container is cloned to a new one.
See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
<manvolnum>1</manvolnum></citerefentry> for more information.
<manvolnum>1</manvolnum></citerefentry> for more information.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
</refsect2>
</refsect2>
...
@@ -1295,89 +1295,89 @@ mknod errno 0
...
@@ -1295,89 +1295,89 @@ mknod errno 0
and, as such, not valid during the <option>lxc.hook.start</option> hook.
and, as such, not valid during the <option>lxc.hook.start</option> hook.
</para>
</para>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>LXC_NAME</option>
<option>LXC_NAME</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
The LXC name of the container. Useful for logging messages
The LXC name of the container. Useful for logging messages
in common log environments. [<option>-n</option>]
in common log environments. [<option>-n</option>]
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>LXC_CONFIG_FILE</option>
<option>LXC_CONFIG_FILE</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
Host relative path to the container configuration file. This
Host relative path to the container configuration file. This
gives the container to reference the original, top level,
gives the container to reference the original, top level,
configuration file for the container in order to locate any
configuration file for the container in order to locate any
additional configuration information not otherwise made
additional configuration information not otherwise made
available. [<option>-f</option>]
available. [<option>-f</option>]
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</variablelist>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>LXC_CONSOLE</option>
<option>LXC_CONSOLE</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
The path to the console output of the container if not NULL.
The path to the console output of the container if not NULL.