]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 years agoAdded ALTLinux distribution. 876/head
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>
9 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

9 years agotests: add lxc-test-attach-test 873/head
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>
9 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>
9 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)

9 years agodoc: improve lxc-unshare(1) 871/head
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>
9 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>
9 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>
9 years agochange version to 2.0.0.rc5 in configure.ac lxc-2.0.0.rc5
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>
9 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

9 years agoconsole.{c.h}: add/improve documentation 868/head
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>
9 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

9 years agoplamo: Update release version and repository for getting packages 867/head
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>
9 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)

9 years agodoc: improve Japanese lxc-attach(1) 866/head
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>
9 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>
9 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

9 years agolxc-test-unpriv: try to start the container a second time 865/head
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>
9 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>
9 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>
9 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>
9 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)

9 years agolxc-copy: update help to include hook options 864/head
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>
9 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>
9 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>
9 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

9 years agolxc-attach: setup ts->stdoutfd 863/head
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>
9 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>
9 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

9 years agostart.c: do not reboot on lxc.hook.post-stop fail 862/head
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>
9 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

9 years agolxc-attach: always allocate current controlling pty 859/head
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>
9 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

9 years agocgfs: don't chown/chmod/rm non-existing paths 857/head
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>
9 years agochange version to 2.0.0.rc4 in configure.ac lxc-2.0.0.rc4
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>
9 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…

9 years agocgfs: ignore mount prefix in mountinfo if cgroup namespaces are supported 856/head
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>
9 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

9 years agofix cgfs failure for unpriv users 855/head
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>
9 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

9 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

9 years agolxc-alpine: allow to install additional packages 751/head
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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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)

9 years agodoc: Update Japanese lxc-attach(1) 853/head
KATOH Yasufumi [Fri, 26 Feb 2016 11:05:09 +0000 (20:05 +0900)] 
doc: Update Japanese lxc-attach(1)

Update the description of pty allocation. Update for commit 478dda7.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Add the Korean description that automount is ignored when cgroup namespaces... 854/head
Sungbae Yoo [Fri, 26 Feb 2016 10:32:12 +0000 (19:32 +0900)] 
doc: Add the Korean description that automount is ignored when cgroup namespaces are supported.

Update for commit 4608594

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Update Korean lxc-clone(1) and lxc-start-ephemeral(1)
Sungbae Yoo [Fri, 26 Feb 2016 10:16:07 +0000 (19:16 +0900)] 
doc: Update Korean lxc-clone(1) and lxc-start-ephemeral(1)

Update for commit 2ae6732.

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Update Korean lxc-attach(1)
Sungbae Yoo [Fri, 26 Feb 2016 09:39:09 +0000 (18:39 +0900)] 
doc: Update Korean lxc-attach(1)

Update for commit e986ea3

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Add the Korean description of cgns apparmor profile in lxc.container.conf
Sungbae Yoo [Thu, 25 Feb 2016 06:39:00 +0000 (15:39 +0900)] 
doc: Add the Korean description of cgns apparmor profile in lxc.container.conf

Update for commit 7a126ae

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Add LXC_CGNS_AWARE env to Korean lxc.container.conf(5)
Sungbae Yoo [Thu, 25 Feb 2016 06:21:10 +0000 (15:21 +0900)] 
doc: Add LXC_CGNS_AWARE env to Korean lxc.container.conf(5)

Update for commit c4cafa0

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agolxc-ls: count spaces 852/head
Christian Brauner [Fri, 26 Feb 2016 10:18:47 +0000 (11:18 +0100)] 
lxc-ls: count spaces

Otherwise line wrapping might occur too late.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #851 from tych0/set-sid-in-init
Serge Hallyn [Fri, 26 Feb 2016 01:00:20 +0000 (17:00 -0800)] 
Merge pull request #851 from tych0/set-sid-in-init

start: setsid in init task as well

