]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
8 years agoc/r: don't fail if there is no console_fd on restore
Tycho Andersen [Mon, 21 Mar 2016 22:52:02 +0000 (16:52 -0600)]
c/r: don't fail if there is no console_fd on restore

If we set lxc.console=none, this fd won't exist, so let's not fail if it
doesn't. We already partially handled this case correctly, so let's
actually handle it correctly :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoc/r: don't pass --ext-mount-map flag when console=none
Tycho Andersen [Mon, 21 Mar 2016 22:50:39 +0000 (16:50 -0600)]
c/r: don't pass --ext-mount-map flag when console=none

We don't pass anything on the restore side since we didn't save anything,
but the restore side will expect something if we pass this. Instead, let's
not pass anything.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agochange version to 2.0.0.rc12 in configure.ac
Stéphane Graber [Mon, 21 Mar 2016 20:44:45 +0000 (16:44 -0400)]
change version to 2.0.0.rc12 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #902 from tych0/better-criu-logging
Stéphane Graber [Fri, 18 Mar 2016 20:12:45 +0000 (16:12 -0400)]
Merge pull request #902 from tych0/better-criu-logging

Better criu logging

8 years agoc/r: print criu's stdout when it fails
Tycho Andersen [Fri, 18 Mar 2016 19:13:17 +0000 (13:13 -0600)]
c/r: print criu's stdout when it fails

