conditional on the value of <option>lxc.hook.version</option>. If it
is set to 1 then LXC_HOOK_SECTION will be set.
</para></listitem>
+ <listitem><para> LXC_HOOK_VERSION: the version of the hooks. This
+ value is identical to the value of the container's
+ <option>lxc.hook.version</option> config item. If it is set to 0 then
+ old-style hooks are used. If it is set to 1 then new-style hooks are
+ used. </para></listitem>
<listitem><para> LXC_LOG_LEVEL: the container's log level. </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>
int lxc_init(const char *name, struct lxc_handler *handler)
{
+ int ret;
const char *loglevel;
struct lxc_conf *conf = handler->conf;
loglevel = lxc_log_priority_to_string(lxc_log_get_level());
if (setenv("LXC_LOG_LEVEL", loglevel, 1))
SYSERROR("Failed to set environment variable LXC_LOG_LEVEL=%s", loglevel);
+
+ if (conf->hooks_version == 0)
+ ret = setenv("LXC_HOOK_VERSION", "0", 1);
+ else
+ ret = setenv("LXC_HOOK_VERSION", "1", 1);
+ if (ret < 0)
+ SYSERROR("Failed to set environment variable LXC_HOOK_VERSION=%u", conf->hooks_version);
/* End of environment variable setup for hooks. */
TRACE("set environment variables");