Commit Graph

4259 Commits

Author SHA1 Message Date
Wolfgang Bumiller
667cfb7c2d AppArmor: add make-rslave to usr.bin.lxc-start
The profile already contains
  mount options=(rw, make-slave) -> **,

Which allows going through all mountpoints with make-slave,
so it seems to make sense to also allow the directly
recursive variant with "make-rslave".

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-06-27 16:20:00 -04:00
Serge Hallyn
42c6b8d809 Merge pull request #1061 from stgraber/master
More apparmor tweaks
2016-06-27 15:11:08 -05:00
Stéphane Graber
7f2b13275d apparmor: Update mount states handling
Properly list all of the states and the right apparmor stanza for them,
then comment them all as actually enabling this would currently let the
user bypass apparmor entirely.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-27 16:03:49 -04:00
Stéphane Graber
af5f70c4b5 apparmor: allow mount move
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-27 15:11:47 -04:00
Stéphane Graber
b2a245c2b4 Merge pull request #1056 from AnrDaemon/patch-1
Force lxc-instance to behave like a good Upstart client
2016-06-23 23:21:44 -04:00
AnrDaemon
abf28de1e6 Force lxc-instance to behave like a good Upstart client
Remove unnecessary shell wrap around job start.
Force foreground execution to allow job monitoring and control.

Signed-off-by Andrey Repin <anrdaemon@yandex.ru>
2016-06-24 06:19:51 +03:00
Christian Brauner
18f9cbeea7 Merge pull request #1055 from stgraber/master
apparmor: Allow bind-mounts and {r}shared/{r}private
2016-06-23 23:28:19 +02:00
Stéphane Graber
e96e7a1ac7 apparmor: Allow bind-mounts and {r}shared/{r}private
Bind-mounts aren't harmful in containers, so long as they're not used to
bypass MAC policies.

This change allows bind-mounting of any path which isn't a dangerous
filesystem that's otherwise blocked by apparmor.

This also allows switching paths {r}shared or {r}private.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-23 16:01:29 -04:00
Christian Brauner
2323b39d48 Merge pull request #1053 from tenforward/plamo
plamo: Improve Plamo template
2016-06-21 14:33:39 +02:00
KATOH Yasufumi
1dd810a1d6 plamo: Improve Plamo template
* configure to start only the minimum of service
* add ntp, kmod to ignore packages

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-06-21 17:17:54 +09:00
Stéphane Graber
c0da9d264c Merge pull request #1052 from terceiro/debian-init
lxc-debian: make sure init is installed
2016-06-18 08:29:04 -04:00
Antonio Terceiro
3c39b0b7a2 lxc-debian: make sure init is installed
init 1.34 is not "Essential" anymore, in order to make it not required
on minimal chroots, docker containers, etc. Because of that we now need
to manually include it on systems that are expected to boot.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2016-06-18 09:22:47 -03:00
Stéphane Graber
f6578a7bb2 Merge pull request #1047 from brauner/mips_container
lxc-debian: allow to specify a binfmt interpreter
2016-06-13 18:36:29 -04:00
Laurent Vivier
d50cebd697 lxc-debian: allow to specify a binfmt interpreter
If you specify an interpreter path with "-I" or "--interpreter-path",
the architecture of the debian container can differ from the one of
the host.

Before creating the container, binfmt must be configured on the host:
the script checks the name of the interpreter in /proc/sys/fs/binfmt_misc/
to know where to install it in the container.

To create a MIPS container on an x86_64 host:

$ cat /proc/sys/fs/binfmt_misc/qemu-mips
enabled
interpreter //qemu-mips
flags: OC
offset 0
magic 7f454c4601020100000000000000000000020008
mask ffffffffffffff00fffffffffffffffffffeffff

$ sudo lxc-create -n virtmips-stretch -t debian -- \
                 --arch=mips \
                 --interpreter-path=./mips-linux-user/qemu-mips \
                 --mirror=http://ftp.debian.org/debian \
                 --release=stretch

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2016-06-13 22:12:54 +02:00
Serge Hallyn
56c80e0d4d Merge pull request #1045 from thtanaka/console-login-ol72
Unable to login via console in OL7.2
2016-06-09 16:38:49 -05:00
Thomas Tanaka
6efaa00c7f Unable to login via console in OL7.2
There is container-getty.service with OL7.2 systemd, it
is also used for managing the getty service, use that
instead and not manually create it.

