GitHub | 29 Jan 17:55 2015

[lxc/lxc] 730e3f: clone_paths: use 'rootfs' for destination director...

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 730e3f9e2ffcc7e34c4236a37215f6be8c8cc7f3
      https://github.com/lxc/lxc/commit/730e3f9e2ffcc7e34c4236a37215f6be8c8cc7f3
  Author: Serge Hallyn <serge.hallyn@...>
  Date:   2015-01-29 (Thu, 29 Jan 2015)

  Changed paths:
    M src/lxc/bdev.c

  Log Message:
  -----------
  clone_paths: use 'rootfs' for destination directory

We were trying to be smart and use whatever the last part of
the container's rootfs path was.  However for block devices
that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
chances are that /var/lib/lxc/c1/md-1 does not exist.

So always use the $lxcpath/$lxcname/rootfs, and if it does
not exist, try to create it.

With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771

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

(Continue reading)

Serge Hallyn | 29 Jan 17:09 2015

[PATCH 1/1] clone_paths: use 'rootfs' for destination directory

We were trying to be smart and use whatever the last part of
the container's rootfs path was.  However for block devices
that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
chances are that /var/lib/lxc/c1/md-1 does not exist.

So always use the $lxcpath/$lxcname/rootfs, and if it does
not exist, try to create it.

With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771

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

diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
index 721a72b..197ab55 100644
--- a/src/lxc/bdev.c
+++ b/src/lxc/bdev.c
 <at>  <at>  -3340,7 +3340,6  <at>  <at>  struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
 	const char *oldname = c0->name;
 	const char *oldpath = c0->config_path;
 	struct rsync_data data;
