]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
8 years agocgfs: make sure we use valid cgroup mountpoints
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>
8 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

8 years agodoc: Update Japanese lxc.container.conf(5)
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>
8 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>
8 years agochange version to 2.0.0.rc3 in configure.ac
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>
8 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

8 years agocgfs: do not automount if cgroup namespaces are supported
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>
8 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

8 years agoconfigure.ac: add --enable-deprecated flag
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>
8 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>
8 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

8 years agodoc: Update Japanese lxc-clone(1) and lxc-start-ephemeral(1)
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>
8 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>
8 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

8 years agoupdate manpages
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>
8 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

8 years agoupdate lxc-attach manpage
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>
8 years agochange version to 2.0.0.rc2 in configure.ac
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>
8 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()

8 years agolxc-attach: add comment, & implement login_tty()
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>
8 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)

8 years agodoc: Add Japanese description of cgns apparmor profile in lxc.container.conf(5)
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>
8 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

8 years agoupdate tests to recognize cgns profile
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>
8 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>
8 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>
8 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>
8 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>
8 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

8 years agofix android build
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>
8 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

8 years agomake lxc-attach use a pty
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>
8 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>
8 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>
8 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>
8 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>
8 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

8 years agoFix sshd template on systems with systemd
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>
8 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>
8 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

8 years agoFix typo in lxc manpage
Stéphane Graber [Sat, 20 Feb 2016 04:37:07 +0000 (23:37 -0500)]
Fix typo in lxc manpage

Reported-by: lintian
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #831 from hallyn/2016-02-19/cgfs
Stéphane Graber [Sat, 20 Feb 2016 03:13:36 +0000 (22:13 -0500)]
Merge pull request #831 from hallyn/2016-02-19/cgfs

2016 02 19/cgfs

8 years agolxc: cgfs: handle lxcfs
Ubuntu [Sat, 20 Feb 2016 02:25:55 +0000 (02:25 +0000)]
lxc: cgfs: handle lxcfs

When containers have lxcfs mounted instead of cgroupfs, we have to
process /proc/self/mountinfo a bit differently.  In particular, we
should look for fuse.lxcfs fstype, we need to look elsewhere for the
list of comounted controllers, and the mount_prefix is not a cgroup path
which was bind mounted, so we should ignore it, and named subsystems
show up without the 'name=' prefix.

With this patchset I can start containers inside a privileged lxd
container with lxcfs mounted (i.e. without cgroup namespaces).

Closes #830

Signed-off-by: Ubuntu <ubuntu@localhost.localdomain>
8 years agocgfs: also check for EACCES when writing devices
Serge Hallyn [Sat, 20 Feb 2016 02:43:50 +0000 (18:43 -0800)]
cgfs: also check for EACCES when writing devices

Because that's what lxcfs gives us.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #829 from hallyn/2016-02-19/devices
Stéphane Graber [Fri, 19 Feb 2016 23:25:02 +0000 (18:25 -0500)]
Merge pull request #829 from hallyn/2016-02-19/devices

cgroups: do not fail if setting devices cgroup fails due to EPERM

8 years agocgroups: do not fail if setting devices cgroup fails due to EPERM
Serge Hallyn [Fri, 19 Feb 2016 22:12:47 +0000 (14:12 -0800)]
cgroups: do not fail if setting devices cgroup fails due to EPERM

If we're trying to allow a device which was denied to our parent
container, just continue.

Cgmanager does not help us to distinguish between eperm and other
errors, so just always continue.

We may want to consider actually computing the range of devices
to which the container monitor has access, but OTOH that introduces
a whole new set of complexity to compute access sets.

Closes #827

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #826 from brauner/2016-02-19/exec_cast_null
Serge Hallyn [Fri, 19 Feb 2016 19:00:59 +0000 (11:00 -0800)]
Merge pull request #826 from brauner/2016-02-19/exec_cast_null

cast NULL pointers passed to execl*()

8 years agocast NULL pointers passed to execl*()
Christian Brauner [Fri, 19 Feb 2016 11:44:40 +0000 (12:44 +0100)]
cast NULL pointers passed to execl*()

