]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
8 years agotests: add unit tests for lxc_string_replace()
Christian Brauner [Sat, 13 Aug 2016 20:38:52 +0000 (22:38 +0200)]
tests: add unit tests for lxc_string_replace()

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1128 from brauner/2016-08-14/fix_text_file_busy
Stéphane Graber [Sun, 14 Aug 2016 21:03:25 +0000 (23:03 +0200)]
Merge pull request #1128 from brauner/2016-08-14/fix_text_file_busy

tools: use fclose() after fdopen() + add newline

8 years agotools: use fclose() after fdopen() + add newline
Christian Brauner [Sat, 13 Aug 2016 23:01:04 +0000 (01:01 +0200)]
tools: use fclose() after fdopen() + add newline

So far we accidently used close() on the original file descriptor. (After
fdopen() the original fd is considered private and should not be used anymore.
The close operations should be performed on the new file handle. We did the
correct thing on error but not on success.) Using close() on the original fd
caused "Text file busy" errors and prevented the cloned tmpfs container from
starting.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1127 from brauner/2016-08-13/add_missing_newline
Serge Hallyn [Sat, 13 Aug 2016 15:21:57 +0000 (10:21 -0500)]
Merge pull request #1127 from brauner/2016-08-13/add_missing_newline

tools: add missing newline in lxc-create output

8 years agotools: add missing newline in lxc-create output
Christian Brauner [Sat, 13 Aug 2016 14:04:44 +0000 (16:04 +0200)]
tools: add missing newline in lxc-create output

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1125 from brauner/2016-08-12/smarter_btrfs_subvol_detection
Serge Hallyn [Sat, 13 Aug 2016 02:01:31 +0000 (21:01 -0500)]
Merge pull request #1125 from brauner/2016-08-12/smarter_btrfs_subvol_detection

bdev: be smarter about btrfs subvolume detection

8 years agoMerge pull request #1126 from brauner/2016-08-13/fix_runtime_path_for_lxc_ls
Serge Hallyn [Sat, 13 Aug 2016 02:00:12 +0000 (21:00 -0500)]
Merge pull request #1126 from brauner/2016-08-13/fix_runtime_path_for_lxc_ls

tools: use correct runtime path for lxc-ls

8 years agotools: use correct runtime path for lxc-ls
Christian Brauner [Fri, 12 Aug 2016 22:56:33 +0000 (00:56 +0200)]
tools: use correct runtime path for lxc-ls

So far we've simply been using RUNTIME_PATH for the privileged and unprivileged
case. We should actually use XDG_RUNTIME_DIR for the unprivileged case.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agobdev: be smarter about btrfs subvolume detection
Christian Brauner [Fri, 12 Aug 2016 19:07:34 +0000 (21:07 +0200)]
bdev: be smarter about btrfs subvolume detection

When a container c is on a btrfs filesystem but is directory backed, copying
the container will default to snapshot. This is because of
should_default_to_snapshot() returning true in this case because c is on a
btrfs filesystem. We should make sure that should_default_to_snapshot() only
returns true, when c itself is a btrfs subvolume.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1120 from tenforward/update_man
Christian Brauner [Fri, 12 Aug 2016 08:35:43 +0000 (10:35 +0200)]
Merge pull request #1120 from tenforward/update_man

Update English and Japanese lxc-attach(1)

8 years agodoc: Update Japanese lxc-attach(1)
KATOH Yasufumi [Fri, 12 Aug 2016 08:29:55 +0000 (17:29 +0900)]
doc: Update Japanese lxc-attach(1)

* Add undocumented options (-v/--set-var, --keep-var, -f/--rcfile)
* Change order of option in SYNOPSIS (-L that is placed after "command")
* Add long options in SYNOPSIS

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agodoc: Update lxc-attach(1)
KATOH Yasufumi [Fri, 12 Aug 2016 08:04:15 +0000 (17:04 +0900)]
doc: Update lxc-attach(1)

* Add undocumented options (-v/--set-var, --keep-var, -f/--rcfile)
* Change order of option in SYNOPSIS (-L that is placed after "command")
* Add long options in SYNOPSIS

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agoMerge pull request #1119 from brauner/2016-08-11/fix_log_output
Serge Hallyn [Fri, 12 Aug 2016 05:55:48 +0000 (00:55 -0500)]
Merge pull request #1119 from brauner/2016-08-11/fix_log_output

log: fix log_append_stderr()

8 years agolog: fix log_append_stderr()
Christian Brauner [Thu, 11 Aug 2016 21:10:17 +0000 (23:10 +0200)]
log: fix log_append_stderr()

Log output currently looks like this:

lxc-copy: debbdev/lxcdir.c: dir_clonepaths: 45 directories cannot be snapshotted.  Try aufs or overlayfs.

we rather want it to be:

lxc-copy: deb: bdev/lxcdir.c: dir_clonepaths: 45 directories cannot be snapshotted.  Try aufs or overlayfs.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1118 from brauner/2016-08-09/remove_readdir_r
Serge Hallyn [Thu, 11 Aug 2016 14:25:34 +0000 (09:25 -0500)]
Merge pull request #1118 from brauner/2016-08-09/remove_readdir_r

tree-wide: replace readdir_r() with readdir()