-	char *rootfs;

 	/* if the container name doesn't show up in the rootfs path, then
 	 * we don't know how to come up with a new name
 <at>  <at>  -3359,25 +3358,26  <at>  <at>  struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,

(Continue reading)

GitHub | 29 Jan 11:46 2015

[lxc/lxc] f24a52: Use consistent /proc, /sys and /sys/fs/cgroup (v2)

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: f24a52d5f588ff4e4575046903fb9498c376d833
      https://github.com/lxc/lxc/commit/f24a52d5f588ff4e4575046903fb9498c376d833
  Author: Stéphane Graber <stgraber@...>
  Date:   2015-01-29 (Thu, 29 Jan 2015)

  Changed paths:
    M config/templates/archlinux.common.conf.in
    M config/templates/centos.common.conf.in
    M config/templates/common.conf.in
    M config/templates/debian.common.conf.in
    M config/templates/gentoo.common.conf.in
    M config/templates/gentoo.moresecure.conf.in
    M config/templates/openwrt.common.conf.in
    M config/templates/oracle.common.conf.in
    M config/templates/plamo.common.conf.in
    M config/templates/ubuntu.common.conf.in
    M doc/lxc.container.conf.sgml.in
    M src/lxc/conf.c
    M src/lxc/conf.h
    M src/lxc/confile.c
    M templates/lxc-alpine.in
    M templates/lxc-altlinux.in
    M templates/lxc-busybox.in
    M templates/lxc-cirros.in
    M templates/lxc-debian.in
    M templates/lxc-openmandriva.in
    M templates/lxc-opensuse.in
    M templates/lxc-plamo.in
(Continue reading)

Serge Hallyn | 29 Jan 11:13 2015

[PATCH] create lxc.tty ptys from container process

Lxc has always created the ptys for use by console and ttys early
on from the monitor process.  This has some advantages, but also
has disadvantages, namely (1) container ptys counting against the
max ptys for the host, and (2) not having a /dev/pts/N in the
container to pass to getty.  (2) was not a problem for us historically
because we bind-mounted the host's /dev/pts/N onto a /dev/ttyN in
the container.  However, systemd hardocdes a check for container_ttys
that the path have 'pts/' in it.  If it were only for (2) I'd have
opted for a systemd patch to check the device major number, but (1)
made it worth moving the openpty to the container namespace.

So this patch moves the tty creation into the task which becomes
the container init.  It then passes the fds for the opened ptys
back to the monitor over a unix socketpair (for use by lxc-console).
The /dev/console is still created in the monitor process, so that
it can for instance be used by lxc.logfd.

So now if you have a foreground container with lxc.tty = 4, you
should end up with one host /dev/pts entry per container rather than 5.

And lxc-console now works with systemd containers.

Note that if the container init mounts its own devpts over the
one mounted by lxc, the tty /dev/pts/n will be hidden.  This is ok
since it's only systemd that needs it, and systemd won't do that.

Signed-off-by: Serge Hallyn <serge.hallyn <at> ubuntu.com>
---
 config/apparmor/abstractions/start-container      |   1 +
 config/apparmor/profiles/lxc-default-with-nesting |   2 +-
(Continue reading)

Stéphane Graber | 29 Jan 10:16 2015

[PATCH] Use consistent /proc, /sys and /sys/fs/cgroup (v2)

 - Implements mixed mode for /sys where it's mounted read-only but with
   /sys/devices/virtual/net/ writable.

 - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all
   templates.

 - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup.

 - Get rid of the fstab file by default, using lxc.mount.entry instead.

 - Set sys:mixed as the default for "sys". sys:mixed is slightly more
   permissive than sys:ro so this shouldn't be a problem.

The read-only bind mount of /sys on top of itself is there so that
mountall and other init systems don't attempt to remount /sys
read-write.

v2 changes:
 - Fix the mount list, don't specify a source for the remount.
 - Update the documentation.

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 config/templates/archlinux.common.conf.in  |  3 ---
 config/templates/centos.common.conf.in     |  3 ---
 config/templates/common.conf.in            |  3 +++
 config/templates/debian.common.conf.in     |  5 +----
 config/templates/gentoo.common.conf.in     |  3 ---
 config/templates/gentoo.moresecure.conf.in |  2 --
 config/templates/openwrt.common.conf.in    |  4 ----
(Continue reading)

Stéphane Graber | 28 Jan 22:57 2015

[PATCH] Use consistent /proc, /sys and /sys/fs/cgroup

 - Implements mixed mode for /sys where it's mounted read-only but with
   /sys/devices/virtual/net/ writable.

 - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all
   templates.

 - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup.

 - Get rid of the fstab file by default, using lxc.mount.entry instead.

The read-only bind mount of /sys on top of itself is there so that
mountall and other init systems don't attempt to remount /sys
read-write.

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 config/templates/archlinux.common.conf.in  |  3 ---
 config/templates/centos.common.conf.in     |  3 ---
 config/templates/common.conf.in            |  3 +++
 config/templates/debian.common.conf.in     |  5 +----
 config/templates/gentoo.common.conf.in     |  3 ---
 config/templates/gentoo.moresecure.conf.in |  2 --
 config/templates/openwrt.common.conf.in    |  4 ----
 config/templates/oracle.common.conf.in     |  3 ---
 config/templates/plamo.common.conf.in      |  1 -
 config/templates/ubuntu.common.conf.in     |  5 +----
 src/lxc/conf.c                             | 25 ++++++++++++++++---------
 src/lxc/conf.h                             |  1 +
 src/lxc/confile.c                          |  3 ++-
 templates/lxc-alpine.in                    |  3 +--
(Continue reading)

Dwight Engen | 28 Jan 21:19 2015
Picon

[PATCH cgmanager] bump required version of libnih to 1.0.3

Attempting to build with 1.0.2 gives the following error:

nih-dbus-tool:org.linuxcontainers.cgmanager.xml:41:51:
Invalid D-Bus type in <arg> type attribute: Unknown typecode

since 1.0.2 does not support the type 'h' for passing the
sockfd.

Signed-off-by: Dwight Engen <dwight.engen <at> oracle.com>
---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 904c4f3..4d1298a 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -25,7 +25,7  <at>  <at>  AC_PROG_CC_C99

 AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool])

-PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2])
+PKG_CHECK_MODULES([NIH], [libnih >= 1.0.3])
 PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
 PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])

--

-- 
1.7.1

_______________________________________________
(Continue reading)

GitHub | 28 Jan 12:47 2015

[lxc/lxc] 6010a4: Fix lxc-create -h with absolute template path

  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 6010a416227149adabc5aa8e018e2333adb2a922
      https://github.com/lxc/lxc/commit/6010a416227149adabc5aa8e018e2333adb2a922
  Author: Stéphane Graber <stgraber@...>
  Date:   2015-01-28 (Wed, 28 Jan 2015)

  Changed paths:
    M src/lxc/lxc_create.c
    M src/lxc/lxccontainer.c
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  Fix lxc-create -h with absolute template path

Close #421

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

  Commit: 9f177a00130a70e9c7f64432a8dea3b64e533fe5
      https://github.com/lxc/lxc/commit/9f177a00130a70e9c7f64432a8dea3b64e533fe5
  Author: Stéphane Graber <stgraber@...>
  Date:   2015-01-28 (Wed, 28 Jan 2015)

  Changed paths:
    M templates/lxc-centos.in
    M templates/lxc-fedora.in
(Continue reading)

Stéphane Graber | 28 Jan 10:34 2015

[PATCH] Fix clearing IPv4/IPv6 addresses

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 src/lxc/confile.c | 35 ++++++++++++++---------------------
 1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index be81f5d..e9cc474 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
 <at>  <at>  -787,29 +787,25  <at>  <at>  static int config_network_ipv4_gateway(const char *key, const char *value,
 			               struct lxc_conf *lxc_conf)
 {
 	struct lxc_netdev *netdev;
-	struct in_addr *gw;

 	netdev = network_netdev(key, value, &lxc_conf->network);
 	if (!netdev)
 		return -1;

-	gw = malloc(sizeof(*gw));
-	if (!gw) {
-		SYSERROR("failed to allocate ipv4 gateway address");
-		return -1;
-	}
-
-	if (!value) {
-		ERROR("no ipv4 gateway address specified");
-		free(gw);
-		return -1;
-	}
(Continue reading)

Stéphane Graber | 28 Jan 10:07 2015

[PATCH] lxc-{centos|fedora}: Respect --rootfs

Close #406

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 templates/lxc-centos.in | 3 +--
 templates/lxc-fedora.in | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in
index fdc307a..4696ce3 100644
--- a/templates/lxc-centos.in
+++ b/templates/lxc-centos.in
 <at>  <at>  -693,7 +693,7  <at>  <at>  do
     case "$1" in
         -h|--help)      usage $0 && exit 0;;
         -p|--path)      path=$2; shift 2;;
-        --rootfs)       rootfs=$2; shift 2;;
+        --rootfs)       rootfs_path=$2; shift 2;;
         -n|--name)      name=$2; shift 2;;
         -c|--clean)     clean=1; shift 1;;
         -R|--release)   release=$2; shift 2;;
 <at>  <at>  -827,7 +827,6  <at>  <at>  if [ "$(id -u)" != "0" ]; then
     exit 1
 fi

-
 if [ -z "$rootfs_path" ]; then
     rootfs_path=$path/rootfs
     # check for 'lxc.rootfs' passed in through default config by lxc-create
diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
(Continue reading)

Stéphane Graber | 28 Jan 09:38 2015

[PATCH] Fix lxc-create -h with absolute template path

Close #421

Signed-off-by: Stéphane Graber <stgraber <at> ubuntu.com>
---
 src/lxc/lxc_create.c   |  8 +-------
 src/lxc/lxccontainer.c | 34 ----------------------------------
 src/lxc/utils.c        | 34 ++++++++++++++++++++++++++++++++++
 src/lxc/utils.h        |  1 +
 4 files changed, 36 insertions(+), 41 deletions(-)

diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c
index 2cc866a..8f46db9 100644
--- a/src/lxc/lxc_create.c
+++ b/src/lxc/lxc_create.c
 <at>  <at>  -101,8 +101,6  <at>  <at>  static const struct option my_longopts[] = {

 static void create_helpfn(const struct lxc_arguments *args) {
 	char *argv[3], *path;
-	size_t len;
-	int ret;
 	pid_t pid;

 	if (!args->template)
 <at>  <at>  -114,11 +112,7  <at>  <at>  static void create_helpfn(const struct lxc_arguments *args) {
 		return;
 	}

-	len = strlen(LXCTEMPLATEDIR) + strlen(args->template) + strlen("/lxc-") + 1;
-	path = alloca(len);
-	ret = snprintf(path, len,  "%s/lxc-%s", LXCTEMPLATEDIR, args->template);
(Continue reading)


Gmane