]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
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 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

8 years agolxc-attach: setup ts->stdoutfd
Christian Brauner [Tue, 1 Mar 2016 22:05:59 +0000 (23:05 +0100)]
lxc-attach: setup ts->stdoutfd

Otherwise we cannot do things like:

- lxc-attach -n a runlevel </dev/null
- lxc-attach -n a runlevel </dev/null 2>/dev/null
- lxc-attach -n a runlevel </dev/null 2>/dev/null | cat

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agolxc-copy: correct order of copy and original
Christian Brauner [Tue, 1 Mar 2016 20:50:55 +0000 (21:50 +0100)]
lxc-copy: correct order of copy and original

lxc-copy -n ORIG -N COPY -e

accidently printed

"Created ORIG as clone of COPY"

instead of

"Created COPY as clone of ORIG".
Fix the ordering.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #862 from brauner/2016-03-01/post_stop_fail_no_reboot
Stéphane Graber [Tue, 1 Mar 2016 16:53:51 +0000 (11:53 -0500)]
Merge pull request #862 from brauner/2016-03-01/post_stop_fail_no_reboot

start.c: do not reboot on lxc.hook.post-stop fail

8 years agostart.c: do not reboot on lxc.hook.post-stop fail
Christian Brauner [Tue, 1 Mar 2016 09:42:45 +0000 (10:42 +0100)]
start.c: do not reboot on lxc.hook.post-stop fail

lxc should not reboot the container when lxc.hook.post-stop fails. It should
simply shutdown. This makes the behavior of lxc.hook.post-stop and
lxc.hook.pre-start consistent. When lxc.hook.pre-start fails, the container
does not start.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #859 from brauner/bugfix_branch
Serge Hallyn [Mon, 29 Feb 2016 22:18:10 +0000 (14:18 -0800)]
Merge pull request #859 from brauner/bugfix_branch

lxc-attach: always allocate current controlling pty

8 years agolxc-attach: always allocate current controlling pty
Christian Brauner [Mon, 29 Feb 2016 09:52:43 +0000 (10:52 +0100)]
lxc-attach: always allocate current controlling pty

lxc-attach uses lxc_console_create() to allocate a pty on the host.
lxc_console_create() in turn calls lxc_console_peer_default() which either
makes the current controlling pty our controlling pty for the container, or
uses whatever the user gave us (e.g. /dev/tty2 etc.). For lxc-attach we always
want the current controlling pty to be used. This commit ensures that we're in
fact always using the current controlling pty. The commit also fixes a segfault
when the user specified lxc.console.path = none.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #857 from brauner/bugfix_branch
Serge Hallyn [Sat, 27 Feb 2016 18:46:09 +0000 (10:46 -0800)]
Merge pull request #857 from brauner/bugfix_branch

cgfs: don't chown/chmod/rm non-existing paths

8 years agocgfs: don't chown/chmod/rm non-existing paths
Christian Brauner [Sat, 27 Feb 2016 16:00:45 +0000 (17:00 +0100)]
cgfs: don't chown/chmod/rm non-existing paths

Dirty fix for the current noisiness when lxc_cgroupfs_create() could not create
cgroups.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agochange version to 2.0.0.rc4 in configure.ac
Stéphane Graber [Sat, 27 Feb 2016 03:30:43 +0000 (22:30 -0500)]
change version to 2.0.0.rc4 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #856 from hallyn/2016-02-26/cgfs.cgns.2
Christian Brauner [Fri, 26 Feb 2016 22:08:22 +0000 (23:08 +0100)]
Merge pull request #856 from hallyn/2016-02-26/cgfs.cgns.2

cgfs: ignore mount prefix in mountinfo if cgroup namespaces are suppo…

8 years agocgfs: ignore mount prefix in mountinfo if cgroup namespaces are supported
Serge Hallyn [Fri, 26 Feb 2016 21:35:24 +0000 (13:35 -0800)]
cgfs: ignore mount prefix in mountinfo if cgroup namespaces are supported

This is not 100% correct, but will suffice until we fix the kernel so that
we can distinguish between bind mounts and namespaced cgroupfs mounts.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #855 from hallyn/2016-02-26/cgfs.crucial
Christian Brauner [Fri, 26 Feb 2016 20:55:27 +0000 (21:55 +0100)]
Merge pull request #855 from hallyn/2016-02-26/cgfs.crucial

fix cgfs failure for unpriv users

8 years agofix cgfs failure for unpriv users
Serge Hallyn [Fri, 26 Feb 2016 20:03:09 +0000 (20:03 +0000)]
fix cgfs failure for unpriv users

Cgmanager was taught awhile ago that only some cgroup controllers are
crucial.  Teach cgfs the same thing.

This patch needs improvement, but will fix failure of lxc without cgmanager
for unprivileged users for now.  In particular, needed improvements include:

1. the check for crucial subsystems needs to include lxc.use
2. we should keep a list of the actually used subsystems so we don't keep
trying to chmod and enter after create has found we couldn't use a particular
subsystem

This fixes unprivileged lxc use.  It does not appear to suffice to fix
nested unprivilegd lxd usage.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #751 from jirutka/alpine-tmpl
Christian Brauner [Fri, 26 Feb 2016 14:46:02 +0000 (15:46 +0100)]
Merge pull request #751 from jirutka/alpine-tmpl

Rewrite template script for Alpine Linux

8 years agoMerge pull request #852 from brauner/bugfix_branch
Stéphane Graber [Fri, 26 Feb 2016 14:44:05 +0000 (09:44 -0500)]
Merge pull request #852 from brauner/bugfix_branch

lxc-ls: count spaces

8 years agolxc-alpine: allow to install additional packages
Jakub Jirutka [Sun, 21 Feb 2016 00:31:19 +0000 (01:31 +0100)]
lxc-alpine: allow to install additional packages

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agolxc-alpine: cache APK packages instead of rootfs
Jakub Jirutka [Sun, 21 Feb 2016 00:03:03 +0000 (01:03 +0100)]
lxc-alpine: cache APK packages instead of rootfs

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agolxc-alpine: remove all bashisms, make it compatible with dash
Jakub Jirutka [Sun, 7 Feb 2016 14:04:13 +0000 (15:04 +0100)]
lxc-alpine: remove all bashisms, make it compatible with dash

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agolxc-alpine: make it compatible with ash, replace curl and rsync
Jakub Jirutka [Sat, 23 Jan 2016 17:55:58 +0000 (18:55 +0100)]
lxc-alpine: make it compatible with ash, replace curl and rsync

Now it runs even on minimal Alpine system without bash, curl, openssl or
rsync.

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agolxc-alpine: completely rewrite the template script
Jakub Jirutka [Mon, 4 Jan 2016 21:20:09 +0000 (22:20 +0100)]
lxc-alpine: completely rewrite the template script

New template script is more readable and robust, uses cache and external
LXC config file as other templates.

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agoMerge pull request #854 from ysbnim/master
Christian Brauner [Fri, 26 Feb 2016 11:48:23 +0000 (12:48 +0100)]
Merge pull request #854 from ysbnim/master

Update Korean manuals

8 years agoMerge pull request #853 from tenforward/japanese_man
Christian Brauner [Fri, 26 Feb 2016 11:45:48 +0000 (12:45 +0100)]
Merge pull request #853 from tenforward/japanese_man

doc: Update Japanese lxc-attach(1)