8 years agotree-wide: replace readdir_r() with readdir()
Christian Brauner [Tue, 9 Aug 2016 19:05:19 +0000 (21:05 +0200)]
tree-wide: replace readdir_r() with readdir()

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1116 from clandmeter/alpine-aarch64
Stéphane Graber [Sun, 7 Aug 2016 14:33:09 +0000 (16:33 +0200)]
Merge pull request #1116 from clandmeter/alpine-aarch64

templates: add support for new arch on Alpine Linux

8 years agotemplates: add support for new arch on Alpine Linux
Carlo Landmeter [Sun, 7 Aug 2016 09:21:05 +0000 (09:21 +0000)]
templates: add support for new arch on Alpine Linux

Signed-off-by: Carlo Landmeter <clandmeter@gmail.com>
8 years agoMerge pull request #1114 from Blub/lxc-attach-f
Christian Brauner [Thu, 4 Aug 2016 22:58:24 +0000 (00:58 +0200)]
Merge pull request #1114 from Blub/lxc-attach-f

lxc-attach: add -f option & cleanup

8 years agowhitespace cleanup
Wolfgang Bumiller [Thu, 4 Aug 2016 09:28:37 +0000 (11:28 +0200)]
whitespace cleanup

The rest of this block uses spaces instead of tabs already.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agoadd -f option to lxc-attach
Wolfgang Bumiller [Thu, 4 Aug 2016 09:23:54 +0000 (11:23 +0200)]
add -f option to lxc-attach

Otherwise a container with a non-standard configuration file
can be started but not attached to.
Fixes the following case:
 # lxc-start -n ct -f /different/path/my.config
 # lxc-attach -n ct
 Error: container ct is not defined

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agoMerge pull request #1111 from ysbnim/master
Christian Brauner [Tue, 2 Aug 2016 08:11:49 +0000 (10:11 +0200)]
Merge pull request #1111 from ysbnim/master

doc: Add documentation of lxc.syslog to Korean lxc.container.conf(5)

8 years agodoc: Add documentation of lxc.syslog to Korean lxc.container.conf(5)
Sungbae Yoo [Tue, 2 Aug 2016 02:44:12 +0000 (11:44 +0900)]
doc: Add documentation of lxc.syslog to Korean lxc.container.conf(5)

Update for commit 204dfdf

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agoMerge pull request #1109 from brauner/2016-07-31/append_to_search_path
Stéphane Graber [Mon, 1 Aug 2016 19:05:12 +0000 (21:05 +0200)]
Merge pull request #1109 from brauner/2016-07-31/append_to_search_path

partially reorganize repo

8 years agoMerge pull request #1110 from tenforward/japanese
Christian Brauner [Mon, 1 Aug 2016 11:57:24 +0000 (13:57 +0200)]
Merge pull request #1110 from tenforward/japanese

doc: Add documentation of lxc.syslog to Japanese lxc.container.conf(5)

8 years agodoc: Add documentation of lxc.syslog to Japanese lxc.container.conf(5)
KATOH Yasufumi [Mon, 1 Aug 2016 11:46:16 +0000 (20:46 +0900)]
doc: Add documentation of lxc.syslog to Japanese lxc.container.conf(5)

and add local6 to valid facility

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agotools, tests: reorganize repo
Christian Brauner [Sun, 31 Jul 2016 10:40:49 +0000 (12:40 +0200)]
tools, tests: reorganize repo

- tools: move lxc commands to common subfolder
- tests: adapt include search path

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agocgroups: move cgroup files to common subfolder
Christian Brauner [Sun, 31 Jul 2016 10:21:58 +0000 (12:21 +0200)]
cgroups: move cgroup files to common subfolder

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agobdev: add subdirectories to search path
Christian Brauner [Sun, 31 Jul 2016 10:04:28 +0000 (12:04 +0200)]
bdev: add subdirectories to search path

This allows us to avoid using relative includes which is cleaner in the long
run when we create subdirectories for other components of liblxc.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1105 from bapt/syslog
Christian Brauner [Fri, 29 Jul 2016 23:23:42 +0000 (01:23 +0200)]
Merge pull request #1105 from bapt/syslog

Add syslog support

8 years agoAdd documentation for the new syslog logging mechanism
Baptiste Daroussin [Fri, 29 Jul 2016 14:21:59 +0000 (16:21 +0200)]
Add documentation for the new syslog logging mechanism

Signed-off-by: Baptiste Daroussin <bapt@gandi.net>
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 #1108 from brauner/2016-07-29/fix_android_part_n
Stéphane Graber [Fri, 29 Jul 2016 06:35:26 +0000 (08:35 +0200)]
Merge pull request #1108 from brauner/2016-07-29/fix_android_part_n

criu: replace tmpnam() with mkstemp()

8 years agocriu: replace tmpnam() with mkstemp()
Christian Brauner [Thu, 28 Jul 2016 22:53:53 +0000 (00:53 +0200)]
criu: replace tmpnam() with mkstemp()

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoMerge pull request #1106 from Blub/next
Christian Brauner [Thu, 28 Jul 2016 14:52:05 +0000 (16:52 +0200)]
Merge pull request #1106 from Blub/next

conf: set pty_info to NULL after free

8 years agoconf: set pty_info to NULL after free
Wolfgang Bumiller [Thu, 28 Jul 2016 09:52:18 +0000 (11:52 +0200)]
conf: set pty_info to NULL after free

This fixes a double free corruption on container-requested
reboots when lxc_spawn() fails before receiving the ttys, as
lxc_fini() (part of __lxc_start()'s cleanup) calls
lxc_delete_tty().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
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>