Serge Hallyn | 22 Jul 01:13 2014

[PATCH 1/1] Support openvswitch bridges

We detect whether ovs-vsctl is available.  If so, then we support
adding network interfaces to openvswitch bridges with it.

Note that with this patch, veths do not appear to be removed from the
openvswitch bridge.  This seems a bug in openvswitch, as the veths
in fact do disappear from the system.  If lxc is required to remove
the port from the bridge manually, that becomes more complicated
for unprivileged containers, as it would require a setuid-root
wrapper to be called at shutdown.

Signed-off-by: Serge Hallyn <serge.hallyn <at> ubuntu.com>
---
 configure.ac        | 11 +++++++++++
 src/lxc/Makefile.am |  4 ++++
 src/lxc/network.c   | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/configure.ac b/configure.ac
index a9393a2..23a5b01 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -190,6 +190,16  <at>  <at>  fi

 AM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"])

+# Openvswitch
+AC_PATH_PROG([OVS_CTL_PATH],[ovs-vsctl])
+if test "x$OVS_CTL_PATH" != "x"; then
+	enable_ovs="yes"
+	AS_AC_EXPAND(OVS_CTL_PATH, "$OVS_CTL_PATH")
(Continue reading)

Serge Hallyn | 21 Jul 21:27 2014

[PATCH 1/1] lxc-user-nic: compute first available nic name in container

Rather than always using eth0.  Otherwise unpriv containers cannot have
multiple lxc.network.type = veth's without manually setting
lxc.network.name =.

Signed-off-by: Serge Hallyn <serge.hallyn <at> ubuntu.com>
---
 src/lxc/lxc_user_nic.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c
index 1105b3d..75e4851 100644
--- a/src/lxc/lxc_user_nic.c
+++ b/src/lxc/lxc_user_nic.c
 <at>  <at>  -470,7 +470,7  <at>  <at>  again:
 	goto again;
 }

-static int rename_in_ns(int pid, char *oldname, char *newname)
+static int rename_in_ns(int pid, char *oldname, char **newnamep)
 {
 	char nspath[MAXPATHLEN];
 	int fd = -1, ofd = -1, ret;
 <at>  <at>  -495,8 +495,29  <at>  <at>  static int rename_in_ns(int pid, char *oldname, char *newname)
 		goto out_err;
 	}
 	close(fd); fd = -1;
