[lxc-devel] [lxc/master] start: pass LXC_LOG_LEVEL to hooks

brauner on Github lxc-bot at linuxcontainers.org
Wed Sep 13 03:07:20 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170913/afe151f7/attachment.bin>
-------------- next part --------------
From b8f88d9bb2371d2e11b9c2fbc0a72d8e9608042e Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 13 Sep 2017 05:02:50 +0200
Subject: [PATCH 1/2] start: pass LXC_LOG_LEVEL to hooks

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/start.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index ae59c6711..3baed693a 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -631,6 +631,9 @@ int lxc_init(const char *name, struct lxc_handler *handler)
 
 	if (setenv("LXC_CGNS_AWARE", "1", 1))
 		SYSERROR("Failed to set environment variable LXC_CGNS_AWARE=1.");
+
+	if (setenv("LXC_LOG_LEVEL", lxc_log_priority_to_string(handler->conf->loglevel), 1))
+		SYSERROR("Failed to set environment variable LXC_CGNS_AWARE=1.");
 	/* End of environment variable setup for hooks. */
 
 	TRACE("set environment variables");

From b68c6a71d4e5ecd1def479c8215697a262602efe Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 13 Sep 2017 05:05:03 +0200
Subject: [PATCH 2/2] doc: document missing env variables

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 doc/lxc.container.conf.sgml.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in
index f89eb65b4..316327985 100644
--- a/doc/lxc.container.conf.sgml.in
+++ b/doc/lxc.container.conf.sgml.in
@@ -1446,6 +1446,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
           <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.path 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_CGNS_AWARE: indicated whether the container is cgroup namespace aware.  </para></listitem>
+          <listitem><para> LXC_LOG_LEVEL: the container's log level.  </para></listitem>
         </itemizedlist>
       </para>
       <para>


More information about the lxc-devel mailing list