]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 years agorpm: added dependency to lxc-libs to lxc package
Johannes Kastl [Fri, 23 Jan 2015 18:28:10 +0000 (19:28 +0100)] 
rpm: added dependency to lxc-libs to lxc package

Ensures matching versions of lxc and lxc-libs being installed

Signed-off-by: Johannes Kastl <mail@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoBug #158: Deletion of unnecessary checks before a few calls of LXC functions
Markus Elfring [Sat, 24 Jan 2015 19:38:49 +0000 (20:38 +0100)] 
Bug #158: Deletion of unnecessary checks before a few calls of LXC functions

The following functions return immediately if a null pointer was passed.
* container_destroy
* lxc_cgroup_process_info_free_and_remove
* lxc_cgroup_put_meta
* toss_list

It is therefore not needed that a function caller repeats a corresponding check.

This issue was fixed by using the software Coccinelle 1.0.0-rc23.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoBug #158: Deletion of unnecessary checks before calls of the function "free"
Markus Elfring [Sat, 24 Jan 2015 18:55:36 +0000 (19:55 +0100)] 
Bug #158: Deletion of unnecessary checks before calls of the function "free"

The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software Coccinelle 1.0.0-rc23.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-start-ephemeral: fix pep-8 and pyflakes3
Stéphane Graber [Thu, 22 Jan 2015 16:54:46 +0000 (11:54 -0500)] 
lxc-start-ephemeral: fix pep-8 and pyflakes3

This defines a missing variable and re-indents the code a bit.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoyet another problem with new overlay fs
Serge Hallyn [Mon, 19 Jan 2015 05:06:55 +0000 (05:06 +0000)] 
yet another problem with new overlay fs

It turns out that the new upstream overlay fs requires that the delta
and work dirs be under the same mount.  So create a $lxcpath/tmpfs
and create delta0 and work0 under that.  If the user asks for a
tmpfs that'll be mounted under $lxcpath/tmpfs and workdir and delta0
both created under that.

This isn't heavily tested.  But if fixes mounting of 'overlay' fs
for me.

It's "not backward compatible", since it moves delta0, but that
shouldn't matter since ephemeral containers are either destroyed
on exit, or re-started with lxc-start.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-start-ephemeral: handle the overlayfs workdir option (v2)
Serge Hallyn [Tue, 13 Jan 2015 00:08:37 +0000 (00:08 +0000)] 
lxc-start-ephemeral: handle the overlayfs workdir option (v2)

We fixed this some time ago for basic lxc-start, but never did
lxc-start-ephemeral.

Since the lxc-start patches were pushed, Miklos has given us a
way to detect whether we need the workdir= option.  So the
bdev.c code could be simplified to check for "overlay\n" in
/proc/filesystems just as lxc-start-ephemeral does.  This
patch doesn't do that.

Changelog (v2):
1. use 'overlay' fstype for new overlay upstream module
2. avoid using unneeded readlines().

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAlternative test for dpkg multiarch support in lxc-debian template
David Noyes [Fri, 28 Aug 2015 14:44:25 +0000 (14:44 +0000)] 
Alternative test for dpkg multiarch support in lxc-debian template

Signed-off-by: David Noyes <david.j.noyes@gmail.com>
9 years agoTest dpkg for multiarch support in lxc-debian template
David Noyes [Wed, 26 Aug 2015 13:18:49 +0000 (14:18 +0100)] 
Test dpkg for multiarch support in lxc-debian template

Signed-off-by: David Noyes <david.j.noyes@gmail.com>
9 years agoFix container creation without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:39 +0000 (10:57 -0400)] 
Fix container creation without a rootfs

It is not an error to create a container without a template or rootfs.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoWhen creating container, save configuration if rootfs already exists
David Ward [Tue, 23 Jun 2015 14:57:38 +0000 (10:57 -0400)] 
When creating container, save configuration if rootfs already exists

Commit 6c6892b "fix multithreaded create()" prevented the container
configuration from being saved if the backing store does not need
to be created.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoAllow autodev without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:37 +0000 (10:57 -0400)] 
Allow autodev without a rootfs

