]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
8 years agoAdd a new logger: syslog and Print the VM name in the logs
Baptiste Daroussin [Fri, 8 Jul 2016 09:35:11 +0000 (11:35 +0200)]
Add a new logger: syslog and Print the VM name in the logs

To activate it specify lxc.syslog = <afacility>
For now the available facilities are: daemon, local[0-7] others will be
rejected

syslog got only activated after the function that checks for inheritance
of fd is passed in order to make sure the syslog fd is not inherited
and prevent the creation of the fd is any log have been issued during
the checks (which would end up in an infinite loop)

Signed-off-by: Fatih ACAR <fatih.acar@gandi.net>
Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: Baptiste Daroussin <bapt@gandi.net>
Signed-off-by: William Dauchy <william@gandi.net>
8 years agoMerge pull request #1102 from chenhaiq/master
Christian Brauner [Thu, 28 Jul 2016 11:23:58 +0000 (13:23 +0200)]
Merge pull request #1102 from chenhaiq/master

attach: use setns instead of unshare

8 years agoMerge pull request #1104 from brauner/2016-07-27/fix_android_getline
Stéphane Graber [Thu, 28 Jul 2016 10:30:27 +0000 (12:30 +0200)]
Merge pull request #1104 from brauner/2016-07-27/fix_android_getline

Revert "Merge pull request #1103 from brauner/2016-07-27/fix_android_…

8 years agoRevert "Merge pull request #1103 from brauner/2016-07-27/fix_android_getline"
Christian Brauner [Thu, 28 Jul 2016 08:56:46 +0000 (10:56 +0200)]
Revert "Merge pull request #1103 from brauner/2016-07-27/fix_android_getline"

This reverts commit 25796416084f3cecf036bd922d6ead094500191e, reversing
changes made to 813d7f1453e6e28adc0fdfac62d9c4597a87e430.

Contrary to what we suspected the android build errors were not caused by
missing wrong relative include paths. Rather, they were caused by autoconf.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoattach: setns instead of unshare in lxc-attach
oc [Wed, 27 Jul 2016 14:43:58 +0000 (22:43 +0800)]
attach: setns instead of unshare in lxc-attach

lxc-checkpoint will fail because process createdy by lxc-attach has
incorrect cgroup ns. It needs to use "setns" instead of "unshare"
to set cgroup ns.

Signed-off-by: Chen Haiquan <oc@yunify.com>
8 years agoMerge pull request #1103 from brauner/2016-07-27/fix_android_getline
Stéphane Graber [Wed, 27 Jul 2016 16:28:53 +0000 (12:28 -0400)]
Merge pull request #1103 from brauner/2016-07-27/fix_android_getline

bdev: include own getline function in bdev.h

8 years agobdev: include own getline function in bdev.h
Christian Brauner [Wed, 27 Jul 2016 16:07:34 +0000 (18:07 +0200)]
bdev: include own getline function in bdev.h

Fixes android build error:

bdev/bdev.c: In function 'detect_fs':
bdev/bdev.c:686:2: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration]
  while (getline(&line, &linelen, f) != -1) {
  ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1101 from sergiusens/pkgconfig-prefix
Stéphane Graber [Tue, 26 Jul 2016 09:16:46 +0000 (05:16 -0400)]
Merge pull request #1101 from sergiusens/pkgconfig-prefix

Add a prefix to the lxc.pc

8 years agoAdd a prefix to the lxc.pc
Sergio Schvezov [Tue, 26 Jul 2016 07:41:47 +0000 (09:41 +0200)]
Add a prefix to the lxc.pc

This allows installing to different locations and using
the lxc.pc to build using the generated includedir and
libdir.

Signed-off-by: Sergio Schvezov <sergio.schvezov@ubuntu.com>
8 years agoMerge pull request #1100 from brauner/2016-07-25/fix_cgfsng_lxcfs_and_cgroupfs_checkfuns
Stéphane Graber [Mon, 25 Jul 2016 15:44:28 +0000 (11:44 -0400)]
Merge pull request #1100 from brauner/2016-07-25/fix_cgfsng_lxcfs_and_cgroupfs_checkfuns

cgfsng: fix is_lxcfs() and is_cgroupfs()

8 years agocgfsng: fix is_lxcfs() and is_cgroupfs()
Christian Brauner [Mon, 25 Jul 2016 15:10:47 +0000 (17:10 +0200)]
cgfsng: fix is_lxcfs() and is_cgroupfs()

Both functions advertise that they return true when strncmp() == 0 and false
when strncmp() != 0 but so far they returned the exact opposite.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1097 from jirutka/patch-1
Christian Brauner [Sat, 23 Jul 2016 19:31:24 +0000 (21:31 +0200)]
Merge pull request #1097 from jirutka/patch-1

lxc-alpine: mount tmpfs under /run

8 years agolxc-alpine: mount tmpfs under /run
Jakub Jirutka [Sat, 23 Jul 2016 17:57:36 +0000 (19:57 +0200)]
lxc-alpine: mount tmpfs under /run

When running under grsecurity kernel or userns, it can't be mounted from inside.

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
8 years agoMerge pull request #1094 from brauner/2016-07-22/fix_android_lxc_copy
Stéphane Graber [Fri, 22 Jul 2016 20:30:50 +0000 (22:30 +0200)]
Merge pull request #1094 from brauner/2016-07-22/fix_android_lxc_copy

lxc-copy: do not use mkostemp and dprintf

8 years agolxc-copy: do not use mkostemp and dprintf
Christian Brauner [Fri, 22 Jul 2016 19:59:24 +0000 (21:59 +0200)]
lxc-copy: do not use mkostemp and dprintf

Fixes android builds:

DSBINDIR=\"/data/lxc/lxc/sbin\"      -I/build/libcap/libcap/include/ -Wall -Werror -MT lxc_copy.o -MD -MP -MF $depbase.Tpo -c -o lxc_copy.o lxc_copy.c &&\
mv -f $depbase.Tpo $depbase.Po
lxc_copy.c: In function 'mount_tmpfs':
lxc_copy.c:834:2: error: implicit declaration of function 'mkostemp' [-Werror=implicit-function-declaration]
  fd = mkostemp(premount, O_CLOEXEC);
  ^
lxc_copy.c:841:2: error: implicit declaration of function 'dprintf' [-Werror=implicit-function-declaration]
  ret = dprintf(fd, "#! /bin/sh\n"
  ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1093 from brauner/2016-07-22/use_priu64
Stéphane Graber [Fri, 22 Jul 2016 15:10:20 +0000 (17:10 +0200)]
Merge pull request #1093 from brauner/2016-07-22/use_priu64

c/r: use PRIu64 format specifier

8 years agoc/r: use PRIu64 format specifier
Christian Brauner [Fri, 22 Jul 2016 09:14:24 +0000 (11:14 +0200)]
c/r: use PRIu64 format specifier

Fixes build failures on arm:

criu.c: In function ‘exec_criu’:
criu.c:310:4: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
    ret = sprintf(ghost_limit, "%lu", opts->user->ghost_limit);
    ^
In file included from criu.c:42:0:
log.h:285:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
  struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT;  \
         ^
criu.c:312:5: note: in expansion of macro ‘ERROR’
     ERROR("failed to print ghost limit %lu", opts->user->ghost_limit);
     ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1092 from LicoMonch/extend-debian-template
Stéphane Graber [Thu, 21 Jul 2016 20:50:44 +0000 (22:50 +0200)]
Merge pull request #1092 from LicoMonch/extend-debian-template

simple enhancements of lxc-debian-template-script

8 years agotemplates: make shellcheck (Ubuntu: 0.3.7-5 amd64) most possible happy
Andreas Freudenberg [Fri, 15 Jul 2016 14:59:01 +0000 (16:59 +0200)]
templates: make shellcheck (Ubuntu: 0.3.7-5 amd64) most possible happy

Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
8 years agotemplates: add more quotes to variables (at least $rootfs should now be covered)
Andreas Freudenberg [Tue, 12 Jul 2016 15:53:08 +0000 (17:53 +0200)]
templates: add more quotes to variables (at least $rootfs should now be covered)

Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
8 years agotemplates: avoid noisy perl warnings caused by missing locales
Andreas Freudenberg [Tue, 12 Jul 2016 15:51:06 +0000 (17:51 +0200)]
templates: avoid noisy perl warnings caused by missing locales

Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
8 years agoMerge pull request #1091 from ysbnim/master
Christian Brauner [Wed, 20 Jul 2016 09:10:25 +0000 (11:10 +0200)]
Merge pull request #1091 from ysbnim/master

doc: Update Korean lxc-copy(1) to include tmpfs option

8 years agodoc: Update Korean lxc-copy(1) to include tmpfs option
Sungbae Yoo [Wed, 20 Jul 2016 08:58:26 +0000 (17:58 +0900)]
doc: Update Korean lxc-copy(1) to include tmpfs option

Update for commit a361e56

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agoMerge pull request #1074 from vel21ripn/vlan_mtu
Christian Brauner [Wed, 20 Jul 2016 08:32:36 +0000 (10:32 +0200)]
Merge pull request #1074 from vel21ripn/vlan_mtu

Set up MTU for vlan-type interfaces.

8 years agoMerge pull request #1090 from tenforward/japanese
Christian Brauner [Wed, 20 Jul 2016 08:13:28 +0000 (10:13 +0200)]
Merge pull request #1090 from tenforward/japanese

doc: Update Japanese lxc-copy(1) to include tmpfs option

8 years agodoc: Update Japanese lxc-copy(1) to include tmpfs option
KATOH Yasufumi [Wed, 20 Jul 2016 06:56:46 +0000 (15:56 +0900)]
doc: Update Japanese lxc-copy(1) to include tmpfs option

Update for commit a361e56

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agoMerge pull request #1089 from tych0/ghost-limit
Christian Brauner [Tue, 19 Jul 2016 22:26:30 +0000 (00:26 +0200)]
Merge pull request #1089 from tych0/ghost-limit

c/r: add support for ghost-limit in CRIU

8 years agoc/r: add support for ghost-limit in CRIU
Tycho Andersen [Tue, 19 Jul 2016 20:27:26 +0000 (14:27 -0600)]
c/r: add support for ghost-limit in CRIU

This is an old option that we probably should have exposed long ago :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoMerge pull request #1086 from brauner/detect_sigrtmin_3
Serge Hallyn [Tue, 19 Jul 2016 17:49:19 +0000 (12:49 -0500)]
Merge pull request #1086 from brauner/detect_sigrtmin_3

[RFC]: lxccontainer: detect if we should send SIGRTMIN+3

8 years agolxccontainer: detect if we should send SIGRTMIN+3
Christian Brauner [Mon, 18 Jul 2016 20:21:56 +0000 (22:21 +0200)]
lxccontainer: detect if we should send SIGRTMIN+3

This is required by systemd to cleanly shutdown. Other init systems should not
have SIGRTMIN+3 in the blocked signals set.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1087 from brauner/2016-07-16/clone_on_tmpfs
Serge Hallyn [Tue, 19 Jul 2016 13:07:47 +0000 (08:07 -0500)]
Merge pull request #1087 from brauner/2016-07-16/clone_on_tmpfs

lxc-copy: update manpage to include tmpfs option

8 years agolxc-copy: update manpage to include tmpfs option
Christian Brauner [Mon, 18 Jul 2016 21:54:29 +0000 (23:54 +0200)]
lxc-copy: update manpage to include tmpfs option

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1084 from brauner/2016-07-16/clone_on_tmpfs
Serge Hallyn [Mon, 18 Jul 2016 18:45:50 +0000 (13:45 -0500)]
Merge pull request #1084 from brauner/2016-07-16/clone_on_tmpfs

lxc-copy: allow snapshots to be placed on tmpfs

8 years agolxc-copy: allow snapshots to be placed on tmpfs
Christian Brauner [Sat, 16 Jul 2016 09:00:17 +0000 (11:00 +0200)]
lxc-copy: allow snapshots to be placed on tmpfs

Place an ephemeral container started with -e flag on a tmpfs. Restrictions are
that you cannot request the data to be kept while placing the container on a
tmpfs, that either overlay or aufs backing storage must be used, and that the
storage backend of the original container must be a directory.

For ephemeral snapshots backed by overlay or aufs filesystems, a fresh tmpfs
is mounted over the containers directory if the user requests it. This should
be the easiest options. Anything else would require us to change the current
mount-layout of overlay and aufs snapshots. (A standard overlay or aufs
snapshot clone currently has the layout:

/var/lib/lxc/CLONE_SNAPSHOT/delta0      <-- upperdir
/var/lib/lxc/CLONE_SNAPSHOT/rootfs
/var/lib/lxc/CLONE_SNAPSHOT/olwork
/var/lib/lxc/CLONE_SNAPSHOT/olwork/work <-- workdir

with the lowerdir being

/var/lib/lxc/CLONE_PARENT/rootfs

The fact that upperdir and workdir are not placed in a common subfolder under
the container directory has the consequence that we cannot simply mount a fresh
tmpfs under upperdir and workdir because overlay expects them to be on the same
filesystem.)

Because we mount a fresh tmpfs over the directory of the container the updated
/etc/hostname file created during the clone residing in the upperdir (currently
named "delta0" by default) will be hidden. Hence, if the user requests that the
old name is not to be kept for the clone, we recreate this file on the tmpfs.
This should be all that is required to restore the exact behaviour we would get
with a normal clone.
NOTE: If the container is rebooted all changes made to it are lost. This is not
easy to prevent since each reboot remounts the rootfs again.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoSet up MTU for vlan-type interfaces.
Vitaly Lavrov [Thu, 30 Jun 2016 17:04:49 +0000 (20:04 +0300)]
Set up MTU for vlan-type interfaces.

Signed-off-by: Vitaly Lavrov <vel21ripn@gmail.com>
8 years agoMerge pull request #1082 from adrianreber/master
Christian Brauner [Fri, 15 Jul 2016 09:23:10 +0000 (11:23 +0200)]
Merge pull request #1082 from adrianreber/master

c/r: make local function static

8 years agoc/r: make local function static
Adrian Reber [Fri, 15 Jul 2016 08:54:30 +0000 (10:54 +0200)]
c/r: make local function static

This is a minimal commit which makes the function 'do_restore()' static
as it is not used anywhere else in the code. This also removes a
trailing space my editor complained about.

Signed-off-by: Adrian Reber <areber@redhat.com>
8 years agoMerge pull request #1072 from adrianreber/master
Christian Brauner [Wed, 13 Jul 2016 21:16:49 +0000 (23:16 +0200)]
Merge pull request #1072 from adrianreber/master

c/r: drop in-flight connections during CRIU dump

8 years agoc/r: drop in-flight connections during CRIU dump
Adrian Reber [Mon, 4 Jul 2016 14:58:09 +0000 (16:58 +0200)]
c/r: drop in-flight connections during CRIU dump

Shortly after CRIU 2.3 has been released a patch has been added to skip
in-flight TCP connections. In-flight connections are not completely
established connections (SYN, SYN-ACK). Skipping in-flight TCP
connections means that the client has to re-initiate the connection
establishment.

This patch stores the CRIU version detected during version check, so
that during dump/checkpoint options can be dynamically enabled depending
on the available CRIU version.

v2:
   * use the newly introduced criu version interface
   * add an option to disable skipping in-flight connections

Signed-off-by: Adrian Reber <areber@redhat.com>
8 years agoMerge pull request #1078 from brauner/2016-07-11/add_cgns
Stéphane Graber [Tue, 12 Jul 2016 12:01:01 +0000 (08:01 -0400)]
Merge pull request #1078 from brauner/2016-07-11/add_cgns

add missing cgroup namespace to ns_info struct

8 years agoMerge pull request #1077 from adrianreber/init
Christian Brauner [Mon, 11 Jul 2016 20:52:26 +0000 (22:52 +0200)]
Merge pull request #1077 from adrianreber/init

c/r: initialize migrate_opts properly

8 years agoadd missing cgroup namespace to ns_info struct
Christian Brauner [Mon, 11 Jul 2016 20:48:48 +0000 (22:48 +0200)]
add missing cgroup namespace to ns_info struct

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoc/r: initialize migrate_opts properly
Adrian Reber [Mon, 11 Jul 2016 19:55:43 +0000 (21:55 +0200)]
c/r: initialize migrate_opts properly

The commit "c/r: add support for CRIU's --action-script" breaks
lxc-checkpoint on the command-line. It produces errors like:

 sh: $'\260\366\b\001': command not found

and then it fails. src/lxc/criu.c expects migrate_opts->action_script to
be either NULL, then it is ignored, or to actually contain the name of
an action scripts.

As the struct migrate_opts has not static storage is has to be explicitly
initialized or the value of the structure's members is indeterminate.

Signed-off-by: Adrian Reber <areber@redhat.com>
8 years agoMerge pull request #1069 from rsampaio/rsampaio-nodev-dev
Serge Hallyn [Fri, 8 Jul 2016 15:35:44 +0000 (10:35 -0500)]
Merge pull request #1069 from rsampaio/rsampaio-nodev-dev

Add flag in mount_entry to skip NODEV in case of a persistent dev entry

8 years agoMerge pull request #1073 from brauner/bugfix_branch
Serge Hallyn [Fri, 8 Jul 2016 13:16:39 +0000 (08:16 -0500)]
Merge pull request #1073 from brauner/bugfix_branch

store criu version

8 years agoMerge pull request #1075 from tych0/criu-action-script
Christian Brauner [Thu, 7 Jul 2016 23:11:27 +0000 (01:11 +0200)]
Merge pull request #1075 from tych0/criu-action-script

c/r: add support for CRIU's --action-script

8 years agoc/r: add support for CRIU's --action-script
Tycho Andersen [Wed, 6 Jul 2016 23:45:15 +0000 (23:45 +0000)]
c/r: add support for CRIU's --action-script

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agostore criu version
Christian Brauner [Tue, 5 Jul 2016 14:52:21 +0000 (16:52 +0200)]
store criu version

- If version != NULL criu_version_ok() stores the detected criu version in
  version. Allocates memory for version which must be freed by caller.
- If version == NULL criu_version_ok() will return true when the version
  matches, false in all other cases.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1070 from hallyn/2016-07-01/fixcg
Christian Brauner [Sat, 2 Jul 2016 06:01:26 +0000 (08:01 +0200)]
Merge pull request #1070 from hallyn/2016-07-01/fixcg

cgfsng: don't pre-calculate path

8 years agocgfsng: don't pre-calculate path
Serge Hallyn [Sat, 2 Jul 2016 02:18:38 +0000 (21:18 -0500)]
cgfsng: don't pre-calculate path

First, we're doing this so long a there is any cgroup config item -
even if no devices ones.  Then if devices is not available we fail.
This was leading to Rob E's mysterious startup failures.

Secondly, we're not even using this info.  The user was removed
awhile back.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
8 years agoAdd flag in mount_entry to skip NODEV in case of a persistent dev entry
Rodrigo Vaz [Sat, 2 Jul 2016 01:34:11 +0000 (18:34 -0700)]
Add flag in mount_entry to skip NODEV in case of a persistent dev entry

Signed-off-by: Rodrigo Vaz <rodrigo@heroku.com>
8 years agoMerge pull request #1065 from stgraber/master
Christian Brauner [Wed, 29 Jun 2016 21:19:16 +0000 (23:19 +0200)]
Merge pull request #1065 from stgraber/master

Fix typo found by lintian

8 years agoFix typo found by lintian
Stéphane Graber [Wed, 29 Jun 2016 20:56:41 +0000 (16:56 -0400)]
Fix typo found by lintian

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #1064 from terceiro/fix-wheezy
Stéphane Graber [Wed, 29 Jun 2016 18:08:48 +0000 (14:08 -0400)]
Merge pull request #1064 from terceiro/fix-wheezy

lxc-debian: fix regression when creating wheezy containers

8 years agolxc-debian: fix regression when creating wheezy containers
Antonio Terceiro [Wed, 29 Jun 2016 17:58:35 +0000 (14:58 -0300)]
lxc-debian: fix regression when creating wheezy containers

The regression was introduced by commit
3c39b0b7a2b445e08d2e2aecb05566075f4f3423 which makes it possible to
create working stretch containers by forcinig `init` to be in the
included package list.

However, `init` didn't exit before jessie, so now for wheezy we
explicitly include `sysvinit`; sysvinit on wheezy is essential,
so it would already be included anyway.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
8 years agoapparmor: Refresh generated file
Stéphane Graber [Tue, 28 Jun 2016 19:35:58 +0000 (15:35 -0400)]
apparmor: Refresh generated file

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #1063 from pdsouza/pdsouza/fix-bionic-lxcmntent
Stéphane Graber [Tue, 28 Jun 2016 17:36:46 +0000 (13:36 -0400)]
Merge pull request #1063 from pdsouza/pdsouza/fix-bionic-lxcmntent

Include all lxcmntent.h function declarations on Bionic

8 years agoInclude all lxcmntent.h function declarations on Bionic
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.

Signed-off-by: Preetam D'Souza <preetamjdsouza@gmail.com>
8 years agoMerge pull request #1062 from tych0/fully-manage-cgroups
Stéphane Graber [Tue, 28 Jun 2016 01:15:37 +0000 (21:15 -0400)]
Merge pull request #1062 from tych0/fully-manage-cgroups

c/r: use criu's "full" mode for cgroups

8 years agoc/r: use criu's "full" mode for cgroups
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.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agolxc-debian: add btrfs support
Laurent Vivier [Fri, 17 Jun 2016 01:19:32 +0000 (03:19 +0200)]
lxc-debian: add btrfs support

copied from lxc-ubuntu.in

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Serge Hallyn <serge@hallyn.com>
8 years agolxc-debian: add --flush-cache
Laurent Vivier [Fri, 17 Jun 2016 01:19:31 +0000 (03:19 +0200)]
lxc-debian: add --flush-cache

copied from lxc-ubuntu.in

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Serge Hallyn <serge@hallyn.com>
8 years agoAppArmor: add make-rslave to usr.bin.lxc-start
Wolfgang Bumiller [Mon, 27 Jun 2016 20:20:00 +0000 (16:20 -0400)]
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>
8 years agoMerge pull request #1061 from stgraber/master
Serge Hallyn [Mon, 27 Jun 2016 20:11:08 +0000 (15:11 -0500)]
Merge pull request #1061 from stgraber/master

More apparmor tweaks

8 years agoapparmor: Update mount states handling
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.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoapparmor: allow mount move
Stéphane Graber [Mon, 27 Jun 2016 19:11:16 +0000 (15:11 -0400)]
apparmor: allow mount move

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #1056 from AnrDaemon/patch-1
Stéphane Graber [Fri, 24 Jun 2016 03:21:44 +0000 (23:21 -0400)]
Merge pull request #1056 from AnrDaemon/patch-1

Force lxc-instance to behave like a good Upstart client

8 years agoForce lxc-instance to behave like a good Upstart client
AnrDaemon [Fri, 24 Jun 2016 03:19:51 +0000 (06:19 +0300)]
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>

8 years agoMerge pull request #1055 from stgraber/master
Christian Brauner [Thu, 23 Jun 2016 21:28:19 +0000 (23:28 +0200)]
Merge pull request #1055 from stgraber/master

apparmor: Allow bind-mounts and {r}shared/{r}private

8 years agoapparmor: Allow bind-mounts and {r}shared/{r}private
Stéphane Graber [Thu, 23 Jun 2016 20:01:29 +0000 (16:01 -0400)]
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>
8 years agoMerge pull request #1053 from tenforward/plamo
Christian Brauner [Tue, 21 Jun 2016 12:33:39 +0000 (14:33 +0200)]
Merge pull request #1053 from tenforward/plamo

plamo: Improve Plamo template

8 years agoplamo: Improve Plamo template
KATOH Yasufumi [Tue, 21 Jun 2016 02:06:25 +0000 (11:06 +0900)]
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>
8 years agoMerge pull request #1052 from terceiro/debian-init
Stéphane Graber [Sat, 18 Jun 2016 12:29:04 +0000 (08:29 -0400)]
Merge pull request #1052 from terceiro/debian-init

lxc-debian: make sure init is installed

8 years agolxc-debian: make sure init is installed
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>
8 years agoMerge pull request #1047 from brauner/mips_container
Stéphane Graber [Mon, 13 Jun 2016 22:36:29 +0000 (18:36 -0400)]
Merge pull request #1047 from brauner/mips_container

lxc-debian: allow to specify a binfmt interpreter

8 years agolxc-debian: allow to specify a binfmt interpreter
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.

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>
8 years agoMerge pull request #1045 from thtanaka/console-login-ol72
Serge Hallyn [Thu, 9 Jun 2016 21:38:49 +0000 (16:38 -0500)]
Merge pull request #1045 from thtanaka/console-login-ol72

Unable to login via console in OL7.2

8 years agoUnable to login via console in OL7.2
Thomas Tanaka [Thu, 9 Jun 2016 20:41:02 +0000 (13:41 -0700)]
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>
8 years agoMerge pull request #1043 from stgraber/master
Christian Brauner [Tue, 7 Jun 2016 19:29:52 +0000 (21:29 +0200)]
Merge pull request #1043 from stgraber/master

Drop lxc-devsetup as unneeded by current autodev

8 years agoDrop lxc-devsetup as unneeded by current autodev
Stéphane Graber [Tue, 7 Jun 2016 19:10:24 +0000 (15:10 -0400)]
Drop lxc-devsetup as unneeded by current autodev

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #1042 from GreatFruitOmsk/python-rpath
Christian Brauner [Mon, 6 Jun 2016 10:49:27 +0000 (12:49 +0200)]
Merge pull request #1042 from GreatFruitOmsk/python-rpath

python-lxc: follow global rpath setting for autotools builds

8 years agopython-lxc: follow global rpath setting for autotools builds
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>
8 years agoMerge pull request #1040 from odyssey4me/include_apt_transport_https
Stéphane Graber [Fri, 3 Jun 2016 15:37:02 +0000 (11:37 -0400)]
Merge pull request #1040 from odyssey4me/include_apt_transport_https

Move apt-transport-https to global packages_template

8 years agoMove apt-transport-https to global packages_template
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.

Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
8 years agoMerge pull request #1037 from evgeni/lxc.service-simple
Stéphane Graber [Thu, 2 Jun 2016 13:44:31 +0000 (09:44 -0400)]
Merge pull request #1037 from evgeni/lxc.service-simple

start containers in foreground when using the lxc@.service

8 years agostart containers in foreground when using the lxc@.service
Evgeni Golov [Thu, 2 Jun 2016 13:38:47 +0000 (15:38 +0200)]
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>
8 years agoMerge pull request #1036 from GreatFruitOmsk/python-setuptools
Stéphane Graber [Tue, 31 May 2016 19:40:46 +0000 (15:40 -0400)]
Merge pull request #1036 from GreatFruitOmsk/python-setuptools

python-lxc: fix breakage caused by the switch to setuptools

8 years agopython-lxc: put egg-info into build directory
Aleksandr Mezin [Tue, 31 May 2016 11:36:23 +0000 (17:36 +0600)]
python-lxc: put egg-info into build directory

To keep source directory clean.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agopython-lxc: always set --root for install command
Aleksandr Mezin [Tue, 31 May 2016 11:33:59 +0000 (17:33 +0600)]
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>
8 years agoMerge pull request #1035 from GreatFruitOmsk/python-setuptools
Stéphane Graber [Tue, 31 May 2016 04:19:29 +0000 (00:19 -0400)]
Merge pull request #1035 from GreatFruitOmsk/python-setuptools

python-lxc: use setuptools instead of distutils

8 years agopython-lxc: use setuptools instead of distutils
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>
8 years agoMerge pull request #1034 from GreatFruitOmsk/master
Stéphane Graber [Sat, 28 May 2016 19:21:16 +0000 (15:21 -0400)]
Merge pull request #1034 from GreatFruitOmsk/master

python-lxc: change distribution name _lxc -> lxc

8 years agopython-lxc: change distribution name _lxc -> lxc
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>
8 years agoMerge pull request #1032 from GreatFruitOmsk/travis-vpath
Stéphane Graber [Fri, 27 May 2016 17:56:49 +0000 (13:56 -0400)]
Merge pull request #1032 from GreatFruitOmsk/travis-vpath

travis: test VPATH builds

8 years agoMerge pull request #1031 from GreatFruitOmsk/pypi
Stéphane Graber [Fri, 27 May 2016 17:55:40 +0000 (13:55 -0400)]
Merge pull request #1031 from GreatFruitOmsk/pypi

python-lxc: enable standalone builds

8 years agopython-lxc: search for lxc library and headers using pkg-config
Aleksandr Mezin [Fri, 27 May 2016 11:58:15 +0000 (17:58 +0600)]
python-lxc: search for lxc library and headers using pkg-config

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agotravis: ensure 'make install' doesn't fail
Aleksandr Mezin [Fri, 27 May 2016 15:40:13 +0000 (21:40 +0600)]
travis: ensure 'make install' doesn't fail

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agotravis: test VPATH builds
Aleksandr Mezin [Fri, 27 May 2016 12:47:23 +0000 (18:47 +0600)]
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>
8 years agopython-lxc: pass include/library dirs as arguments to setup.py
Aleksandr Mezin [Fri, 27 May 2016 09:38:42 +0000 (15:38 +0600)]
python-lxc: pass include/library dirs as arguments to setup.py

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agopython-lxc: don't use private lxc/confile.h
Aleksandr Mezin [Fri, 27 May 2016 09:13:18 +0000 (15:13 +0600)]
python-lxc: don't use private lxc/confile.h

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>