NULL pointers passed to execl*() functions must be cast to (char *)NULL since
they are variadic functions.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agochange version to 2.0.0.rc1 in configure.ac
Stéphane Graber [Thu, 18 Feb 2016 17:20:43 +0000 (12:20 -0500)]
change version to 2.0.0.rc1 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #823 from stgraber/master
Christian Brauner [Tue, 16 Feb 2016 07:01:25 +0000 (08:01 +0100)]
Merge pull request #823 from stgraber/master

Fix doc build warnings

8 years agoFix doc build warnings
Stéphane Graber [Tue, 16 Feb 2016 06:16:33 +0000 (01:16 -0500)]
Fix doc build warnings

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #822 from stgraber/master
Serge Hallyn [Tue, 16 Feb 2016 02:49:22 +0000 (18:49 -0800)]
Merge pull request #822 from stgraber/master

Couple of apparmor tweaks

8 years agoAllow cgroupfs remount by systemd
Stéphane Graber [Tue, 16 Feb 2016 01:08:09 +0000 (20:08 -0500)]
Allow cgroupfs remount by systemd

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoAllow sysfs remount by mountall
Stéphane Graber [Tue, 16 Feb 2016 01:03:50 +0000 (20:03 -0500)]
Allow sysfs remount by mountall

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #821 from hallyn/2016-02-15/lognull
Christian Brauner [Mon, 15 Feb 2016 20:38:00 +0000 (21:38 +0100)]
Merge pull request #821 from hallyn/2016-02-15/lognull

2016 02 15/lognull

8 years agolog.c:__lxc_log_set_file: completely close log file when overriding
Serge Hallyn [Mon, 15 Feb 2016 20:18:18 +0000 (12:18 -0800)]
log.c:__lxc_log_set_file: completely close log file when overriding

Otherwise after a shortcut on error we could end up trying to write
to the closed log fd.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agolog.c:__lxc_log_set_file: fname cannot be null
Serge Hallyn [Mon, 15 Feb 2016 20:15:10 +0000 (12:15 -0800)]
log.c:__lxc_log_set_file: fname cannot be null

fname cannot be passed in as NULL by any of its current callers.  If it
could, then build_dir() would crash as it doesn't check for it.  So make
sure we are warned if in the future we pass in NULL.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #813 from brauner/2016-02-01/lxc_destroy_ephemeral
Serge Hallyn [Wed, 10 Feb 2016 18:34:49 +0000 (10:34 -0800)]
Merge pull request #813 from brauner/2016-02-01/lxc_destroy_ephemeral

lxc-destroy: deal with ephemeral containers

8 years agolxc-destroy: deal with ephemeral containers
Christian Brauner [Wed, 10 Feb 2016 01:32:37 +0000 (02:32 +0100)]
lxc-destroy: deal with ephemeral containers

- Ephemeral containers are destroyed on shutdown so we do not destroy them.
- Destroy ephemeral containers with clones: first destroy all the clones, then
  destroy the container.
- Ephemeral containers with snapshots cannot be easily handled but we can
  probably trust that no one will try to make snapshots of an ephemeral
  container.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #812 from brauner/2016-02-10/quiet_lxc_copy
Serge Hallyn [Wed, 10 Feb 2016 01:00:42 +0000 (17:00 -0800)]
Merge pull request #812 from brauner/2016-02-10/quiet_lxc_copy

silence lxc-copy as well when asked

8 years agosilence lxc-copy as well when asked
Christian Brauner [Wed, 10 Feb 2016 00:22:15 +0000 (01:22 +0100)]
silence lxc-copy as well when asked

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #811 from hallyn/2016-02-09/destroyquiet
Christian Brauner [Wed, 10 Feb 2016 00:25:04 +0000 (01:25 +0100)]
Merge pull request #811 from hallyn/2016-02-09/destroyquiet

lxc_destroy: be quiet if asked

8 years agolxc_destroy: be quiet if asked
Serge Hallyn [Wed, 10 Feb 2016 00:07:32 +0000 (16:07 -0800)]
lxc_destroy: be quiet if asked