A container without a rootfs is useful for running a collection of
processes in separate namespaces (to provide separate networking as
an example), while sharing the host filesystem (except for specific
paths that are re-mounted as needed). For multiple processes to run
automatically when such a container is started, it can be launched
using lxc-start, and a separate instance of systemd can manage just
the processes inside the container. (This assumes that the path to
the systemd unit files is re-mounted and only contains the services
that should run inside the container.) For this use case, autodev
should be permitted for a container that does not have a rootfs.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix automatic mounts without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:36 +0000 (10:57 -0400)] 
Fix automatic mounts without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix /dev symlinks without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:35 +0000 (10:57 -0400)] 
Fix /dev symlinks without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix verification of start hook without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:34 +0000 (10:57 -0400)] 
Fix verification of start hook without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoOnly mount /proc if needed, even without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:33 +0000 (10:57 -0400)] 
Only mount /proc if needed, even without a rootfs

Use the same code with and without a rootfs to check if mounting
/proc is necessary before doing so. If mounting it is unsuccessful
and there is no rootfs, continue as before.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-debian: support stretch (Debian 9) images
Antonio Terceiro [Wed, 19 Aug 2015 20:14:13 +0000 (22:14 +0200)] 
lxc-debian: support stretch (Debian 9) images

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoAdd doc for optional, create=dir and create=file in lxc.container.conf man
Nicolas Cornu [Wed, 5 Aug 2015 18:17:48 +0000 (20:17 +0200)] 
Add doc for optional, create=dir and create=file in lxc.container.conf man

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agocheck for NULL pointers before calling setenv()
Robert Schiele [Fri, 21 Aug 2015 05:35:34 +0000 (07:35 +0200)] 
check for NULL pointers before calling setenv()

Latest glibc release actually honours calling setenv with a NULL
pointer by causing SIGSEGV but checking pointers before submitting
to any system function is a good idea anyway.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
9 years agoAdd long option for -P in documentation
Nicolas Cornu [Fri, 14 Aug 2015 15:57:53 +0000 (17:57 +0200)] 
Add long option for -P in documentation

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agolxc-debian: skip security updates for unstable/sid
Antonio Terceiro [Sat, 18 Jul 2015 23:24:12 +0000 (20:24 -0300)] 
lxc-debian: skip security updates for unstable/sid

There is no such thing as security support for unstable/sid.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agogitignore: add TAGS files
Tycho Andersen [Mon, 10 Aug 2015 17:12:17 +0000 (11:12 -0600)] 
gitignore: add TAGS files

Somehow our `make tags` target generates TAGS and not tags, so let's ignore
that too.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc_monitor: free @preg on error
Arjun Sreedharan [Sun, 12 Jul 2015 12:46:17 +0000 (18:16 +0530)] 
lxc_monitor: free @preg on error

reuse label cleanup since free(NULL) is a no-op
Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoPrevent from error on umount /proc if userns are used.
Przemek Rudy [Wed, 29 Jul 2015 17:41:28 +0000 (19:41 +0200)] 
Prevent from error on umount /proc if userns are used.

Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoCaps are getting lost when cloning an LXC. Adding the -X parameter copies the extende...
Robert LeBlanc [Thu, 13 Aug 2015 19:36:55 +0000 (13:36 -0600)] 
Caps are getting lost when cloning an LXC. Adding the -X parameter copies the extended attributes. This allows things like ping to continue to be used by a non-privilged user in Debian at least.

9 years agoFresh CONTRIBUTING
Nicolas Cornu [Wed, 5 Aug 2015 18:27:31 +0000 (20:27 +0200)] 
Fresh CONTRIBUTING

Signed-off-by: Nicolas Cornu <nicolac76@yahoo.fr>
9 years agotemplates: lxc-opensuse, use rpm to determine build version
Jiri Slaby [Wed, 5 Aug 2015 08:32:54 +0000 (10:32 +0200)] 
templates: lxc-opensuse, use rpm to determine build version

zypper info's output is not usable for several reasons:
* it is localized -- there is no "Version: " in my output
* it shows results both from the repo and local system

So use plain rpm to determine whether build is installed and if proper
version is in place.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
9 years agoFix error message when cannot find an lxc-init
Nicolas Cornu [Wed, 5 Aug 2015 07:22:24 +0000 (09:22 +0200)] 
Fix error message when cannot find an lxc-init

lxc-init has been renamed init.lxc so adapt error message

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agolxc-alpine: fix verification of apk.static binary
Natanael Copa [Mon, 3 Aug 2015 11:40:25 +0000 (13:40 +0200)] 
lxc-alpine: fix verification of apk.static binary

We need specify which hashing algorithm was used to create the signature
we check.

