[lxc-devel] [lxc/lxc] cb4c20: lxc-create: Require --template be passed

GitHub noreply at github.com
Fri Nov 6 23:17:24 UTC 2015


  Branch: refs/heads/stable-1.0
  Home:   https://github.com/lxc/lxc
  Commit: cb4c20629e746485f42e9e59ba70a846d3b19796
      https://github.com/lxc/lxc/commit/cb4c20629e746485f42e9e59ba70a846d3b19796
  Author: Stéphane Graber <stgraber at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M doc/lxc-create.sgml.in
    M src/lxc/lxc_create.c

  Log Message:
  -----------
  lxc-create: Require --template be passed

It's often been reported that the behavior of lxc-create without -t is a
bit confusing. This change makes lxc-create require the --template
option and introduces a new "none" special value which when set will
fallback to the old template-less behavior.

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


  Commit: d29d4bad4a9a878981ae4711ae70ba24a2afd86d
      https://github.com/lxc/lxc/commit/d29d4bad4a9a878981ae4711ae70ba24a2afd86d
  Author: Stéphane Graber <stgraber at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M templates/lxc-ubuntu-cloud.in

  Log Message:
  -----------
  ubuntu-cloud: Replace .tar.gz by .tar.xz and don't auto-generate missing tarballs

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


  Commit: da206585cab734f103e6c010306e4643cd9aaf3b
      https://github.com/lxc/lxc/commit/da206585cab734f103e6c010306e4643cd9aaf3b
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/lxc_usernsexec.c

  Log Message:
  -----------
  lxc-usernsexec: reopen fds 0,1,2 separately

lxc-usernsexec was using fd 0 and reopening it as 0,1,2 for
the new task.  If doing "lxc-usernsexec .. < script" this
will corrupt the file 'script'.

Reported-by: Fiedler Roman <Roman.Fiedler at ait.ac.at>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: bfc1e6deb63e6f41e20dc4511e3c51b0017a6377
      https://github.com/lxc/lxc/commit/bfc1e6deb63e6f41e20dc4511e3c51b0017a6377
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/lxc_usernsexec.c

  Log Message:
  -----------
  don't close std* fd if opentty fails

We didn't do it before, and it makes testcases fail.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 126ab9ffaaf5360132203cfb0beed70ed11a4e86
      https://github.com/lxc/lxc/commit/126ab9ffaaf5360132203cfb0beed70ed11a4e86
  Author: Stéphane Graber <stgraber at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M templates/lxc-ubuntu-cloud.in

  Log Message:
  -----------
  lxc-ubuntu-cloud: Never exit 0 when no container is created

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


  Commit: 561919857dffd602d7da2f9f96f00ca51520fcb0
      https://github.com/lxc/lxc/commit/561919857dffd602d7da2f9f96f00ca51520fcb0
  Author: Stéphane Graber <stgraber at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  Init error_num to 1

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


  Commit: 827cc83a63fbec52928bc650fc13e62b2480feb6
      https://github.com/lxc/lxc/commit/827cc83a63fbec52928bc650fc13e62b2480feb6
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/lxc_usernsexec.c

  Log Message:
  -----------
  only re-open fds if stdin is a tty

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


  Commit: 0e86d94a056bdd082212522a2d43b66ea6d4c7e7
      https://github.com/lxc/lxc/commit/0e86d94a056bdd082212522a2d43b66ea6d4c7e7
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  Make mount_entry_create_*_dirs() more robust

The mount_entry_create_*_dirs() functions currently assume that the rootfs of
the container is actually named "rootfs". This has the consequence that

	del = strstr(lxcpath, "/rootfs");
	if (!del) {
		free(lxcpath);
		lxc_free_array((void **)opts, free);
		return -1;
	}
	*del = '\0';

will return NULL when the rootfs of a container is not actually named "rootfs".
This means the we return -1 and do not create the necessary upperdir/workdir
directories required for the overlay/aufs mount to work. Hence, let's not make
that assumption. We now pass lxc_path and lxc_name to
mount_entry_create_*_dirs() and create the path directly. To prevent failure we
also have mount_entry_create_*_dirs() check that lxc_name and lxc_path are not
empty when they are passed in.

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: a156301a6206e305594cb8616d3078b575ed937e
      https://github.com/lxc/lxc/commit/a156301a6206e305594cb8616d3078b575ed937e
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/cgfs.c
    M src/lxc/cgmanager.c
    M src/lxc/cgroup.c
    M src/lxc/cgroup.h

  Log Message:
  -----------
  Ignore trailing /init.scope in init cgroups

The lxc monitor does not store the container's cgroups, rather it
recalculates them whenever needed.

Systemd moves itself into a /init.scope cgroup for the systemd
controller.

It might be worth changing that (by storing all cgroup info in the
lxc_handler), but for now go the hacky route and chop off any
trailing /init.scope.

I definately thinkg we want to switch to storing as that will be
more bullet-proof, but for now we need a quick backportable fix
for systemd 226 guests.

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


  Commit: 5e2c13c00eef49880cad9534669e1e8a9d026534
      https://github.com/lxc/lxc/commit/5e2c13c00eef49880cad9534669e1e8a9d026534
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  Parse rootfs->path

The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create
workdirs and upperdirs for overlay and aufs lxc.mount.entry entries. They try
to make sure that the workdirs and upperdirs can only be created under the
containerdir (e.g. /path/to/the/container/CONTAINERNAME). In order to do this
the right hand side of
           if ((strncmp(upperdir, lxcpath, dirlen) == 0) && (strncmp(upperdir, rootfs->path, rootfslen) != 0))

was thought to check if the rootfs->path is not present in the workdir and
upperdir mount options. But the current check is bogus since it will be
trivially true whenever the container is a block-dev or overlay or aufs backed
since the rootfs->path will then have a form like e.g.
   overlayfs:/some/path:/some/other/path

This patch adds the function ovl_get_rootfs_dir() which parses rootfs->path by
searching backwards for the first occurrence of the delimiter pair ":/". We do
not simply search for ":" since it might be used in path names. If ":/" is not
found we assume the container is directory backed and simply return
strdup(rootfs->path).

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 752b36f5b3ca11364462320e153a828e0946ded6
      https://github.com/lxc/lxc/commit/752b36f5b3ca11364462320e153a828e0946ded6
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  Simplify function

Instead of duplicating the cleanup-code, once for success and once for failure,
simply keep a variable fret which is -1 in the beginning and gets set to 0 on
success or stays -1 on failure.

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 605078488c09d96f0349d8a4757e59e36a569b94
      https://github.com/lxc/lxc/commit/605078488c09d96f0349d8a4757e59e36a569b94
  Author: Jakub Sztandera <kubuxu at gmail.com>
  Date:   2015-11-06 (Fri, 06 Nov 2015)

  Changed paths:
    M templates/lxc-archlinux.in

  Log Message:
  -----------
  arch template: Fix systemd-sysctl service

The systemd-sysctl service includes condition that /proc/sys/ has to be read-write.
In lxc only /proc/sys/net/ is read-write which causes the condition to fail and service not to run.
This patch changes the check to /proc/sys/net/ and makes the service apply only rules that are in net tree.

Signed-off-by: Jakub Sztandera <kubuxu at gmail.com>


Compare: https://github.com/lxc/lxc/compare/c94ee7a0d54d...605078488c09


More information about the lxc-devel mailing list