As per https://bugs.launchpad.net/bugs/1543016.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #808 from hallyn/2016-02-07/aa.2
Christian Brauner [Mon, 8 Feb 2016 21:27:05 +0000 (22:27 +0100)]
Merge pull request #808 from hallyn/2016-02-07/aa.2

apparmor: don't fail if current aa label is given

8 years agoapparmor: don't fail if current aa label is given
Serge Hallyn [Mon, 8 Feb 2016 07:06:10 +0000 (23:06 -0800)]
apparmor: don't fail if current aa label is given

Ideally a container configuration will specify 'unchanged' if
it wants the container to use the current (parent) profile.  But
lxd passes its current label.  Support that too.

Note that if/when stackable profiles exist, this behavior may
or may not be what we want.  But the code to deal with aa
stacking will need some changes anyway so this is ok.

With this patch, I can create nested containers inside a
lxd xenial container both using

lxc launch x2

and unprivileged

lxc-start -n x2

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #805 from benaryorg/patch-1
Stéphane Graber [Fri, 5 Feb 2016 20:49:13 +0000 (21:49 +0100)]
Merge pull request #805 from benaryorg/patch-1

fix typo

8 years agofix typo
Katze [Fri, 5 Feb 2016 17:53:59 +0000 (18:53 +0100)]
fix typo

Signed-off-by: benaryorg <binary@benary.org>
8 years agoMerge pull request #801 from brauner/2016-02-03/automatic_overlay_for_containers_with...
Serge Hallyn [Thu, 4 Feb 2016 17:41:31 +0000 (09:41 -0800)]
Merge pull request #801 from brauner/2016-02-03/automatic_overlay_for_containers_without_rootfs

allow overlay lxc.mount.entry with no rootfs

8 years agoallow overlay lxc.mount.entry with no rootfs
Christian Brauner [Wed, 3 Feb 2016 19:07:57 +0000 (20:07 +0100)]
allow overlay lxc.mount.entry with no rootfs

Allow lxc.mount.entry entries for containers without a rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #798 from hallyn/2016-02-02/commentrootfs
Christian Brauner [Thu, 4 Feb 2016 08:20:53 +0000 (08:20 +0000)]
Merge pull request #798 from hallyn/2016-02-02/commentrootfs

Comment the lxc_rootfs structure

8 years agoComment the lxc_rootfs structure
Serge Hallyn [Wed, 3 Feb 2016 03:20:05 +0000 (19:20 -0800)]
Comment the lxc_rootfs structure

Comment rootfs.path and rootfs.mount so people can better figure
out which to use.

Remove the unused pivotdir argument from setup_rootfs_pivot_root().
Remove the unused pivot member of the lxc_rootfs struct.  And just
return 0 (success) when someone passes a lxc.pivotdir entry.  One
day we'll turn that into an error, but not yet...

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #803 from tych0/add-fuse-kernel-config-check
Stéphane Graber [Thu, 4 Feb 2016 00:10:44 +0000 (01:10 +0100)]
Merge pull request #803 from tych0/add-fuse-kernel-config-check

lxc-checkconfig: warn about fuse as well

8 years agolxc-checkconfig: warn about fuse as well
Tycho Andersen [Wed, 3 Feb 2016 19:30:03 +0000 (12:30 -0700)]
lxc-checkconfig: warn about fuse as well

Since we need fuse to run lxcfs, which is required by systemd, let's warn
about that as well.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoMerge pull request #800 from brauner/2016-02-03/no_rootfs_implies_abspath
Serge Hallyn [Wed, 3 Feb 2016 17:49:19 +0000 (09:49 -0800)]
Merge pull request #800 from brauner/2016-02-03/no_rootfs_implies_abspath

no rootfs => mounts always relative to host's /

8 years agono rootfs => mounts are always relative to hosts /
Christian Brauner [Wed, 3 Feb 2016 12:17:51 +0000 (13:17 +0100)]
no rootfs => mounts are always relative to hosts /

All lxc.mount.entry entries will be relative to the hosts / when a container
does not specify a lxc.rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #799 from brauner/2016-02-03/aufs_mkdir_to_lxcaufs
Serge Hallyn [Wed, 3 Feb 2016 17:42:36 +0000 (09:42 -0800)]
Merge pull request #799 from brauner/2016-02-03/aufs_mkdir_to_lxcaufs