Fixes #609

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Remove unnecessary common options from lxc-user-nic(1)
KATOH Yasufumi [Mon, 3 Aug 2015 07:42:38 +0000 (16:42 +0900)] 
doc: Remove unnecessary common options from lxc-user-nic(1)

lxc-user-nic command cannot use common options.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Add the description for --version to English and Japanese common_options
KATOH Yasufumi [Mon, 3 Aug 2015 07:40:13 +0000 (16:40 +0900)] 
doc: Add the description for --version to English and Japanese common_options

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Add the description for -P and --version to English and Japanese lxc-ls(1)
KATOH Yasufumi [Mon, 3 Aug 2015 07:23:45 +0000 (16:23 +0900)] 
doc: Add the description for -P and --version to English and Japanese lxc-ls(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoAdd -P lxcpath and --version to lxc-ls manpage
Christian Brauner [Sat, 1 Aug 2015 14:54:30 +0000 (16:54 +0200)] 
Add -P lxcpath and --version to lxc-ls manpage

lxc-ls takes -P lxcpath and --version as arguments but it did not specify these
options on the manpages.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoseccomp: simplify and fix rule parsing
Wolfgang Bumiller [Thu, 23 Jul 2015 09:10:18 +0000 (11:10 +0200)] 
seccomp: simplify and fix rule parsing

1) Two checks on amd64 for whether compat_ctx has already
been generated were redundant, as compat_ctx is generally
generated before entering the parsing loop.

2) With introduction of reject_force_umount the check for
whether the syscall has the same id on both native and
compat archs results in false behavior as this is an
internal keyword and thus produces a -1 on
seccomp_syscall_resolve_name_arch().
The result was that it was added to the native architecture
twice and never to the 32 bit architecture, causing it to
have no effect on 32 bit containers on 64 bit hosts.

3) I do not see a reason to care about whether the syscalls
have the same number on the two architectures. On the one
hand this check was there to avoid adding it to two archs
(and effectively leaving one arch unprotected), while on
the other hand it seemed to be okay to add it to the
same arch *twice*.

The entire architecture checking branches are now reduced to
three simple cases: 'native', 'non-native' and 'all'. With
'all' adding to both architectures regardless of the syscall
ID.

Also note that libseccomp had a bug in its architecture
checking, so architecture related filters weren't working as
expected before version 2.2.2, which may have contributed to
the confusion in the original architecture-related code.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 years agoFix Android build due to missing constant
Stéphane Graber [Wed, 22 Jul 2015 15:55:46 +0000 (11:55 -0400)] 
Fix Android build due to missing constant

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-fedora: Default to 22 but use 20 squashfs
Stéphane Graber [Sun, 19 Jul 2015 03:42:00 +0000 (23:42 -0400)] 
lxc-fedora: Default to 22 but use 20 squashfs

The Fedora 22 squashfs doesn't appear to work, the Fedora 21 isn't
available, so lets use the fedora archive mirror and pull the good old
Fedora 20 squashfs.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoDefault to Fedora 21 as 22 no longer uses yum
Stéphane Graber [Sun, 19 Jul 2015 03:30:46 +0000 (23:30 -0400)] 
Default to Fedora 21 as 22 no longer uses yum

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix fedora some more
Stéphane Graber [Sun, 19 Jul 2015 03:18:34 +0000 (23:18 -0400)] 
Fix fedora some more

Apparently the paths have changed on the rsync server.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFedora 20 no longer exists on the mirrors
Stéphane Graber [Sun, 19 Jul 2015 03:01:24 +0000 (23:01 -0400)] 
Fedora 20 no longer exists on the mirrors

Switch to Fedora 22 for now.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUse /dev/loop-control if it exists
Wolfgang Bumiller [Fri, 3 Jul 2015 12:10:17 +0000 (14:10 +0200)] 
Use /dev/loop-control if it exists

Loop devices can be added on the fly when needed, they're
not always created beforehand. The loop-control device can
be used to find and allocate the next available number
instead of going through the /dev directory contents (which
is now only a fallback mechanism).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 years agodebian template: reconfigure locales
有张纸 [Wed, 1 Jul 2015 15:39:08 +0000 (23:39 +0800)] 
debian template: reconfigure locales

Signed-off-by: feng xiahou <xiahoufeng@yahoo.com>
9 years agoSupport unprivileged ephemeral container using aufs
KATOH Yasufumi [Thu, 25 Jun 2015 09:14:04 +0000 (18:14 +0900)] 
Support unprivileged ephemeral container using aufs

