]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
add LXC_CGNS_AWARE env variable for mount hooks 752/head
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 1 Jan 2016 01:43:15 +0000 (17:43 -0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 8 Jan 2016 21:03:37 +0000 (13:03 -0800)
This way the lxcfs mount hook can know whether lxc knows about
cgroup namespaces.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
doc/lxc.container.conf.sgml.in
src/lxc/start.c

index 1e702c7172c1439b2713cf5a4464fbd74e4d7f54..18ad924a3390e08e672822da45c562bdf777e4ca 100644 (file)
@@ -1593,6 +1593,22 @@ mknod errno 0
           </listitem>
         </varlistentry>
       </variablelist>
+      <variablelist>
+        <varlistentry>
+          <term>
+            <option>LXC_CGNS_AWARE</option>
+          </term>
+          <listitem>
+            <para>
+             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.
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
     </refsect2>
     <refsect2>
     <title>Logging</title>
index 6d4d2c2114bd7efbd95716db5d40514ebc3d110b..0d91eb39409f1ec2349875b8ecf85b004649ac5f 100644 (file)
@@ -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)) {