-	if ((ret = lxc_netdev_rename_by_name(oldname, newname)) < 0) {
-		fprintf(stderr, "Error %d renaming netdev %s to %s in container\n", ret, oldname, newname);
+
+	if (!*newnamep) {
(Continue reading)

Stéphane Graber | 21 Jul 20:21 2014

[PATCH 1/2] Support providing env vars to container init

From: Matt Palmer <mpalmer <at> hezmatt.org>

It's quite useful to be able to configure containers by specifying
environment variables, which init (or initscripts) can use to adjust the
container's operation.

This patch adds one new configuration parameter, `lxc.environment`, which
can be specified zero or more times to define env vars to set in the
container, like this:

    lxc.environment = APP_ENV=production
    lxc.environment = SYSLOG_SERVER=192.0.2.42
    lxc.environment = SOMETHING_FUNNY=platypus

Default operation is unchanged; if the user doesn't specify any
lxc.environment parameters, the container environment will be what it is
today ('container=lxc').

Signed-off-by: Matt Palmer <mpalmer <at> hezmatt.org>
Acked-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 doc/lxc.container.conf.sgml.in | 38 ++++++++++++++++++++++++++++++++++++++
 src/lxc/conf.c                 |  1 +
 src/lxc/conf.h                 |  4 ++++
 src/lxc/confile.c              | 23 +++++++++++++++++++++++
 src/lxc/start.c                | 10 +++++++++-
 5 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in
index 4f8e4e9..d0c18fe 100644
(Continue reading)

Stéphane Graber | 21 Jul 17:09 2014

[PATCH] download: Have wget retry 3 times

This forces wget to retry if it gets a network error.

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 templates/lxc-download.in | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index c96bc31..5799de8 100644
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
 <at>  <at>  -69,9 +69,19  <at>  <at>  cleanup() {
     fi
 }

+wget_wrapper() {
+    for i in $(seq 3); do
+        if wget $ <at> ; then
+            return 0
+        fi
+    done
+
+    return 1
+}
+
 download_file() {
-    if ! wget -T 30 -q https://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
-        if ! wget -T 30 -q http://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
+    if ! wget_wrapper -T 30 -q https://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
+        if ! wget_wrapper -T 30 -q http://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
(Continue reading)

Stéphane Graber | 21 Jul 17:08 2014

[PATCH 1/2] lxc-start: Add -F (foreground) option

Introduce a new -F option (no-op for now) as an opposite of -d.

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 doc/lxc-start.sgml.in | 14 ++++++++++++++
 src/lxc/lxc_start.c   |  5 ++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/lxc-start.sgml.in b/doc/lxc-start.sgml.in
index 07f9845..1bbe302 100644
--- a/doc/lxc-start.sgml.in
+++ b/doc/lxc-start.sgml.in
 <at>  <at>  -54,6 +54,7  <at>  <at>  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <arg choice="opt">-c <replaceable>console_device</replaceable></arg>
       <arg choice="opt">-L <replaceable>console_logfile</replaceable></arg>
       <arg choice="opt">-d</arg>
+      <arg choice="opt">-F</arg>
       <arg choice="opt">-p <replaceable>pid_file</replaceable></arg>
       <arg choice="opt">-s KEY=VAL</arg>
       <arg choice="opt">-C</arg>
 <at>  <at>  -107,6 +108,19  <at>  <at>  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

       <varlistentry>
 	<term>
+	  <option>-F, --foreground</option>
+	</term>
+	<listitem>
+	  <para>
+	    Run the container in the foreground. In this mode, the container
+	    console will be attached to the current tty and signals will be routed
(Continue reading)

GitHub | 21 Jul 13:10 2014

[lxc/lxc] 31098f: Sysvinit script fixes

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 31098f8b9d68a47c8c3fc18e08960caaa980fb80
      https://github.com/lxc/lxc/commit/31098f8b9d68a47c8c3fc18e08960caaa980fb80
  Author: Ansa89 <ansalonistefano@...>
  Date:   2014-07-21 (Mon, 21 Jul 2014)

  Changed paths:
    M config/init/sysvinit/lxc.in

  Log Message:
  -----------
  Sysvinit script fixes

Signed-off-by: Stefano Ansaloni <ansalonistefano@...>
Acked-by: Stéphane Graber <stgraber@...>

_______________________________________________
lxc-devel mailing list
lxc-devel <at> lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
GitHub | 21 Jul 11:56 2014

[lxc/lxc] 5c7f03: Add SIGPWR support to lxc_init

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 5c7f03ae85668fb9c8e81504624b33347465256c
      https://github.com/lxc/lxc/commit/5c7f03ae85668fb9c8e81504624b33347465256c
  Author: Nikolay Martynov <mar.kolya@...>
  Date:   2014-07-21 (Mon, 21 Jul 2014)

  Changed paths:
    M src/lxc/lxc_init.c

  Log Message:
  -----------
  Add SIGPWR support to lxc_init

This patch adds SIGPWR support to lxc_init.
This helps to properly shutdown lxc_init based containers.

Signed-off-by: Nikolay Martynov <mar.kolya@...>
Acked-by: Stéphane Graber <stgraber@...>

_______________________________________________
lxc-devel mailing list
lxc-devel <at> lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
GitHub | 18 Jul 13:53 2014

[lxc/lxc] 732520: lxc-test-{unpriv, usernic.in}: make sure to chgrp a...

  Branch: refs/heads/stable-1.0
  Home:   https://github.com/lxc/lxc
  Commit: 73252073000687cb0282619cc9449afd94f51496
      https://github.com/lxc/lxc/commit/73252073000687cb0282619cc9449afd94f51496
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2014-07-18 (Fri, 18 Jul 2014)

  Changed paths:
    M src/tests/lxc-test-unpriv
    M src/tests/lxc-test-usernic.in

  Log Message:
  -----------
  lxc-test-{unpriv,usernic.in}: make sure to chgrp as well

These tests are failing on new kernels because the container root is
not privileged over the directories, since privilege no requires
the group being mapped into the container.

Signed-off-by: Serge Hallyn <serge.hallyn@...>

  Commit: 1e5be811b48bb6ccc10cb96f0bcd614ef655cd2d
      https://github.com/lxc/lxc/commit/1e5be811b48bb6ccc10cb96f0bcd614ef655cd2d
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2014-07-18 (Fri, 18 Jul 2014)

  Changed paths:
    M config/templates/ubuntu.common.conf.in

  Log Message:
(Continue reading)

GitHub | 18 Jul 00:33 2014

[lxc/lxc] cd6b3e: remove mountcgroup hook entirely

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: cd6b3e37a6d9ceffb76c4b552e0cc55fe623f8d2
      https://github.com/lxc/lxc/commit/cd6b3e37a6d9ceffb76c4b552e0cc55fe623f8d2
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2014-07-17 (Thu, 17 Jul 2014)

  Changed paths:
    M hooks/Makefile.am
    R hooks/mountcgroups
    M templates/lxc-cirros.in

  Log Message:
  -----------
  remove mountcgroup hook entirely

Also fix the comment in lxc-cirros template (which I overlooked last time).

Signed-off-by: Serge Hallyn <serge.hallyn@...>
Acked-by: Stéphane Graber <stgraber@...>

_______________________________________________
lxc-devel mailing list
lxc-devel <at> lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
GitHub | 17 Jul 23:39 2014

[lxc/lxc] 79d88b: lxc-test-{unpriv, usernic.in}: make sure to chgrp a...

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 79d88b03ed31a729bc0f4a0f8a8be506d25fd470
      https://github.com/lxc/lxc/commit/79d88b03ed31a729bc0f4a0f8a8be506d25fd470
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2014-07-17 (Thu, 17 Jul 2014)

  Changed paths:
    M src/tests/lxc-test-unpriv
    M src/tests/lxc-test-usernic.in

  Log Message:
  -----------
  lxc-test-{unpriv,usernic.in}: make sure to chgrp as well

These tests are failing on new kernels because the container root is
not privileged over the directories, since privilege no requires
the group being mapped into the container.

Signed-off-by: Serge Hallyn <serge.hallyn@...>

  Commit: ed0ef61a774d3ba50d7eaed4964f6b860dcc4337
      https://github.com/lxc/lxc/commit/ed0ef61a774d3ba50d7eaed4964f6b860dcc4337
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2014-07-17 (Thu, 17 Jul 2014)

  Changed paths:
    M config/templates/ubuntu.common.conf.in

  Log Message:
(Continue reading)

Serge Hallyn | 17 Jul 23:04 2014

[PATCH] lxc-test-{unpriv, usernic.in}: make sure to chgrp as well

These tests are failing on new kernels because the container root is
not privileged over the directories, since privilege no requires
the group being mapped into the container.

Signed-off-by: Serge Hallyn <serge.hallyn <at> ubuntu.com>
---
 src/tests/lxc-test-unpriv     | 6 +++---
 src/tests/lxc-test-usernic.in | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv
index 5ab7524..f5ab535 100755
--- a/src/tests/lxc-test-unpriv
+++ b/src/tests/lxc-test-unpriv
 <at>  <at>  -84,10 +84,10  <at>  <at>  lxc.network.link = lxcbr0
 lxc.id_map = u 0 910000 9999
 lxc.id_map = g 0 910000 9999
 EOF
-chown -R $TUSER $HDIR
+chown -R $TUSER: $HDIR

 mkdir -p /run/user/$(id -u $TUSER)
-chown -R $TUSER /run/user/$(id -u $TUSER)
+chown -R $TUSER: /run/user/$(id -u $TUSER)

 cd $HDIR

 <at>  <at>  -108,7 +108,7  <at>  <at>  if [ -e /sys/fs/cgroup/cgmanager/sock ]; then
 else
 	for d in /sys/fs/cgroup/*; do
(Continue reading)


Gmane