Commit Graph

4714 Commits

Author SHA1 Message Date
Sergio Schvezov
758243d8af 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>
2016-07-26 09:41:47 +02:00
Stéphane Graber
3dad8c43bf Merge pull request #1100 from brauner/2016-07-25/fix_cgfsng_lxcfs_and_cgroupfs_checkfuns
cgfsng: fix is_lxcfs() and is_cgroupfs()
2016-07-25 11:44:28 -04:00
Christian Brauner
2f62fb005b
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>
2016-07-25 17:17:39 +02:00
Christian Brauner
9d206b25f5 Merge pull request #1097 from jirutka/patch-1
lxc-alpine: mount tmpfs under /run
2016-07-23 21:31:24 +02:00
Jakub Jirutka
b5caaaa599
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>
2016-07-23 21:26:33 +02:00
Stéphane Graber
5429ec248a Merge pull request #1094 from brauner/2016-07-22/fix_android_lxc_copy
lxc-copy: do not use mkostemp and dprintf
2016-07-22 22:30:50 +02:00
Christian Brauner
a8e279fd53
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>
2016-07-22 21:59:24 +02:00
Stéphane Graber
bdf278a139 Merge pull request #1093 from brauner/2016-07-22/use_priu64
c/r: use PRIu64 format specifier
2016-07-22 17:10:20 +02:00
Christian Brauner
9b945f1320
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>
2016-07-22 11:16:43 +02:00
Stéphane Graber
3be6e5ff7c Merge pull request #1092 from LicoMonch/extend-debian-template
simple enhancements of lxc-debian-template-script
2016-07-21 22:50:44 +02:00
Andreas Freudenberg
ade83cbfd1 templates: make shellcheck (Ubuntu: 0.3.7-5 amd64) most possible happy
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:59:00 +02:00
Andreas Freudenberg
bf39edb39e templates: add more quotes to variables (at least $rootfs should now be covered)
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:58:49 +02:00
Andreas Freudenberg
e160e45018 templates: avoid noisy perl warnings caused by missing locales
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:58:19 +02:00
Christian Brauner
5de15f6ade Merge pull request #1091 from ysbnim/master
doc: Update Korean lxc-copy(1) to include tmpfs option
2016-07-20 11:10:25 +02:00
Sungbae Yoo
a84c8ed150 doc: Update Korean lxc-copy(1) to include tmpfs option
Update for commit a361e56

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-07-20 18:00:26 +09:00
Christian Brauner
1bb4c7a5cd Merge pull request #1074 from vel21ripn/vlan_mtu
Set up MTU for vlan-type interfaces.
2016-07-20 10:32:36 +02:00
Christian Brauner
0b327c3add Merge pull request #1090 from tenforward/japanese
doc: Update Japanese lxc-copy(1) to include tmpfs option
2016-07-20 10:13:28 +02:00
KATOH Yasufumi
53a92bbcb6 doc: Update Japanese lxc-copy(1) to include tmpfs option
Update for commit a361e56

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-07-20 16:03:34 +09:00
Christian Brauner
e4203378cc Merge pull request #1089 from tych0/ghost-limit
c/r: add support for ghost-limit in CRIU
2016-07-20 00:26:30 +02:00
Tycho Andersen
b2b7b0d223 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>
2016-07-19 14:27:26 -06:00
Serge Hallyn
bafda6b63b Merge pull request #1086 from brauner/detect_sigrtmin_3
[RFC]: lxccontainer: detect if we should send SIGRTMIN+3
2016-07-19 12:49:19 -05:00
Christian Brauner
330ae3d350
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>
2016-07-19 16:20:02 +02:00
Serge Hallyn
31c32ef270 Merge pull request #1087 from brauner/2016-07-16/clone_on_tmpfs
lxc-copy: update manpage to include tmpfs option
2016-07-19 08:07:47 -05:00
Christian Brauner
a361e56278
lxc-copy: update manpage to include tmpfs option
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-19 00:04:10 +02:00
Serge Hallyn
897dcac41f Merge pull request #1084 from brauner/2016-07-16/clone_on_tmpfs
lxc-copy: allow snapshots to be placed on tmpfs
2016-07-18 13:45:50 -05:00
Christian Brauner
60a77c1822
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>
2016-07-18 20:40:13 +02:00
Vitaly Lavrov
b4fb7de1b6 Set up MTU for vlan-type interfaces.
Signed-off-by: Vitaly Lavrov <vel21ripn@gmail.com>
2016-07-18 21:25:33 +03:00
Christian Brauner
8783532601 Merge pull request #1082 from adrianreber/master
c/r: make local function static
2016-07-15 11:23:10 +02:00
Adrian Reber
c33b0338fa 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>
2016-07-15 10:54:30 +02:00
Christian Brauner
41a8036745 Merge pull request #1072 from adrianreber/master
c/r: drop in-flight connections during CRIU dump
2016-07-13 23:16:49 +02:00
Adrian Reber
f195450384 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>
2016-07-12 14:09:17 +02:00
Stéphane Graber
a4abe1bbb5 Merge pull request #1078 from brauner/2016-07-11/add_cgns
add missing cgroup namespace to ns_info struct
2016-07-12 08:01:01 -04:00
Christian Brauner
9e390993d4 Merge pull request #1077 from adrianreber/init
c/r: initialize migrate_opts properly
2016-07-11 22:52:26 +02:00
Christian Brauner
ceecc92c42 add missing cgroup namespace to ns_info struct
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-11 22:48:48 +02:00
Adrian Reber
ebb088e115 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>
2016-07-11 22:03:07 +02:00
Serge Hallyn
c7d5c3e508 Merge pull request #1069 from rsampaio/rsampaio-nodev-dev
Add flag in mount_entry to skip NODEV in case of a persistent dev entry
2016-07-08 10:35:44 -05:00
Serge Hallyn
c80de904c9 Merge pull request #1073 from brauner/bugfix_branch
store criu version
2016-07-08 08:16:39 -05:00
Christian Brauner
b9aae26f1b Merge pull request #1075 from tych0/criu-action-script
c/r: add support for CRIU's --action-script
2016-07-08 01:11:27 +02:00
Tycho Andersen
b9ee6643cb c/r: add support for CRIU's --action-script
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-07-06 23:45:15 +00:00
Christian Brauner
5407e2abae 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>
2016-07-06 16:07:34 +02:00
Christian Brauner
a715a9bcb2 Merge pull request #1070 from hallyn/2016-07-01/fixcg
cgfsng: don't pre-calculate path
2016-07-02 08:01:26 +02:00
Serge Hallyn
0b6ca6e39b 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>
2016-07-01 21:18:38 -05:00
Rodrigo Vaz
ae7a770e0a Add flag in mount_entry to skip NODEV in case of a persistent dev entry
Signed-off-by: Rodrigo Vaz <rodrigo@heroku.com>
2016-07-01 18:34:11 -07:00
Christian Brauner
df5512e5df Merge pull request #1065 from stgraber/master
Fix typo found by lintian
2016-06-29 23:19:16 +02:00
Stéphane Graber
3f3fd9e2ba Fix typo found by lintian
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-29 16:56:41 -04:00
Stéphane Graber
279354fc03 Merge pull request #1064 from terceiro/fix-wheezy
lxc-debian: fix regression when creating wheezy containers
2016-06-29 14:08:48 -04:00
Antonio Terceiro
f95776dffa lxc-debian: fix regression when creating wheezy containers
The regression was introduced by commit
3c39b0b7a2 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>
2016-06-29 15:04:57 -03:00
Stéphane Graber
60cfbd8a92 apparmor: Refresh generated file
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-28 15:35:58 -04:00
Stéphane Graber
d6c86f57fa Merge pull request #1063 from pdsouza/pdsouza/fix-bionic-lxcmntent
Include all lxcmntent.h function declarations on Bionic
2016-06-28 13:36:46 -04:00
Preetam D'Souza
702f5a1c64 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>
2016-06-28 16:52:06 +00:00