Signed-off-by: Thomas Tanaka <thomas.tanaka@oracle.com>
2016-06-09 13:41:02 -07:00
Christian Brauner
b5cacc178e Merge pull request #1043 from stgraber/master
Drop lxc-devsetup as unneeded by current autodev
2016-06-07 21:29:52 +02:00
Stéphane Graber
7c76d6b7b7 Drop lxc-devsetup as unneeded by current autodev
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-07 15:11:07 -04:00
Christian Brauner
f01b8bcfe5 Merge pull request #1042 from GreatFruitOmsk/python-rpath
python-lxc: follow global rpath setting for autotools builds
2016-06-06 12:49:27 +02:00
Aleksandr Mezin
2c500c107a python-lxc: follow global rpath setting for autotools builds
When LXC is configured with --enable-rpath, I expect Python bindings
to be able to find the library in a non-standard location, just like
LXC command-line tools.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-06-06 07:50:59 +06:00
Stéphane Graber
9d54166ca5 Merge pull request #1040 from odyssey4me/include_apt_transport_https
Move apt-transport-https to global packages_template
2016-06-03 11:37:02 -04:00
Jesse Pretorius
d0e206b833 Move apt-transport-https to global packages_template
In many environments the preference is to configure containers with
apt mirrors that are SSL-secured.

When building containers using the download template this can't be
done unless an insecure mirror is first used to install the
apt-transport-https package, then the sources reconfigured to
use the https URL.

When building containers without using the download template this
can't be done unless the container creator specifically includes
this package in the package list at build time. It seems more
intuitive to me to have the package installed by default.

Commit 396f75abb3 added the package
to the minbase variant, but this variant is not used by the download
template build process. The build process instead specifies no
variant, so this patch moves the package from the packages_template
package list in the minbase variant to the global packages_template
package list, ensuring that this package is included in all Ubuntu
build images that use the lxc-ubuntu template.

Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2016-06-03 16:33:25 +01:00
Stéphane Graber
3c23f024e8 Merge pull request #1037 from evgeni/lxc.service-simple
start containers in foreground when using the lxc@.service
2016-06-02 09:44:31 -04:00
Evgeni Golov
c4e50f1d41 start containers in foreground when using the lxc@.service
lxc-start started to default to daemonize the container when starting
this conflicts with type=simple of the systemd unit

call lxc-start with -F and thus force execution in foreground
that way we can feed the log to journald properly and keep type=simple

Debian-Bug: https://bugs.debian.org/826100
Signed-off-by: Evgeni Golov <evgeni@golov.de>
2016-06-02 15:42:25 +02:00
Stéphane Graber
71e4ea52bf Merge pull request #1036 from GreatFruitOmsk/python-setuptools
python-lxc: fix breakage caused by the switch to setuptools
2016-05-31 15:40:46 -04:00
Aleksandr Mezin
0e586abd44 python-lxc: put egg-info into build directory
To keep source directory clean.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 17:37:08 +06:00
Aleksandr Mezin
371cffc37a python-lxc: always set --root for install command
This implies '--single-version-externally-managed', which we
actually want for autotools builds.

Fixes current problems with jenkins test suite.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 17:36:17 +06:00
Stéphane Graber
b4b75e16db Merge pull request #1035 from GreatFruitOmsk/python-setuptools
python-lxc: use setuptools instead of distutils
2016-05-31 00:19:29 -04:00
Aleksandr Mezin
f6ab2204b7 python-lxc: use setuptools instead of distutils
setuptools is recommended by Python Packaging Guide
https://python-packaging-user-guide.readthedocs.io/en/latest/current/

It contains some useful extensions like 'develop' command. Also it
is required for building wheels AFAIK.

