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