In particular, when CRIU fails before it has its log completely initialized
(e.g. if the log directory doesn't exist, or if the argument parser fails),
it prints this to stdout. Let's log that.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoc/r: log the exact command we exec
Tycho Andersen [Fri, 18 Mar 2016 16:19:36 +0000 (10:19 -0600)]
c/r: log the exact command we exec

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agochange version to 2.0.0.rc11 in configure.ac
Stéphane Graber [Fri, 18 Mar 2016 03:11:50 +0000 (23:11 -0400)]
change version to 2.0.0.rc11 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #901 from stgraber/master
Christian Brauner [Thu, 17 Mar 2016 22:01:45 +0000 (23:01 +0100)]
Merge pull request #901 from stgraber/master

download: Bump to compat level 3

8 years agodownload: Bump to compat level 3
Stéphane Graber [Thu, 17 Mar 2016 21:41:14 +0000 (17:41 -0400)]
download: Bump to compat level 3

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #900 from tych0/dont-always-create-console
Stéphane Graber [Thu, 17 Mar 2016 20:02:47 +0000 (16:02 -0400)]
Merge pull request #900 from tych0/dont-always-create-console

autodev: don't always create /dev/console

8 years agoautodev: don't always create /dev/console
Tycho Andersen [Thu, 17 Mar 2016 11:14:43 +0000 (05:14 -0600)]
autodev: don't always create /dev/console

In particular, only create /dev/console when it is set to "none".
Otherwise, we will bind mount a pts device later, so let's just leave it.

Also, when bind mounting the pts device, let's create /dev/console if it
doesn't exist, since it may not already exist due to the above :)

v2: s/ot/to
v3: add O_EXCL so we actually get EEXIST, use the right condition for
    mount_console (we want to compare against console.path, not
    console.name, and console.path can be null)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoMerge pull request #899 from hallyn/2016-03-16/cgroupauto.2
Stéphane Graber [Thu, 17 Mar 2016 06:53:44 +0000 (02:53 -0400)]
Merge pull request #899 from hallyn/2016-03-16/cgroupauto.2

cgfsng: include sys/mount.h

8 years agocgfsng: two fixes for cgroup-full
Serge Hallyn [Thu, 17 Mar 2016 06:12:57 +0000 (23:12 -0700)]
cgfsng: two fixes for cgroup-full

We need to pass nosuid+nexec+nodev to remount to stop the kernel
from denying it.

When remounting the container's path read-write, use the right dest
path.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoinclude bdev.h
Serge Hallyn [Thu, 17 Mar 2016 04:27:24 +0000 (21:27 -0700)]
include bdev.h

for the define of RELATIME for android

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agouse hierarchy base path not just controller cgroup
Serge Hallyn [Thu, 17 Mar 2016 04:22:00 +0000 (21:22 -0700)]
use hierarchy base path not just controller cgroup

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfsng: include sys/mount.h
Serge Hallyn [Thu, 17 Mar 2016 03:54:38 +0000 (20:54 -0700)]
cgfsng: include sys/mount.h

to hopefully define RELATIME for android

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #898 from hallyn/2016-03-16/cgroupauto
Stéphane Graber [Thu, 17 Mar 2016 02:58:33 +0000 (22:58 -0400)]
Merge pull request #898 from hallyn/2016-03-16/cgroupauto

2016 03 16/cgroupauto

8 years agono variable decl in for loop
Serge Hallyn [Thu, 17 Mar 2016 02:05:06 +0000 (19:05 -0700)]
no variable decl in for loop

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgroups: try to load cgmanager first
Serge Hallyn [Wed, 16 Mar 2016 06:02:10 +0000 (23:02 -0700)]
cgroups: try to load cgmanager first

If cgmanager is running, use it.  This allows the admin to simply
stop cgmanager if they don't want to use it.  The other way there
is no way to choose to use cgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoimplement lxc.mount.auto = cgroup for cgfsng
Serge Hallyn [Wed, 16 Mar 2016 06:01:42 +0000 (23:01 -0700)]
implement lxc.mount.auto = cgroup for cgfsng

Also add testcase for each of the cgroup{,-full}:{rw,ro,mixed} cases.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #897 from hallyn/2016-03-16/aa
Christian Brauner [Wed, 16 Mar 2016 22:35:34 +0000 (23:35 +0100)]
Merge pull request #897 from hallyn/2016-03-16/aa

Prevent access to pci devices

8 years agoPrevent access to pci devices
Serge Hallyn [Wed, 16 Mar 2016 21:48:49 +0000 (14:48 -0700)]
Prevent access to pci devices

Prevent privileged containers from messing with the host's pci devices
directly.  Refuse access under /proc/bus, and drop cap_sys_rawio.  Some
containers may need to re-enable cap_sys_rawio (i.e. if they run an
X server).

It may be desirable to break some of this stuff into files which can be
separately included (or not included), but this patch isn't the right
place for that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #896 from hallyn/2016-03-15/nest
Stéphane Graber [Tue, 15 Mar 2016 22:21:12 +0000 (18:21 -0400)]
Merge pull request #896 from hallyn/2016-03-15/nest

2016 03 15/nest

8 years agonesting: remove the nesting hint from configuration templates
Serge Hallyn [Tue, 15 Mar 2016 21:47:44 +0000 (14:47 -0700)]
nesting: remove the nesting hint from configuration templates

we're having it inserted in every config by the lxcapi_create
itself.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agonesting: document how to enable nesting in container configurations
Serge Hallyn [Tue, 15 Mar 2016 21:43:44 +0000 (14:43 -0700)]
nesting: document how to enable nesting in container configurations

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #895 from tych0/fix-android-build
Stéphane Graber [Tue, 15 Mar 2016 18:21:01 +0000 (14:21 -0400)]
Merge pull request #895 from tych0/fix-android-build

build: fix build on android (and ppc)

8 years agobuild: fix build on android (and ppc)
Tycho Andersen [Tue, 15 Mar 2016 18:01:36 +0000 (12:01 -0600)]
build: fix build on android (and ppc)

The problem here is that dev_t on most platforms is `long unsigned`, but on
android (and ppc?) it's `long long unsigned`. Let's just upcast to `long
long unsigned` and use that format string to keep the compilers happy.

Safety first!

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoMerge pull request #893 from tych0/dont-require-dev-console-none
Stéphane Graber [Tue, 15 Mar 2016 17:32:49 +0000 (13:32 -0400)]
Merge pull request #893 from tych0/dont-require-dev-console-none

Dont require dev console none

8 years agoc/r: drop lxc.console=none config requirement
Tycho Andersen [Sat, 12 Mar 2016 01:10:40 +0000 (18:10 -0700)]
c/r: drop lxc.console=none config requirement

There are a few things going on in this patch.

1. /dev/console is an external mount since it is bind mounted from the
   host. However, we don't want to use criu's --ext-mount-map auto handling
   here, because that will bind mount exactly the same path from the host
   on restore, but if the pts device is different on the target host, we'll
   bind mount the wrong one, which is obviously wrong.

2. We need to tell CRIU how to restore the TTY. Since we declare the tty as
   --external, we need to provide it via --inherit-fd (even though we've
   already fixed up the environment).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agocriu: hide more stuff in criu.c
Tycho Andersen [Sat, 12 Mar 2016 02:01:43 +0000 (19:01 -0700)]
criu: hide more stuff in criu.c

Various other functions/structures are now only used in criu.c, so let's
hide stuff there so as not to pollute headers.

This commit also bumps the required CRIU versions to 2.0. While we don't
*require* any features that aren't in 1.8 patchlevel 21 or above, 2.0 is a
vast improvement, and so we should use that instead.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agochange version to 2.0.0.rc10 in configure.ac
Stéphane Graber [Fri, 11 Mar 2016 06:16:54 +0000 (01:16 -0500)]
change version to 2.0.0.rc10 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #892 from hallyn/2016-03-10/tasks
Stéphane Graber [Fri, 11 Mar 2016 05:23:49 +0000 (00:23 -0500)]
Merge pull request #892 from hallyn/2016-03-10/tasks

cgfsng: chmod the tasks and procns files

8 years agocgfsng: fix inverse null check
Serge Hallyn [Fri, 11 Mar 2016 04:40:47 +0000 (20:40 -0800)]
cgfsng: fix inverse null check

remove the hierarchy if the fullcgpath is NOT null.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfsng: chmod the tasks and procns files
Serge Hallyn [Fri, 11 Mar 2016 04:24:43 +0000 (20:24 -0800)]
cgfsng: chmod the tasks and procns files

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
 Changelog - stgraber points out s/chgrp/chmod and wrong perms

8 years agoMerge pull request #890 from hallyn/2016-03-10/cgfix
Stéphane Graber [Thu, 10 Mar 2016 22:50:56 +0000 (17:50 -0500)]
Merge pull request #890 from hallyn/2016-03-10/cgfix

cgfsng: get_cgroup_path: return the cgroup path not full mounted path

8 years agocgfsng: get_cgroup_path: return the cgroup path not full mounted path
Serge Hallyn [Thu, 10 Mar 2016 20:21:55 +0000 (12:21 -0800)]
cgfsng: get_cgroup_path: return the cgroup path not full mounted path

Add a temporary workaround for talking to containers started with the
buggy monitor.  We can remove it sometime after 2.0 release.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #889 from tych0/cgfsng-fixes
Serge Hallyn [Thu, 10 Mar 2016 19:24:02 +0000 (11:24 -0800)]
Merge pull request #889 from tych0/cgfsng-fixes

Cgfsng fixes

8 years agocgroup: cgroup_escape takes no arguments
Tycho Andersen [Thu, 10 Mar 2016 18:10:14 +0000 (11:10 -0700)]
cgroup: cgroup_escape takes no arguments

cgroup_escape() is a slight abuse of the cgroup code: what we really want
here is to escape the *current* process, whether it happens to be the LXC
monitor or not, into the / cgroups.

In the case of dump, we can't do an lxc_init(), because:

lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:993 - ##
lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:994 - # The container appears to be already running!
lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:995 - ##

We don't want to make this a command to send to the handler, because again,
cgroup_escape() is intended to escape the *current* task to the root
cgroups.

So, let's just have cgroup_escape() build its own handler when required.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agocriu: make exec_criu static
Tycho Andersen [Thu, 10 Mar 2016 17:54:19 +0000 (10:54 -0700)]
criu: make exec_criu static

This is no longer needed outside of criu.c with the ->migrate API call, so
let's mark it that way.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoMerge pull request #885 from brauner/bugfix_branch
Stéphane Graber [Wed, 9 Mar 2016 17:20:48 +0000 (12:20 -0500)]
Merge pull request #885 from brauner/bugfix_branch

lxc-attach: update and improve tests

8 years agolxc-attach: update and improve tests
Christian Brauner [Wed, 9 Mar 2016 14:44:05 +0000 (15:44 +0100)]
lxc-attach: update and improve tests

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agochange version to 2.0.0.rc9 in configure.ac
Stéphane Graber [Wed, 9 Mar 2016 08:02:58 +0000 (03:02 -0500)]
change version to 2.0.0.rc9 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #884 from hallyn/2016-03-08/batch
Christian Brauner [Wed, 9 Mar 2016 07:53:03 +0000 (08:53 +0100)]
Merge pull request #884 from hallyn/2016-03-08/batch

2016 03 08/batch

8 years agocgfsng: make sure a cgroup does not already exist
Serge Hallyn [Wed, 9 Mar 2016 07:34:19 +0000 (23:34 -0800)]
cgfsng: make sure a cgroup does not already exist

Our mkdir_p ignore eexist, and of course we want that for
upper path components, but the final directory itself must
not already exist.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfsng: fix real bug and fake libc realloc bug
Serge Hallyn [Wed, 9 Mar 2016 07:04:46 +0000 (23:04 -0800)]
cgfsng: fix real bug and fake libc realloc bug

read_file was using the wrong value for the string length.  Also,
realloc on i386 is wonky with small sizes - so use a batch size
to avoid small reallocs.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agochange version to 2.0.0.rc8 in configure.ac
Stéphane Graber [Tue, 8 Mar 2016 22:39:34 +0000 (17:39 -0500)]
change version to 2.0.0.rc8 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #883 from hallyn/2016-03-08/cgrouptests
Stéphane Graber [Tue, 8 Mar 2016 22:10:52 +0000 (17:10 -0500)]
Merge pull request #883 from hallyn/2016-03-08/cgrouptests

tests: set clone_children if need be

8 years agotests: set clone_children if need be
Serge Hallyn [Tue, 8 Mar 2016 21:44:38 +0000 (13:44 -0800)]
tests: set clone_children if need be

Lxc only sets it on /lxc, not on /.

It's conceivable that we should really re-set this to the original
value, to prevent making later tests not fail when they should.  I
didn't do that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #882 from hallyn/2016-03-08/cgfsng.2
Christian Brauner [Tue, 8 Mar 2016 21:19:45 +0000 (22:19 +0100)]
Merge pull request #882 from hallyn/2016-03-08/cgfsng.2

cgfsng: set cpuset clone_children if needed

8 years agocgfsng: set cpuset clone_children if needed
Serge Hallyn [Tue, 8 Mar 2016 18:49:16 +0000 (10:49 -0800)]
cgfsng: set cpuset clone_children if needed

Sigh.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #881 from hallyn/2016-03-08/cgfsng.1
Stéphane Graber [Tue, 8 Mar 2016 17:04:41 +0000 (12:04 -0500)]
Merge pull request #881 from hallyn/2016-03-08/cgfsng.1

cgfsng: enter/escape error msgs: differentiate and add errno

8 years agocgfsng: enter/escape error msgs: differentiate and add errno
Serge Hallyn [Tue, 8 Mar 2016 17:02:52 +0000 (09:02 -0800)]
cgfsng: enter/escape error msgs: differentiate and add errno

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #880 from stgraber/master
Serge Hallyn [Tue, 8 Mar 2016 16:08:53 +0000 (08:08 -0800)]
Merge pull request #880 from stgraber/master

Remove trailing newlines in log

8 years agoRemove trailing newlines in log
Stéphane Graber [Tue, 8 Mar 2016 14:50:53 +0000 (09:50 -0500)]
Remove trailing newlines in log

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #879 from hallyn/2016-03-07/debug.aa
Stéphane Graber [Tue, 8 Mar 2016 03:13:24 +0000 (22:13 -0500)]
Merge pull request #879 from hallyn/2016-03-07/debug.aa

prevent containers from reading /sys/kernel/debug

8 years agoprevent containers from reading /sys/kernel/debug
Serge Hallyn [Tue, 8 Mar 2016 03:10:58 +0000 (19:10 -0800)]
prevent containers from reading /sys/kernel/debug

Unprivileged containers cannot read it anyway, but also prevent root
owned containers from doing so.  Sadly upstart's mountall won't run
if we try to prevent it from being mounted at all.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agochange version to 2.0.0.rc7 in configure.ac
Stéphane Graber [Mon, 7 Mar 2016 23:47:50 +0000 (18:47 -0500)]
change version to 2.0.0.rc7 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoFix dist tarball to include lxc-devsetup
Stéphane Graber [Mon, 7 Mar 2016 23:31:27 +0000 (18:31 -0500)]
Fix dist tarball to include lxc-devsetup

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agochange version to 2.0.0.rc6 in configure.ac
Stéphane Graber [Mon, 7 Mar 2016 23:20:40 +0000 (18:20 -0500)]
change version to 2.0.0.rc6 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #875 from hallyn/cgfsng
Stéphane Graber [Mon, 7 Mar 2016 21:24:44 +0000 (16:24 -0500)]
Merge pull request #875 from hallyn/cgfsng

cgfsng: next generation filesystem-backed cgroup implementation

8 years agocgfsng: try to chown tasks and cgroup.procs
Serge Hallyn [Mon, 7 Mar 2016 20:20:14 +0000 (12:20 -0800)]
cgfsng: try to chown tasks and cgroup.procs

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #878 from stgraber/master
Serge Hallyn [Mon, 7 Mar 2016 20:09:36 +0000 (12:09 -0800)]
Merge pull request #878 from stgraber/master

Fix apparmor

8 years agoMerge pull request #872 from clopez/lxc-devsetup-sysvinit-upstart
Stéphane Graber [Mon, 7 Mar 2016 20:02:39 +0000 (15:02 -0500)]
Merge pull request #872 from clopez/lxc-devsetup-sysvinit-upstart

Execute script lxc-devsetup also with sysvinit and upstart.

8 years agoProperly update the generated apparmor profiles
Stéphane Graber [Mon, 7 Mar 2016 20:01:17 +0000 (15:01 -0500)]
Properly update the generated apparmor profiles

Some changes happened but the final profiles weren't generated...

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoRevert "allow cgroupfs mounts under /sys/fs/cgroup"
Stéphane Graber [Mon, 7 Mar 2016 20:00:05 +0000 (15:00 -0500)]
Revert "allow cgroupfs mounts under /sys/fs/cgroup"

This reverts commit 833bf9c2b29ff03cb5e5e1db089d25757f4a2647.

This change wasn't actually safe and is now superseded by the cgns profile.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agocgfsng: print debuginfo if LXC_DEBUG_CGFSNG env variable is set
Serge Hallyn [Mon, 7 Mar 2016 19:24:41 +0000 (11:24 -0800)]
cgfsng: print debuginfo if LXC_DEBUG_CGFSNG env variable is set

Note this is printing to stdout because it runs before logging is setup.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfsng - remove the code checking whether devices cgroup lines are already done
Serge Hallyn [Mon, 7 Mar 2016 19:16:43 +0000 (11:16 -0800)]
cgfsng - remove the code checking whether devices cgroup lines are already done

We may need to revert this, but I *think* we no longer need this
with default configs.  The idea iirc was that if caller cannot
write to devices.allow (i.e. is in a user namespace), then ignore
permission failures if the cgroups are already sufficiently setup.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocomment fixups
Serge Hallyn [Mon, 7 Mar 2016 19:04:30 +0000 (11:04 -0800)]
comment fixups

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #876 from d4s/upstream
Stéphane Graber [Mon, 7 Mar 2016 17:56:26 +0000 (12:56 -0500)]
Merge pull request #876 from d4s/upstream

Added ALTLinux distribution.

8 years agochmod container cgroup 775
Serge Hallyn [Sun, 6 Mar 2016 09:52:01 +0000 (01:52 -0800)]
chmod container cgroup 775

so that container root can create sub-cgroups

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoAdded ALTLinux distribution.
Denis Pynkin [Sat, 5 Mar 2016 13:40:17 +0000 (16:40 +0300)]
Added ALTLinux distribution.

- Added ALTLinux distribution.
- Updated template for ALTLinux Sisyphus

Signed-off-by: Denis Pynkin <denis_pynkin@epam.com>
8 years agocgfsng: print error when reaching 1000 failed cgroup creations
Serge Hallyn [Sat, 5 Mar 2016 08:38:54 +0000 (00:38 -0800)]
cgfsng: print error when reaching 1000 failed cgroup creations

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agouse strchr in place of index bc bionic
Serge Hallyn [Sat, 5 Mar 2016 08:36:14 +0000 (00:36 -0800)]
use strchr in place of index bc bionic

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #873 from brauner/bugfix_branch
Serge Hallyn [Sat, 5 Mar 2016 04:19:46 +0000 (20:19 -0800)]
Merge pull request #873 from brauner/bugfix_branch

lxc-attach: fix redirection - stderr

8 years agocgfsng: next generation filesystem-backed cgroup implementation
Serge Hallyn [Thu, 3 Mar 2016 18:31:23 +0000 (10:31 -0800)]
cgfsng: next generation filesystem-backed cgroup implementation

This makes simplifying assumptions:  all usable cgroups must be
mounted under /sys/fs/cgroup/controller or /sys/fs/cgroup/contr1,contr2.

Currently this will only work with cgroup namespaces, because
lxc.mount.auto = cgroup is not implemented.  So cgfsng_ops_init()
returns NULL if cgroup namespaces are not enabled.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agotests: add lxc-test-attach-test
Christian Brauner [Fri, 4 Mar 2016 20:12:31 +0000 (21:12 +0100)]
tests: add lxc-test-attach-test

Test if the various types of I/O redirection work with lxc-attach.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agolxc-attach: fix redirection - stderr
Christian Brauner [Fri, 4 Mar 2016 18:32:00 +0000 (19:32 +0100)]
lxc-attach: fix redirection - stderr

So that we can do things like:

lxc-attach -n a -- sh -c 'echo ERR >&2' > /dev/null

There seems to be no easy way to discern when we need to write to stderr
instead of stdout when we receive an event on the master fd of an allocated
pty. So we're using a "trick"/"hack". We write to STDOUT_FILENO if it refers to
a pty. If STDOUT_FILENO does not refer to a pty we check whether STDERR_FILENO
refers to a pty and if so write to it.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoExecute script lxc-devsetup also with sysvinit and upstart.
Carlos Alberto Lopez Perez [Fri, 4 Mar 2016 15:40:21 +0000 (16:40 +0100)]
Execute script lxc-devsetup also with sysvinit and upstart.

  * This script sets /dev/.lxc which is needed for autodev containers.
  * Previously was only executed with systemd. Execute it also with
    the other init systems (sysvinit and upstart)

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
8 years agoMerge pull request #871 from ysbnim/master
Christian Brauner [Fri, 4 Mar 2016 08:54:43 +0000 (09:54 +0100)]
Merge pull request #871 from ysbnim/master

doc: Update Korean lxc-attach(1) and lxc-copy(1), Improve lxc-unshare(1)

8 years agodoc: improve lxc-unshare(1)
Sungbae Yoo [Fri, 4 Mar 2016 03:01:15 +0000 (12:01 +0900)]
doc: improve lxc-unshare(1)

Explain that the pipe symbol needs to be escaped for -s.

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: improve Korean lxc-attach(1)
Sungbae Yoo [Fri, 4 Mar 2016 02:55:03 +0000 (11:55 +0900)]
doc: improve Korean lxc-attach(1)

Explain that the pipe symbol needs to be escaped for -e and -s.
Update for commit 759d521

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: add copy hook explanation to Korean lxc-copy(1)
Sungbae Yoo [Fri, 4 Mar 2016 02:25:16 +0000 (11:25 +0900)]
doc: add copy hook explanation to Korean lxc-copy(1)

Update for commit cc0607a

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agochange version to 2.0.0.rc5 in configure.ac
Stéphane Graber [Thu, 3 Mar 2016 15:58:28 +0000 (10:58 -0500)]
change version to 2.0.0.rc5 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #868 from brauner/bugfix_branch
Stéphane Graber [Thu, 3 Mar 2016 15:50:53 +0000 (10:50 -0500)]
Merge pull request #868 from brauner/bugfix_branch

console.{c.h}: add/improve documentation

8 years agoconsole.{c.h}: add/improve documentation
Christian Brauner [Thu, 3 Mar 2016 14:47:49 +0000 (15:47 +0100)]
console.{c.h}: add/improve documentation

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #867 from tenforward/plamo
Christian Brauner [Thu, 3 Mar 2016 10:21:41 +0000 (11:21 +0100)]
Merge pull request #867 from tenforward/plamo

plamo: Update release version and repository for getting packages

8 years agoplamo: Update release version and repository for getting packages
KATOH Yasufumi [Wed, 2 Mar 2016 08:48:52 +0000 (17:48 +0900)]
plamo: Update release version and repository for getting packages

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agoMerge pull request #866 from tenforward/japanese_man
Christian Brauner [Thu, 3 Mar 2016 09:16:28 +0000 (10:16 +0100)]
Merge pull request #866 from tenforward/japanese_man

Update Japanese lxc-attach(1) and lxc-copy(1)

8 years agodoc: improve Japanese lxc-attach(1)
KATOH Yasufumi [Thu, 3 Mar 2016 07:20:34 +0000 (16:20 +0900)]
doc: improve Japanese lxc-attach(1)

Explain that the pipe symbol needs to be escaped for -e and -s.
Update for commit 759d521

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agodoc: add copy hook explanation to Japanese lxc-copy(1)
KATOH Yasufumi [Thu, 3 Mar 2016 07:13:35 +0000 (16:13 +0900)]
doc: add copy hook explanation to Japanese lxc-copy(1)

Update for commit cc0607a

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agoMerge pull request #865 from hallyn/2016-03-02/cgfs.rmperms
Stéphane Graber [Thu, 3 Mar 2016 00:59:23 +0000 (19:59 -0500)]
Merge pull request #865 from hallyn/2016-03-02/cgfs.rmperms

2016 03 02/cgfs.rmperms

8 years agolxc-test-unpriv: try to start the container a second time
Serge Hallyn [Thu, 3 Mar 2016 00:17:17 +0000 (16:17 -0800)]
lxc-test-unpriv: try to start the container a second time

We have nothing else testing this, and it was a real regression in lp
bug 1552355.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfs: don't try to remove cgroups we haven't created
Serge Hallyn [Thu, 3 Mar 2016 00:11:14 +0000 (16:11 -0800)]
cgfs: don't try to remove cgroups we haven't created

info_ptr->created_paths_count can be 0, so don't blindly dereference
info_ptr->created_paths[ created_paths_count - 1].  Apparently we never
used to have 0 at the cleanup_name_on_this_level before, but now that
we can fail with -eperm and not just -eexist, we do.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfs: be less verbose
Serge Hallyn [Wed, 2 Mar 2016 23:23:33 +0000 (15:23 -0800)]
cgfs: be less verbose

don't always warn about unused cgroups, it's noisy and not helpful

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfs: switch to userns when removing cgroup
Serge Hallyn [Wed, 2 Mar 2016 22:00:13 +0000 (14:00 -0800)]
cgfs: switch to userns when removing cgroup

Otherwise unprivileged users may not have the privilege needed to
remove their cgroups.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #864 from brauner/bugfix_branch
Stéphane Graber [Wed, 2 Mar 2016 15:04:04 +0000 (10:04 -0500)]
Merge pull request #864 from brauner/bugfix_branch

Add features/small improvements to man pages (lxc-attach, lxc-copy)

8 years agolxc-copy: update help to include hook options
Christian Brauner [Wed, 2 Mar 2016 13:14:06 +0000 (14:14 +0100)]
lxc-copy: update help to include hook options

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agolxc-copy: add copy hook explanation to manpage
Christian Brauner [Wed, 2 Mar 2016 13:06:52 +0000 (14:06 +0100)]
lxc-copy: add copy hook explanation to manpage

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agolxc-attach: small improvements to manpage
Christian Brauner [Wed, 2 Mar 2016 11:48:38 +0000 (12:48 +0100)]
lxc-attach: small improvements to manpage

Explain that the pipe symbol needs to be escaped for -e and -s.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #863 from brauner/bugfix_branch
Stéphane Graber [Tue, 1 Mar 2016 22:40:11 +0000 (17:40 -0500)]
Merge pull request #863 from brauner/bugfix_branch

lxc-copy: correct order of copy and original & lxc-attach: setup ts->stdoutfd