As the commit 31a882e, an unprivileged container can use aufs.
This patch removes the check for unpriv aufs, and change the path of
xino file as an unprivileged user can mount aufs.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years ago debootstrap failed when $GREP_OPTIONS is set
有张纸 [Tue, 30 Jun 2015 08:23:11 +0000 (16:23 +0800)] 
 debootstrap failed when $GREP_OPTIONS is set

 debootstrap failed when $GREP_OPTIONS is set, so we need to unset it in the template

Signed-off-by: <feng xiahou xiahoufeng@yahoo.com>
9 years agolxc_monitor: fix memory leak on @fds and close fds
Arjun Sreedharan [Wed, 10 Jun 2015 18:24:15 +0000 (23:54 +0530)] 
lxc_monitor: fix memory leak on @fds and close fds

also label and consolidate error conditions for
better readability

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agouse `hostname` for DHCP_HOSTNAME in ifcfg-eth0
Lenz Grimmer [Fri, 12 Jun 2015 23:08:41 +0000 (01:08 +0200)] 
use `hostname` for DHCP_HOSTNAME in ifcfg-eth0

Updated centos/fedora/oracle templates to use `hostname` for DHCP_HOSTNAME in
/etc/sysconfig/network/ifcfg-eth0, so the container's host name is propagated
to the host's DHCP server (e.g. dnsmasq, which also acts as the DNS server).
This resolves lxc/lxd#756

Signed-off-by: Lenz Grimmer <lenz@grimmer.com>
9 years agodoc: Translate untranslated section titles in Japanese man pages
Sungbae Yoo [Fri, 12 Jun 2015 01:27:28 +0000 (10:27 +0900)] 
doc: Translate untranslated section titles in Japanese man pages

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agomove utils.h #endif to end of file
Tycho Andersen [Tue, 9 Jun 2015 01:59:53 +0000 (19:59 -0600)] 
move utils.h #endif to end of file

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoconfig: miscellaneous signals for lxc.*signal
Sungbae Yoo [Wed, 27 May 2015 05:51:55 +0000 (14:51 +0900)] 
config: miscellaneous signals for lxc.*signal

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agofix build on mpc85xx
Daniel Golle [Tue, 9 Jun 2015 10:58:12 +0000 (12:58 +0200)] 
fix build on mpc85xx

Initialize ret to 0 so compiler no longer complains about
monitor.c: In function 'lxc_monitor_open':
monitor.c:212:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

https://github.com/openwrt/packages/issues/1356

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 years agocoverity: fix use-after-free in cgmanager.
Serge Hallyn [Mon, 8 Jun 2015 15:33:22 +0000 (10:33 -0500)] 
coverity: fix use-after-free in cgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix bdev.h
Stéphane Graber [Thu, 4 Jun 2015 01:45:23 +0000 (21:45 -0400)] 
Fix bdev.h

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRevert bdev.h to the way it was
Stéphane Graber [Wed, 3 Jun 2015 23:37:59 +0000 (19:37 -0400)] 
Revert bdev.h to the way it was

Instead of re-defining MS_ options all over the place, just revert the
last change to bdev.h so we have all the defines in there again.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoDefine MS_RELATIME for Android
Stéphane Graber [Wed, 3 Jun 2015 21:08:11 +0000 (17:08 -0400)] 
Define MS_RELATIME for Android

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoDefine MS_REC and MS_SLAVE for Android in bdev.c
Stéphane Graber [Wed, 3 Jun 2015 19:07:08 +0000 (15:07 -0400)] 
Define MS_REC and MS_SLAVE for Android in bdev.c

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agocgmanager: attach: never use 'all' controller
Serge Hallyn [Wed, 27 May 2015 10:05:16 +0000 (10:05 +0000)] 
cgmanager: attach: never use 'all' controller

We were using 'all' controller if current was in all the
same cgroup.  That doesn't suffice.  We'd have to check
the target.  At that point we may as well just attach
controller by controller.

An optimization to consider is to check the /proc/initpid/cgroup
for all identical controllers.  Let's start by just getting it
right.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoThe yum in Centos 5.11 does not know about '--releasever', which is used by: lxc...
Dwight Schauer [Tue, 2 Jun 2015 04:41:09 +0000 (23:41 -0500)] 
The yum in Centos 5.11 does not know about '--releasever', which is used by: lxc-create ... -- release=VERSION
The release version only needs to be set in the outer bootstrap, not the inner one.
With this change an lxc-create bootstrap of CentOS 5.11 completes enough to be usable.
CentOS 5.11 containers can be created, started, stopped, and networking works.
Signed-off-by: Dwight Schauer <das@teegra.net>
9 years agoaufs: Support unprivileged clone, mount
KATOH Yasufumi [Thu, 21 May 2015 08:36:49 +0000 (17:36 +0900)] 
aufs: Support unprivileged clone, mount