The only downside is an extra build-time dependency. setuptools are
packaged in both Debian and Ubuntu (python3-setuptools), as well as
other major distros, so it shouldn't be an issue, I think.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 04:18:04 +06:00
Stéphane Graber
0a8fca094e Merge pull request #1034 from GreatFruitOmsk/master
python-lxc: change distribution name _lxc -> lxc
2016-05-28 15:21:16 -04:00
Aleksandr Mezin
34c4f72b01 python-lxc: change distribution name _lxc -> lxc
Distribution name starting with underscore is considered invalid by
many tools. For example, you can't list such name in
install_requires in your setup.py.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-29 01:08:55 +06:00
Stéphane Graber
df5ce2303c Merge pull request #1032 from GreatFruitOmsk/travis-vpath
travis: test VPATH builds
2016-05-27 13:56:49 -04:00
Stéphane Graber
8c041c2f68 Merge pull request #1031 from GreatFruitOmsk/pypi
python-lxc: enable standalone builds
2016-05-27 13:55:40 -04:00
Aleksandr Mezin
f2fec47531 python-lxc: search for lxc library and headers using pkg-config
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 22:23:02 +06:00
Aleksandr Mezin
43f965e015 travis: ensure 'make install' doesn't fail
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 21:56:21 +06:00
Aleksandr Mezin
6bc6062d3a travis: test VPATH builds
It looks like VPATH (split source and build directories) builds
are frequently broken. So let's test them on travis-ci.

Personally I use VPATH build in my deployment scripts.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:54:06 +06:00
Aleksandr Mezin
00d98acd9f python-lxc: pass include/library dirs as arguments to setup.py
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:17 +06:00
Aleksandr Mezin
58a44782d9 python-lxc: don't use private lxc/confile.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:14 +06:00
Aleksandr Mezin
0fbd2f6a89 python-lxc: don't use private lxc/utils.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:09 +06:00
Aleksandr Mezin
d51f78ed31 python-lxc: don't use private lxc/namespace.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:04:59 +06:00
Christian Brauner
95ca286dbd Merge pull request #1029 from joerg-krause/master
Fix redefinition of struct in6_addr
2016-05-23 21:29:49 +02:00
Jörg Krause
07d10e71d5 Fix redefinition of struct in6_addr
struct in6_addr is both defined in the C library header <netinet/in.h>
and the Linux kernel header <linux/in6.h>.

lxc_user_nic.c includes both <netinet/in.h> and <linux/if_bridge.h>. The
later one includes <linux/in6.h>.

This breaks build with the musl libc:
  error: redefinition of ‘struct in6_addr’

As lxc_user_nic.c does not use any references from <linux/if_bridge.h> it
is safe to remove this header.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
2016-05-23 20:55:46 +02:00
Stéphane Graber
7679fc22f6 Merge pull request #1022 from Lisio/master
Fix hostname in interface config for apline template
2016-05-11 16:41:00 -04:00
Andrey Kostin
1c4ea80c9e Fix hostname in interface config for apline template
Signed-off-by: Andrey Kostin <andrey@kostin.email>
2016-05-11 23:32:40 +03:00
Stéphane Graber
c563b9a29d Merge pull request #1021 from odyssey4me/include_apt_transport_https
Add apt-transport-https to minbase variant packages_template
2016-05-11 13:41:48 -04:00
Jesse Pretorius
396f75abb3 Add apt-transport-https to minbase variant packages_template
In many environments the preference is to configure containers with
apt mirrors that are SSL-secured.

When building containers using the download template this can't be
done unless an insecure mirror is first used to install the
apt-transport-https package, then the sources reconfigured to
use the https URL.

When building containers without using the download template this
can't be done unless the container creator specifically includes
this package in the package list at build time.

It seems more intuitive to me to have the package installed by
default. This patch includes the required package for the minbase
variant only as this is the default.

Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2016-05-11 18:30:39 +01:00
Christian Brauner
5832d025f5 Merge pull request #1020 from stgraber/master
Also allow fstype=fuse for fuse filesystems
2016-05-11 19:17:13 +02:00
Stéphane Graber
e6faa0670c Also allow fstype=fuse for fuse filesystems
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-05-11 12:59:23 -04:00
Christian Brauner
6b63f7a119 Merge pull request #1019 from tych0/dont-force-irmap
Dont force irmap
2016-05-11 16:47:50 +02:00
Tycho Andersen
19d1509c39 c/r: add an option to use faster inotify support in CRIU
The idea here is that criu can use open_by_handle on a configuration which
will preserve inodes on moves across hosts, but shouldn't do that on
configurations which won't preserve inodes. Before, we forced it to always
be slow, but we don't have to do this.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-05-11 13:59:48 +00:00