Preetam D'Souza [Tue, 28 Jun 2016 03:12:12 +0000 (23:12 -0400)]
Include all lxcmntent.h function declarations on Bionic
Newer versions of Android (5.0+, aka API Level 21+) include mntent.h,
which declares setmntent and endmntent. This hits an edge
case with the preprocessor checks in lxcmntent.h because HAVE_SETMNTENT
and HAVE_ENDMNTENT are both defined (in Bionic's mntent.h), but conf.c
always includes lxcmntent.h on Bionic! As a result, we get compiler
warnings of implicit function declarations for setmntent endmntent.
This patch always includes setmntent/endmntent/hasmntopt function
declarations on Bionic, which gets rid of these warnings.
Tycho Andersen [Mon, 27 Jun 2016 22:24:09 +0000 (22:24 +0000)]
c/r: use criu's "full" mode for cgroups
A while ago cgroup modes were introduced to CRIU, which slightly changed
the behavior w.r.t. cgroups under the hood. What we're really after is
criu's --full mode, i.e. even if a particular cgroup directory exists
(in particular /lxc/$container[-$number] will, since we create it), we
should restore perms on that cgroup.
Things worked just fine for actual properties (except "special" properties
as criu refers to them, which I've just sent a patch for) because liblxc
creates no subdirectories, just the TLD.
Stéphane Graber [Mon, 27 Jun 2016 19:15:15 +0000 (15:15 -0400)]
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.
Antonio Terceiro [Fri, 17 Jun 2016 22:00:56 +0000 (19:00 -0300)]
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>
Laurent Vivier [Mon, 13 Jun 2016 12:34:06 +0000 (14:34 +0200)]
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.
Aleksandr Mezin [Mon, 6 Jun 2016 01:50:59 +0000 (07:50 +0600)]
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>
Jesse Pretorius [Fri, 3 Jun 2016 15:33:25 +0000 (16:33 +0100)]
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 396f75abb3d319adc7d871b94b08bc6bb9c49585 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.
Aleksandr Mezin [Mon, 30 May 2016 21:13:24 +0000 (03:13 +0600)]
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>
Aleksandr Mezin [Sat, 28 May 2016 07:40:15 +0000 (13:40 +0600)]
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>
Jesse Pretorius [Wed, 11 May 2016 17:17:58 +0000 (18:17 +0100)]
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.
Tycho Andersen [Wed, 11 May 2016 13:51:11 +0000 (07:51 -0600)]
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.
Tycho Andersen [Fri, 6 May 2016 18:19:16 +0000 (18:19 +0000)]
c/r: rearrange things to pass struct migrate_opts all the way down
If we don't do this, we'll end up changing the function signatures for the
internal __criu_* functions each time we add a new parameter, which will
get very annoying very quickly. Since we already have the user's arguments
struct, let's just pass that all the way down.
Stewart Brodie [Tue, 10 May 2016 12:57:00 +0000 (13:57 +0100)]
Allow configuration file values to be quoted
If the value starts and ends with matching quote characters, those
characters are stripped automatically. Quote characters are the
single quote (') or double quote ("). The quote removal is done after
the whitespace trimming.
This is needed particularly in order that lxc.environment values may
have trailing spaces. However, the quote removal is done for all values
in the parse_line function, as it has non-const access to the value.
Signed-off-by: Stewart Brodie <stewart@metahusky.net>
gentoo.moresecure.conf tries to drop the capability CAP_SYS_RESOURCES.
However, that capability doesn't exist, so the container doesn't start.
Change it to CAP_SYS_RESOURCE, according to capabilities(7).
Also correct the same typo in a comment in slackware.common.conf.
Aron Podrigal [Sun, 1 May 2016 15:06:53 +0000 (11:06 -0400)]
Fixed - set PyErr when Container.__init__ fails
When container init failed for whatever reason, previously it resulted
in a `SystemError: NULL result without error in PyObject_Call`
This will now result in a RuntimeError with the error message
previously printed to stderr.
Leonid Isaev [Thu, 21 Apr 2016 19:20:39 +0000 (13:20 -0600)]
Initialize a pointer in split_init_cmd() to avoid gcc warnings
gcc -Wall warns about uninitialized variables (-Wmaybe-uninitialized), and
-Werror makes it fatal. This change allows the build to succeed by NULL'ifying
the pointer passed to strtok_r().
Note that strtok_r(3) anyway ignores a non-NULL arg3 pointer on the 1st call
with non-NULL arg1 string.
Signed-off-by: Leonid Isaev <leonid.isaev@jila.colorado.edu> Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
don't make sysv init scripts dependant on distribution specifics
- /etc(/rc.d)?/init.d/functions does not exist on all distributions
- LSB does not define a message function without an explicit status
- Debian-derived systems add a log_daemon_msg for that
lets define an own log_daemon_msg as echo and try to load LSB init
functions afterwards, which might overload it with a nicer version
that way the init scripts should work on any system, without hard
dependencies on neither LSB nor /etc/init.d/functions