Current aufs supports FS_USERNS_MOUNT by using allow_userns module
parameter. It allows root in userns to mount aufs.

This patch allows an unprivileged container to use aufs. The value of
xino option is changed to /dev/shm/aufs.xino that an unpriv user can
write.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Update the description of -L option in lxc-autostart(1)
KATOH Yasufumi [Wed, 13 May 2015 06:19:17 +0000 (15:19 +0900)] 
doc: Update the description of -L option in lxc-autostart(1)

Add the description about displaying the value of wait delays for -L
option

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Fix the mistranslation about lxc.group in Japanese lxc.container.conf(5)
KATOH Yasufumi [Wed, 13 May 2015 06:19:16 +0000 (15:19 +0900)] 
doc: Fix the mistranslation about lxc.group in Japanese lxc.container.conf(5)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoenable cgmanager support for Travis CI
S.Çağlar Onur [Tue, 12 May 2015 18:30:33 +0000 (14:30 -0400)] 
enable cgmanager support for Travis CI

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUse 'cgm listcontrollers' list rather than /proc/self/cgroups
Serge Hallyn [Fri, 1 May 2015 21:11:28 +0000 (21:11 +0000)] 
Use 'cgm listcontrollers' list rather than /proc/self/cgroups

to populate the list of subsystems to use.

Cgmanager can be started with some subsystems disabled (i.e.
cgmanager -M cpuset).  If lxc using cgmanager then uses the
/proc/self/cgroup output to determine which controllers to use,
it will fail when trying to do things to cpuset.  Instead, ask
cgmanager which controllers to use.

This still defers (per patch 1/1) to the lxc.cgroup.use values.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agomake cgmanager follow lxc.cgroup.use
Serge Hallyn [Fri, 1 May 2015 15:09:41 +0000 (15:09 +0000)] 
make cgmanager follow lxc.cgroup.use

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUpdate lxc-debian.in
有张纸 [Fri, 22 May 2015 13:26:35 +0000 (21:26 +0800)] 
Update lxc-debian.in

fix "bash: warning: setlocale: LC_ALL: cannot change locale"

Signed-off-by: <feng xiahou xiahoufeng@yahoo.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoChange lxc-clone to use 'rsync -aH' instead of just 'rsync -a' for cloning to fix...
Erik B. Andersen [Fri, 15 May 2015 04:39:57 +0000 (21:39 -0700)] 
Change lxc-clone to use 'rsync -aH' instead of just 'rsync -a' for cloning to fix Launchpad Bug #1441307.

Signed-off-by: Erik B. Andersen <erik.b.andersen@gmail.com>
9 years agoUse POSIX-compliant function names in bash completion
Lucas Werkmeister [Thu, 14 May 2015 20:12:52 +0000 (22:12 +0200)] 
Use POSIX-compliant function names in bash completion

When running in posix mode (for example, because it was invoked as `sh`,
or with the --posix option), bash rejects the function names previously
used because they contain hyphens, which are not legal POSIX names, and
exits immediately.

This is a particularly serious problem on a system in which the
following three conditions hold:

1. The `sh` executable is provided by bash, e. g. via a symlink
2. Gnome Display Manager is used to launch X sessions
3. Bash completion is loaded in the (system or user) profile file
   instead of in the bashrc file

In that case, GDM's Xsession script (run with `sh`, i. e., bash in posix
mode) sources the profile files, thus causing the shell to load the bash
completion files. Upon encountering the non-POSIX-compliant function
names, bash would then exit, immediately ending the X session.

Fixes #521.

Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
9 years agolxc-debian.in: Fixed errors if dbus is not installed
Cyril Bitterich [Sat, 9 May 2015 19:57:14 +0000 (21:57 +0200)] 
lxc-debian.in: Fixed errors if dbus is not installed

The lxc-debian template debootstraps a minimum debian system which does not contain dbus.
If systemd is used this will result in getty-static.service to be used instead of getty@ .
The systemd default files uses 6 tty's instead of the 4 the script creates.
This will lead to repeated error messages in the systemd journal.