move and rename mount_entry_create_aufs_dirs()

8 years agomove and rename mount_entry_create_aufs_dirs()
Christian Brauner [Tue, 2 Feb 2016 23:41:14 +0000 (00:41 +0100)]
move and rename mount_entry_create_aufs_dirs()

- The function mount_entry_create_aufs_dirs() moves from conf.c to
  lxcaufs.{c,h} where it belongs.
- In accordance with the "aufs_" prefix naming scheme for functions associated
  with lxcaufs.{c,h} mount_entry_create_aufs_dirs() becomes aufs_mkdir().
- Add aufs_get_rootfs() which returns the rootfs for an aufs lxc.rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #797 from brauner/2016-02-02/fix_execute_null_ptr_deref
Serge Hallyn [Wed, 3 Feb 2016 04:32:26 +0000 (20:32 -0800)]
Merge pull request #797 from brauner/2016-02-02/fix_execute_null_ptr_deref

Fix mount_entry_on_generic()

8 years agoFix mount_entry_on_generic()
Christian Brauner [Tue, 2 Feb 2016 21:13:07 +0000 (22:13 +0100)]
Fix mount_entry_on_generic()

In mount_entry_on_generic() we dereferenced a NULL pointer whenever a container
without a rootfs was created. (Since mount_entry_on_systemfs() passes them with
NULL.) We have mount_entry_on_generic() check whether rootfs != NULL.

We also check whether rootfs != NULL in the functions ovl_mkdir() and
mount_entry_create_aufs_dirs() and bail immediately. Rationale: For overlay and
aufs lxc.mount.entry entries users give us absolute paths to e.g. workdir and
upperdir which we create for them. We currently use rootfs->path and the
lxcpath for the container to check that users give us a sane path to create
those directories under and refuse if they do not. If we want to allow overlay
mounts for containers without a rootfs they can easily be reworked.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #796 from brauner/2016-02-02/fix_execute_null_ptr_deref
Stéphane Graber [Tue, 2 Feb 2016 14:20:27 +0000 (15:20 +0100)]
Merge pull request #796 from brauner/2016-02-02/fix_execute_null_ptr_deref

Fix NULL-ptr derefs for container without rootfs

8 years agoFix NULL-ptr derefs for container without rootfs
Christian Brauner [Tue, 2 Feb 2016 13:43:33 +0000 (14:43 +0100)]
Fix NULL-ptr derefs for container without rootfs

Since we allow containers to be created without a rootfs most checks in conf.c
are not sane anymore. Instead of just checking if rootfs->path != NULL we need
to check whether rootfs != NULL.

Minor fixes:
- Have mount_autodev() always return -1 on failure: mount_autodev() returns 0
  on success and -1 on failure. But when the return value of safe_mount() was
  checked in mount_autodev() we returned false (instead of -1) which caused
  mount_autodev() to return 0 (success) instead of the correct -1 (failure).

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #795 from brauner/2016-02-02/lxc_ls_exit_zero
Stéphane Graber [Tue, 2 Feb 2016 12:21:11 +0000 (13:21 +0100)]
Merge pull request #795 from brauner/2016-02-02/lxc_ls_exit_zero

lxc-ls: exit 0 when path is not found

8 years agolxc-ls: exit 0 when path is not found
Christian Brauner [Tue, 2 Feb 2016 11:06:29 +0000 (12:06 +0100)]
lxc-ls: exit 0 when path is not found

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #793 from stgraber/master
Christian Brauner [Tue, 2 Feb 2016 11:45:30 +0000 (11:45 +0000)]
Merge pull request #793 from stgraber/master

Remove legacy versions of lxc-ls

8 years agoFix typo
Stéphane Graber [Mon, 1 Feb 2016 16:57:00 +0000 (17:57 +0100)]
Fix typo

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoRemove legacy versions of lxc-ls
Stéphane Graber [Mon, 1 Feb 2016 16:37:24 +0000 (17:37 +0100)]
Remove legacy versions of lxc-ls