9 years agostart: setsid in init task as well 851/head
Tycho Andersen [Fri, 26 Feb 2016 00:04:01 +0000 (17:04 -0700)] 
start: setsid in init task as well

If we don't do this, we'll leak the parent's session id to the container,
which maybe doesn't matter, but it still seems better to set it anyway.

Also, it breaks CRIU for containers that don't call setsid themselves.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #849 from brauner/2016-02-25/fix_attach_container_put
Serge Hallyn [Thu, 25 Feb 2016 19:48:26 +0000 (11:48 -0800)] 
Merge pull request #849 from brauner/2016-02-25/fix_attach_container_put

lxc-attach: rework pty allocation

9 years agoMerge pull request #850 from hallyn/2016-02-25/cgfs.lxcfs
Stéphane Graber [Thu, 25 Feb 2016 19:39:28 +0000 (14:39 -0500)] 
Merge pull request #850 from hallyn/2016-02-25/cgfs.lxcfs

cgfs: make sure we use valid cgroup mountpoints

9 years agocgfs: make sure we use valid cgroup mountpoints 850/head
Serge Hallyn [Thu, 25 Feb 2016 19:01:12 +0000 (11:01 -0800)] 
cgfs: make sure we use valid cgroup mountpoints

If lxcfs starts before cgroup-lite, then the first cgroup mountpoints in
/proc/self/mountinfo are /run/lxcfs/*.  Unprivileged users cannot access
these.  So privileged containers are ok, and unprivileged containers are ok
since they won't cache those to begin with.  But unprivileged root-owned
containers cache /run/lxcfs/* and then try to use them.

So when doing cgroup automounting check whether the mountpoints we have
stored are accessible, and if not look for a new one to use.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-attach: rework pty allocation 849/head
Christian Brauner [Thu, 25 Feb 2016 14:22:53 +0000 (15:22 +0100)] 
lxc-attach: rework pty allocation

Previously we implemented two ways to get a pty for lxc-attach:
1. get a pty in the container
2. get a pty on the host

Where 1. was the default and 2. was only tried after 1. failed.
For safety and simplicity reasons, we remove 1. and just keep 2. around.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #847 from tenforward/japanese_man
Christian Brauner [Thu, 25 Feb 2016 07:57:21 +0000 (08:57 +0100)] 
Merge pull request #847 from tenforward/japanese_man

Update Japanese man

9 years agodoc: Update Japanese lxc.container.conf(5) 847/head
KATOH Yasufumi [Thu, 25 Feb 2016 06:38:30 +0000 (15:38 +0900)] 
doc: Update Japanese lxc.container.conf(5)

- Add the description that automount is ignored when cgroup namespaces
  are supported. Update for commit 4608594.
- Unify terminology of translation

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Update Japanese lxc-clone(1) and lxc-start-ephemeral(1)
KATOH Yasufumi [Thu, 25 Feb 2016 06:15:41 +0000 (15:15 +0900)] 
doc: Update Japanese lxc-clone(1) and lxc-start-ephemeral(1)

describe that lxc-clone and lxc-start-ephemeral have been deprecated
in those man pages.
Update for commit 2ae6732.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agochange version to 2.0.0.rc3 in configure.ac lxc-2.0.0.rc3
Stéphane Graber [Thu, 25 Feb 2016 02:13:20 +0000 (21:13 -0500)] 
change version to 2.0.0.rc3 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #846 from hallyn/2016-02-24/cgns.auto
Stéphane Graber [Thu, 25 Feb 2016 02:11:29 +0000 (21:11 -0500)] 
Merge pull request #846 from hallyn/2016-02-24/cgns.auto

cgfs: do not automount if cgroup namespaces are supported

9 years agocgfs: do not automount if cgroup namespaces are supported 846/head
Serge Hallyn [Thu, 25 Feb 2016 01:00:35 +0000 (17:00 -0800)] 
cgfs: do not automount if cgroup namespaces are supported

In that case containers will be able to mount cgroup filesystems
for themselves as they do on a host.

This fixes inability to start systemd based containers on cgns-enabled
kernels with cgmanager not running.

I've tested debian jessie, busybox, ubuntu trusty and xenial, all of
which booted ok.  However if there are some setups which require
premounted cgroupfs (i.e. they don't mount if they detect being in
a container), this may cause trouble.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #844 from brauner/2016-02-22/manpage_update
Stéphane Graber [Thu, 25 Feb 2016 01:35:26 +0000 (20:35 -0500)] 
Merge pull request #844 from brauner/2016-02-22/manpage_update

configure.ac: add --enable-deprecated flag

9 years agoconfigure.ac: add --enable-deprecated flag 844/head
Christian Brauner [Wed, 24 Feb 2016 18:28:12 +0000 (19:28 +0100)] 
configure.ac: add --enable-deprecated flag

- lxc-clone and lxc-start-ephemeral are marked deprecated. We add a
  --enable-deprecated flag to configure.ac allowing us to enable these
  deprecated executables
- update tests to use lxc-copy instead of lxc-clone

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agomark lxc-clone & lxc-start-ephemeral as deprecated
Christian Brauner [Tue, 23 Feb 2016 23:02:49 +0000 (00:02 +0100)] 
mark lxc-clone & lxc-start-ephemeral as deprecated

- add deprecation not to man pages
- print deprecation info to stderr when the executables are invoked

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #843 from tenforward/japanese_man
Christian Brauner [Wed, 24 Feb 2016 09:10:20 +0000 (10:10 +0100)] 
Merge pull request #843 from tenforward/japanese_man

Update Japanese man

9 years agodoc: Update Japanese lxc-clone(1) and lxc-start-ephemeral(1) 843/head
KATOH Yasufumi [Wed, 24 Feb 2016 09:04:40 +0000 (18:04 +0900)] 
doc: Update Japanese lxc-clone(1) and lxc-start-ephemeral(1)

Update for commit 02e5d92

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Update Japanese lxc-attach(1)
KATOH Yasufumi [Wed, 24 Feb 2016 09:04:05 +0000 (18:04 +0900)] 
doc: Update Japanese lxc-attach(1)

Update for commit e986ea3

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoMerge pull request #841 from brauner/2016-02-22/manpage_update
Stéphane Graber [Tue, 23 Feb 2016 15:08:48 +0000 (10:08 -0500)] 
Merge pull request #841 from brauner/2016-02-22/manpage_update

update manpages

9 years agoupdate manpages 841/head
Christian Brauner [Tue, 23 Feb 2016 07:08:58 +0000 (08:08 +0100)] 
update manpages

- add note to lxc-clone manpage that it is superseded by lxc-copy
- add note to lxc-start-ephemeral manpage that it is superseded by lxc-copy
- fix typo in lxc-attach manpage
- fix some of my comments in lxc_ls.c

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #840 from brauner/2016-02-22/manpage_update
Stéphane Graber [Tue, 23 Feb 2016 00:27:00 +0000 (19:27 -0500)] 
Merge pull request #840 from brauner/2016-02-22/manpage_update

update lxc-attach manpage

9 years agoupdate lxc-attach manpage 840/head
Christian Brauner [Mon, 22 Feb 2016 22:23:58 +0000 (23:23 +0100)] 
update lxc-attach manpage

- explain rationale behind allocation of pty
- briefly explain how a pty is allocated
- add a short note that describes the changed behavior for lxc-attach when the
  user is not placed in a writeable cgroup at login

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agochange version to 2.0.0.rc2 in configure.ac lxc-2.0.0.rc2
Stéphane Graber [Mon, 22 Feb 2016 18:39:01 +0000 (13:39 -0500)] 
change version to 2.0.0.rc2 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #839 from brauner/2016-02-15/lxc_attach_pty
Stéphane Graber [Mon, 22 Feb 2016 15:22:59 +0000 (10:22 -0500)] 
Merge pull request #839 from brauner/2016-02-15/lxc_attach_pty

lxc-attach: add comment, & implement login_tty()

9 years agolxc-attach: add comment, & implement login_tty() 839/head
Christian Brauner [Mon, 22 Feb 2016 11:27:06 +0000 (12:27 +0100)] 
lxc-attach: add comment, & implement login_tty()

- The code required to prepare an fd to act as a login tty is shared among
  pty_on_host_callback() and fork_pty(). This implements login_pty(), a
  minimalistic login_tty() clone, to avoid code redundancy.
- Give pty_in_container() a slightly extended comment.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #837 from tenforward/japanese_man
Stéphane Graber [Mon, 22 Feb 2016 06:30:21 +0000 (01:30 -0500)] 
Merge pull request #837 from tenforward/japanese_man

doc: Add Japanese description of cgns apparmor profile in lxc.container.conf(5)

9 years agodoc: Add Japanese description of cgns apparmor profile in lxc.container.conf(5) 837/head
KATOH Yasufumi [Mon, 22 Feb 2016 06:21:40 +0000 (15:21 +0900)] 
doc: Add Japanese description of cgns apparmor profile in lxc.container.conf(5)

Update for commit 7a126ae

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoMerge pull request #836 from hallyn/2016-02-21/cgns.aa
Stéphane Graber [Mon, 22 Feb 2016 05:37:00 +0000 (00:37 -0500)] 
Merge pull request #836 from hallyn/2016-02-21/cgns.aa

2016 02 21/cgns.aa

9 years agoupdate tests to recognize cgns profile 836/head
Serge Hallyn [Mon, 22 Feb 2016 05:09:42 +0000 (21:09 -0800)] 
update tests to recognize cgns profile

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc.container.conf / apparmor : document cgns profile
Serge Hallyn [Mon, 22 Feb 2016 04:46:58 +0000 (20:46 -0800)] 
lxc.container.conf / apparmor : document cgns profile

Also document 'unchanged' which we had never documented before.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoallow cgroup mounting in nesting profile
Serge Hallyn [Sun, 21 Feb 2016 23:52:07 +0000 (15:52 -0800)] 
allow cgroup mounting in nesting profile

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoApparmor: use lxc-default-cgns if cgns is enabled
Serge Hallyn [Sun, 21 Feb 2016 23:51:37 +0000 (15:51 -0800)] 
Apparmor: use lxc-default-cgns if cgns is enabled

Because containers need to - and safely can - mount cgroufs in that
case.

Note that if cgns is enabled but the unshare fails, we fail the container
start, so checking whether they are enabled is enough.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd lxc-default-cgns profile
Serge Hallyn [Sun, 21 Feb 2016 23:38:11 +0000 (15:38 -0800)] 
add lxc-default-cgns profile

This isn't safe for privileged containers which do not use cgroup
namespaces, but is required for systemd containers with cgroup
namespaces.  So create a new profile for it which lxc will use as
the default when it knows it can.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #835 from brauner/2016-02-15/lxc_attach_pty
Stéphane Graber [Sun, 21 Feb 2016 22:44:52 +0000 (17:44 -0500)] 
Merge pull request #835 from brauner/2016-02-15/lxc_attach_pty

fix android build

9 years agofix android build 835/head
Christian Brauner [Sun, 21 Feb 2016 22:14:23 +0000 (23:14 +0100)] 
fix android build

bionic libc doesn't know _Exit(). Replace it with _exit().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #825 from brauner/2016-02-15/lxc_attach_pty
Serge Hallyn [Sun, 21 Feb 2016 19:16:36 +0000 (11:16 -0800)] 
Merge pull request #825 from brauner/2016-02-15/lxc_attach_pty

make lxc-attach use a pty

9 years agomake lxc-attach use a pty 825/head
Christian Brauner [Mon, 15 Feb 2016 21:10:40 +0000 (22:10 +0100)] 
make lxc-attach use a pty

So far lxc-attach did not use a pty when attaching to a container. This made it
vulnerable to tty input faking via TIOCSTI when switching to a different user.
This patch makes lxc-attach use a pty in most cases. The only current exemption
is when stdin, stdout, and stderr are not referring to a pty.

There are two ways how lxc-attach can receive a pty:
1. get a pty in the container
2. get a pty on the host
This patch makes 1. the default and only opts for 2. when 1. fails before
giving up. The rationale behind this is as follows: If we create a pty on the
host (2.) and pass the fds to the container the container may report "no tty"
when the "tty" command is used. This could be irritating for users when they
expect that lxc-attach now always tries to use a pty. Hence, option 1. is the
default.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoclean exit on EPOLLHUP
Christian Brauner [Thu, 18 Feb 2016 14:20:34 +0000 (15:20 +0100)] 
clean exit on EPOLLHUP

lxc_console_cb_tty_masterfd() unnecessarily reported a read/write error when
the fd was closed. This happens e.g. when we have allocated a tty in the
container with lxc-console and we shut the container down. lxc-console will
then exit with an error message. This patch introduces a test whether the
EPOLLHUP bit is set in the events mask. If so, we report no error.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agorewrite lxc_console_set_stdfds
Christian Brauner [Wed, 17 Feb 2016 18:48:54 +0000 (19:48 +0100)] 
rewrite lxc_console_set_stdfds

Make lxc_console_set_stdfds useable by other callers that do not have access to
lxc_handler.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agomake tty helper functions extern
Christian Brauner [Mon, 15 Feb 2016 18:40:55 +0000 (19:40 +0100)] 
make tty helper functions extern

- lxc_console_cb_tty_stdin()
- lxc_console_cb_tty_master()
- lxc_setup_tios(int fd, struct termios *oldtios);
- lxc_console_winsz(int srcfd, int dstfd);
- lxc_console_cb_sigwinch_fd(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr);
- lxc_tty_state *lxc_console_sigwinch_init(int srcfd, int dstfd);
- lxc_console_sigwinch_fini(struct lxc_tty_state *ts);

We can make use these functions in other modules.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agomake escape sequence to exit tty optional
Christian Brauner [Mon, 15 Feb 2016 18:38:32 +0000 (19:38 +0100)] 
make escape sequence to exit tty optional

We want to reuse lxc_console_cb_tty_stdin() in lxc_attach.c.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #833 from mar-kolya/fix-sshd-template-init-location-for-systemd
Stéphane Graber [Sun, 21 Feb 2016 07:03:24 +0000 (02:03 -0500)] 
Merge pull request #833 from mar-kolya/fix-sshd-template-init-location-for-systemd

Fix sshd template on systems with systemd

9 years agoFix sshd template on systems with systemd 833/head
Nikolay Martynov [Sun, 21 Feb 2016 06:16:15 +0000 (01:16 -0500)] 
Fix sshd template on systems with systemd

Systems with systemd have /sbin/init as a symlink pointing to real init.
Sshd template tries to bind-mount special init implementation.
The problem is that one cannot bind-mount to a location that is a symlink.

Fix this by deferencing /sbin/init symling and using that as bind-mount location.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
9 years agodoc: add LXC_CGNS_AWARE env to Japanese lxc.container.conf(5)
KATOH Yasufumi [Sun, 21 Feb 2016 05:54:07 +0000 (00:54 -0500)] 
doc: add LXC_CGNS_AWARE env to Japanese lxc.container.conf(5)

Update for commit c4cafa0

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #832 from stgraber/master
Serge Hallyn [Sat, 20 Feb 2016 05:02:01 +0000 (21:02 -0800)] 
Merge pull request #832 from stgraber/master

Fix typo in lxc manpage