Signed-off-by: Cyril Bitterich <Cyril.Bitterich@1und1.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoadded doc/api/doxygen_sqlite3.db to .gitignore
Karl-Philipp Richter [Mon, 11 May 2015 19:59:19 +0000 (21:59 +0200)] 
added doc/api/doxygen_sqlite3.db to .gitignore

Signed-off-by: Karl-Philipp Richter <krichter722@aol.de>
9 years agoCall /lib/apparmor/profile-load directly instead of the wrapper
Martin Pitt [Thu, 7 May 2015 11:38:50 +0000 (13:38 +0200)] 
Call /lib/apparmor/profile-load directly instead of the wrapper

AppArmor ships /lib/apparmor/profile-load. /lib/init/apparmor-profile-load is
merely a wrapper which calls the former, so just call it directly to avoid the
dependency on the wrapper.

LP: #1432683

9 years agooverlay: create workdir if it doesn't exist
Serge Hallyn [Fri, 1 May 2015 12:56:33 +0000 (14:56 +0200)] 
overlay: create workdir if it doesn't exist

Otherwise a container created before we needed workdir will fail
to start after a kernel+lxc update.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoFix Lua 5.3 compatibility code.
Thomas Moschny [Sun, 26 Apr 2015 21:25:59 +0000 (23:25 +0200)] 
Fix Lua 5.3 compatibility code.

If Lua 5.3 is compiled with LUA_COMPAT_5_2 defined, the
luaL_checkunsigned compatibility macro is already defined
in lauxlib.h.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
9 years agoadded build and test results to .gitignore
Karl-Philipp Richter [Sat, 25 Apr 2015 11:06:00 +0000 (13:06 +0200)] 
added build and test results to .gitignore

Signed-off-by: Karl-Philipp Richter <krichter722@aol.de>
9 years agoMake lxc-checkconfig work with kernel versions > 3
Christian Brauner [Sat, 25 Apr 2015 08:05:07 +0000 (10:05 +0200)] 
Make lxc-checkconfig work with kernel versions > 3

(1) Add test for kernel version greater 3.
(2) Use && and || instead of -a and -o as suggested in
    http://www.unix.com/man-page/posix/1p/test/.

lxc-checkconfig will currently report "missing" on "Cgroup memory controller"
for kernel versions greater 3. This happens because the script, before checking
for the corresponding memory variable in the kernel config, currently will test
whether we have a major kernel version greater- or equal to 3 and a minor kernel
version greater- or equal to 6. This adds an additional test whether we have a
major kernel version greater than 3.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agouse poll instead of select
Serge Hallyn [Tue, 21 Apr 2015 18:34:45 +0000 (13:34 -0500)] 
use poll instead of select

Particularly when using the go-lxc api with lots of threads, it
happens that if the open files limit is > 1024, we will try to
select on fd > 1024 which breaks on glibc.

So use poll instead of select.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRevert "lxc-cmd-stop: two fixes"
Serge Hallyn [Tue, 14 Apr 2015 19:56:51 +0000 (14:56 -0500)] 
Revert "lxc-cmd-stop: two fixes"

This breaks code that depended on the monitor being fully dead before
c->stop() returns.

This reverts commit 62e041610609c8913c3d397a521716819a91f850.

9 years agoRevert "do_lxcap_stop: wait until container is stopped"
Serge Hallyn [Tue, 14 Apr 2015 19:56:10 +0000 (14:56 -0500)] 
Revert "do_lxcap_stop: wait until container is stopped"

This breaks lxc-test-concurrent.

This reverts commit fef9aa89e99285609d51848623f84ecd3a3109df.

9 years agodo_lxcap_stop: wait until container is stopped
Serge Hallyn [Tue, 14 Apr 2015 14:28:20 +0000 (09:28 -0500)] 
do_lxcap_stop: wait until container is stopped

In the past, lxc-cmd-stop would wait until the command pipe was closed
before returning, ensuring that the container monitor had exited.
Now that we accept the actual success return value, lxcapi_stop can
return success before the monitor has fully exited.

So explicitly wait for the container to stop, when lxc-cmd-stop returned
success.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-fedora: manage secondary architectures
Laurent Vivier [Tue, 7 Apr 2015 19:17:37 +0000 (21:17 +0200)] 
lxc-fedora: manage secondary architectures

URL for packages and LiveOS differs from x86, x86_64 and ARM.

