From: Serge Hallyn Date: Fri, 1 Jan 2016 01:43:15 +0000 (-0800) Subject: add LXC_CGNS_AWARE env variable for mount hooks X-Git-Tag: lxc-2.0.0.beta2~70^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4cafa080c8beb9a34a1fecff9331d84385f6440;p=thirdparty%2Flxc.git add LXC_CGNS_AWARE env variable for mount hooks This way the lxcfs mount hook can know whether lxc knows about cgroup namespaces. Signed-off-by: Serge Hallyn --- diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index 1e702c717..18ad924a3 100644 --- a/doc/lxc.container.conf.sgml.in +++ b/doc/lxc.container.conf.sgml.in @@ -1593,6 +1593,22 @@ mknod errno 0 + + + + + + + + If unset, then this version of lxc is not aware of cgroup + namespaces. If set, it will be set to 1, and lxc is aware + of cgroup namespaces. Note this does not guarantee that + cgroup namespaces are enabled in the kernel. This is used + by the lxcfs mount hook. + + + + Logging diff --git a/src/lxc/start.c b/src/lxc/start.c index 6d4d2c211..0d91eb394 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -451,6 +451,9 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf, const char if (conf->console.log_path && setenv("LXC_CONSOLE_LOGPATH", conf->console.log_path, 1)) { SYSERROR("failed to set environment variable for console log"); } + if (setenv("LXC_CGNS_AWARE", "1", 1)) { + SYSERROR("failed to set LXC_CGNS_AWARE environment variable"); + } /* End of environment variable setup for hooks */ if (run_lxc_hooks(name, "pre-start", conf, handler->lxcpath, NULL)) {