lxc-ls nowadays is a C binary so there's no need to keep the python and
shell versions around anymore, remove them from the branch and cleanup
documentation and Makefiles.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #794 from Blub/next
Christian Brauner [Tue, 2 Feb 2016 11:06:03 +0000 (11:06 +0000)]
Merge pull request #794 from Blub/next

apparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}

8 years agoapparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}
Wolfgang Bumiller [Tue, 2 Feb 2016 08:13:04 +0000 (09:13 +0100)]
apparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}

Some systems need to be able to bind-mount /run to /var/run
and /run/lock to /var/run/lock. (Tested with opensuse 13.1
containers migrated from openvz.)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agoMerge pull request #787 from ysbnim/master
Stéphane Graber [Mon, 1 Feb 2016 13:04:39 +0000 (14:04 +0100)]
Merge pull request #787 from ysbnim/master

Update Korean manpages

8 years agogitignore doc/ko/legacy/*.1
Sungbae Yoo [Mon, 1 Feb 2016 11:55:30 +0000 (20:55 +0900)]
gitignore doc/ko/legacy/*.1

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: update overlayfs and aufs in Japanese lxc.container.conf(5)
Sungbae Yoo [Mon, 1 Feb 2016 11:35:23 +0000 (20:35 +0900)]
doc: update overlayfs and aufs in Japanese lxc.container.conf(5)

add the description of multiple lower layer.
Update for commit 280d237

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: Add network clear option to Korean lxc.container.conf(5)
Sungbae Yoo [Mon, 1 Feb 2016 11:11:09 +0000 (20:11 +0900)]
doc: Add network clear option to Korean lxc.container.conf(5)

Update for commit 020104c

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: add clear behaviour of list options to Korean lxc.container.conf(5)
Sungbae Yoo [Mon, 1 Feb 2016 10:57:04 +0000 (19:57 +0900)]
doc: add clear behaviour of list options to Korean lxc.container.conf(5)

Update for commit ff68914

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agochange version to 2.0.0.beta2 in configure.ac
Stéphane Graber [Mon, 1 Feb 2016 11:09:20 +0000 (12:09 +0100)]
change version to 2.0.0.beta2 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #786 from brauner/2016-01-31/lxc_copy_fix
Stéphane Graber [Mon, 1 Feb 2016 10:40:04 +0000 (11:40 +0100)]
Merge pull request #786 from brauner/2016-01-31/lxc_copy_fix

lxc-copy: cleanup

8 years agoAlso move lxc-device in translated docs
Stéphane Graber [Mon, 1 Feb 2016 10:28:28 +0000 (11:28 +0100)]
Also move lxc-device in translated docs

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: always enable lxc-device.1
Wolfgang Bumiller [Mon, 1 Feb 2016 10:18:59 +0000 (11:18 +0100)]
doc: always enable lxc-device.1

Commit ea4679694 replaced the python implementation with a
C one.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolxc-copy: cleanup
Christian Brauner [Thu, 28 Jan 2016 15:02:01 +0000 (16:02 +0100)]
lxc-copy: cleanup

- make free_mnts() work directly on the globals mnt_table and mnt_table_size
- have free_mnts() set mnt_table = NULL and mnt_table_size = 0 when its done to
  avoid double frees
- simplify error-handling in do_clone_ephemeral()
- do_clone_ephemeral(): when chmod() falls to set permissions on the temporary
  folder we created for mkdtemp() remove the folder
- simplify error handling in main()

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agodoc: update overlayfs and aufs in Japanese lxc.container.conf(5)
KATOH Yasufumi [Mon, 1 Feb 2016 08:29:20 +0000 (17:29 +0900)]
doc: update overlayfs and aufs in Japanese lxc.container.conf(5)

add the description of multiple lower layer.
Update for commit 280d237

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: Adapt manpage for Japanese lxc-ls to new C implementation
KATOH Yasufumi [Mon, 1 Feb 2016 08:29:19 +0000 (17:29 +0900)]
doc: Adapt manpage for Japanese lxc-ls to new C implementation

Update for commit 37cf83e

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>