This patch allows to select the good mirror URL according to
the architecture.

Primary architecture: http://mirrors.kernel.org/fedora
Secondary architecture: http://mirrors.kernel.org/fedora-secondary

The managed secondary architectures are only ppc64 and s390x,
the secondary architectures for Fedora 20 (the base of initial bootstrap).

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-cmd-stop: two fixes
Serge Hallyn [Mon, 13 Apr 2015 21:19:47 +0000 (21:19 +0000)] 
lxc-cmd-stop: two fixes

These are two fixes for long, long-standing bugs.

1. When we stop a container from the lxc_cmd stop handler, we kill its
init task, then we unfreeze the container to make sure it receives the
signal.  When that unfreeze succeeds, we were immediately returning 0,
without sending a response to the invoker.

2. lxc_cmd returns the length of the field received.  In the case of
an lxc_cmd_stop this is 16.  But a comment claims we expect no response,
only a 0.  In fact the handler does send a response, which may or may
not include an error.  So don't call an error just because we got back a
response.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoadd vim swap files to .gitignore
Tycho Andersen [Thu, 9 Apr 2015 21:59:20 +0000 (21:59 +0000)] 
add vim swap files to .gitignore

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoupdate path of tty.conf
teruo-oshida [Fri, 27 Mar 2015 09:04:31 +0000 (18:04 +0900)] 
update path of tty.conf

$container_rootfs may not be used so 'sed' will try to patch
"/etc/init/tty.conf". It must not be correct.

Signed-off-by: Teruo Oshida <teruo.oshida@miraclelinux.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-test-apparmor: flush the pipe before exiting child
Serge Hallyn [Fri, 3 Apr 2015 23:40:49 +0000 (23:40 +0000)] 
lxc-test-apparmor: flush the pipe before exiting child

to make sure the parent's read returns.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAdd the use of 'attach' to lxc-start-ephemeral(1)
KATOH Yasufumi [Wed, 1 Apr 2015 16:56:03 +0000 (01:56 +0900)] 
Add the use of 'attach' to lxc-start-ephemeral(1)

Update for commit 8158c05

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Add '--storage-type' option to lxc-start-ephemeral(1)
KATOH Yasufumi [Fri, 27 Mar 2015 09:32:05 +0000 (18:32 +0900)] 
doc: Add '--storage-type' option to lxc-start-ephemeral(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoconcurrent: check realloc() rc and exit on failure
Arjun Sreedharan [Wed, 1 Apr 2015 19:06:48 +0000 (00:36 +0530)] 
concurrent: check realloc() rc and exit on failure

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agocgmanager: free line at end of check_supports_multiple_controllers
Serge Hallyn [Wed, 18 Mar 2015 00:02:19 +0000 (19:02 -0500)] 
cgmanager: free line at end of check_supports_multiple_controllers

This is only called at startup so it wasn't a big leak, but it is a leak.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agocgmanager: put unprivileged containers under $(curcgroup)/lxc/$(container0
Serge Hallyn [Wed, 18 Mar 2015 00:02:18 +0000 (19:02 -0500)] 
cgmanager: put unprivileged containers under $(curcgroup)/lxc/$(container0

Currently if we are in /user.slice/user-1000.slice/session-c2.scope,
and we start an unprivileged container t1, it will be in cgroup
3:memory:/user.slice/user-1000.slice/session-c2.scope/t1.  If
we then do a 'lxc-cgroup -n t1 freezer.tasks', cgm_get will
first switch to 3:memory:/user.slice/user-1000.slice/session-c2.scope
then look up 't1's values.  The reasons for this are

1. cgmanager get_value is relative to your own cgroup, so we need
to be sure to be in t1's cgroup or an ancestor
2. we don't want to be in the container's cgroup bc it might freeze us.

But in Ubuntu 15.04 it was decided that
3:memory:/user.slice/user-1000.slice/session-c2.scope/tasks should
not be writeable by the user, making this fail.

Therefore put all unprivileged cgroups under "lxc/%n".  That way
the "lxc" cgroup should always be owned by the user so that he can
enter.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoNow including grep -q
Alexandre Létourneau [Wed, 1 Apr 2015 22:22:50 +0000 (18:22 -0400)] 
Now including grep -q
Signed-off-by: Alexandre Letourneau <letourneau.alexandre@gmail.com>
9 years agoAdded a more reliable test for yum --releasever in the centos template
Alexandre Létourneau [Mon, 30 Mar 2015 22:19:27 +0000 (18:19 -0400)] 
Added a more reliable test for yum --releasever in the centos template
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
9 years agoCorrect typo.
Achton [Thu, 26 Feb 2015 13:47:25 +0000 (14:47 +0100)] 
Correct typo.

Signed-off-by: Achton Smidt Winther <mail@achton.net>
9 years agoSkip control tty code for non-ttys
Stéphane Graber [Tue, 17 Mar 2015 01:54:26 +0000 (21:54 -0400)] 
Skip control tty code for non-ttys

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Add options of 'loop' backingstore to lxc-create(1)
KATOH Yasufumi [Tue, 10 Mar 2015 10:07:39 +0000 (19:07 +0900)] 
doc: Add options of 'loop' backingstore to lxc-create(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoseccomp: add ppc support
Bogdan Purcareata [Thu, 12 Mar 2015 08:57:47 +0000 (08:57 +0000)] 
seccomp: add ppc support

This patch enables seccomp support for LXC containers running on PowerPC
architectures. It is based on the latest PowerPC support added to libseccomp, on
the working-ppc64 branch [1].

Libseccomp has been tested on ppc, ppc64 and ppc64le architectures. LXC with
seccomp support has been tested on ppc and ppc64 architectures, using the
default seccomp policy example files delivered with the LXC package.

[1] https://github.com/seccomp/libseccomp/commits/working-ppc64

v2:
- add #ifdefs in get_new_ctx to fix builds on systems not having SCMP_ARCH_PPC*
  defined

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix the --auth-key flag in gentoo template
Erik Mackdanz [Thu, 12 Mar 2015 21:36:18 +0000 (16:36 -0500)] 
Fix the --auth-key flag in gentoo template

Fix a typo in the getopt call,  should be auth-key not auth_key.
Also provide the argument to cat, so the script doesn't hang waiting
on stdin.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAttempt to fix control tty issues on attach
Stéphane Graber [Fri, 13 Mar 2015 20:43:16 +0000 (16:43 -0400)] 
Attempt to fix control tty issues on attach

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agofix lxc-console on centos / oracle unprivileged containers
Stuart Cardall [Mon, 2 Mar 2015 17:49:20 +0000 (17:49 +0000)] 
fix lxc-console on centos / oracle unprivileged containers

Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
9 years agoUse rdepends when non-thinpool LVM container is cloned
KATOH Yasufumi [Wed, 4 Mar 2015 09:39:14 +0000 (18:39 +0900)] 
Use rdepends when non-thinpool LVM container is cloned

When a non-thinpool LVM container which have snapshotted clone is
destroyed, the LV of snapshotted clone was also deleted. This patch
prevent it.

The original non-thinpool LVM container of snapshotted clone cannot be
now destroyed.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agogentoo container building fails during wget.
lxc@zitta.fr [Fri, 20 Feb 2015 21:53:40 +0000 (22:53 +0100)] 
gentoo container building fails during wget.

follow new gentoo's download server configuration.
Should be backported in earlier lxc versions.

Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoattach: use _exit() instead of exit() in the intermediate child process
Johannes Henninger [Fri, 20 Feb 2015 13:11:03 +0000 (14:11 +0100)] 
attach: use _exit() instead of exit() in the intermediate child process

This prevents on_exit() and atexit() handlers registered by the parent
process from being run in the forked intermediate process.

Signed-off-by: Johannes Henninger <johannes@henninger.io>
9 years agono such option: --releasever on CentOS5's yum
tukiyo [Tue, 17 Feb 2015 01:05:25 +0000 (10:05 +0900)] 
no such option: --releasever on CentOS5's yum

Signed-off-by: tukiyo3 <tukiyo3@gmail.com>
9 years agoUpdate CONTRIBUTING
Дмитрий Пацура [Sat, 14 Feb 2015 14:30:49 +0000 (22:30 +0800)] 
Update CONTRIBUTING

Signed-off-by: Dmitry Patsura <talk@dmtry.me>
10 years agoCVE-2015-1334: Don't use the container's /proc during attach
Stéphane Graber [Thu, 16 Jul 2015 20:37:51 +0000 (16:37 -0400)] 
CVE-2015-1334: Don't use the container's /proc during attach

A user could otherwise over-mount /proc and prevent the apparmor profile
or selinux label from being written which combined with a modified
/bin/sh or other commonly used binary would lead to unconfined code
execution.

Reported-by: Roman Fiedler
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>