]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 years agoutils: add lxc_safe_long_long()
Christian Brauner [Wed, 18 Oct 2017 17:53:17 +0000 (19:53 +0200)]
utils: add lxc_safe_long_long()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoringbuf: implement simple and efficient ringbuffer
Christian Brauner [Wed, 18 Oct 2017 12:19:31 +0000 (14:19 +0200)]
ringbuf: implement simple and efficient ringbuffer

liblxc will use a ringbuffer implementation that employs mmap()ed memory.
Specifically, the ringbuffer will create an anonymous memory mapping twice the
requested size for the ringbuffer. Afterwards, an in-memory file the requested
size for the ringbuffer will be created. This in-memory file will then be
memory mapped twice into the previously established anonymous memory mapping
thereby effectively splitting the anoymous memory mapping in two halves of
equal size.  This will allow the ringbuffer to get rid of any complex boundary
and wrap-around calculation logic. Since the underlying physical memory is the
same in both halves of the memory mapping only a single memcpy() call for both
reads and writes from and to the ringbuffer is needed.

Design Notes:
- Since we're using MAP_FIXED memory mappings to map the same in-memory file
  twice into the anonymous memory mapping the kernel requires us to always
  operate on properly aligned pages. To guarantee proper page aligment the size
  of the ringbuffer must always be a muliple of the kernel's page size. This
  also implies that the minimum size of the ringbuffer must be at least equal to
  one page size. This additional requirement is reasonably unproblematic.
  First, any ringbuffer smaller than the size of a single page is very likely
  useless since the standard page size on linux is 4096 bytes.
- Because liblxc is not able to predict the output a user is going to produce
  (e.g. users could cat binary files onto the console) and because the
  ringbuffer is located in a hotpath and needs to be as performant as possible
  liblxc will not parse the buffer.

Use Case:
The ringbuffer is needed by liblxc in order to safely log the output of write
intensive callers that produce unpredictable output or unpredictable amounts of
output. The console output created by a booting system and the user is one of
those cases. Allowing a container to log the console's output to a file it
would be possible for a malicious user to fill up the host filesystem by
producing random ouput on the container's console if quota support is either
not enabled or not available for the underlying filesystem. Using a ringbuffer
is a reliable and secure way to ensure a fixed-size log.

Closes #1857.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: add lxc_getpagesize()
Christian Brauner [Sat, 21 Oct 2017 14:22:58 +0000 (16:22 +0200)]
utils: add lxc_getpagesize()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: add lxc_make_tmpfile()
Christian Brauner [Wed, 18 Oct 2017 17:48:57 +0000 (19:48 +0200)]
utils: add lxc_make_tmpfile()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: add lxc_cloexec()
Christian Brauner [Wed, 18 Oct 2017 17:48:29 +0000 (19:48 +0200)]
utils: add lxc_cloexec()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: move memfd_create() definition
Christian Brauner [Wed, 18 Oct 2017 11:36:36 +0000 (13:36 +0200)]
utils: move memfd_create() definition

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1866 from geaaru/fix-sabayon-unpriv-master
Christian Brauner [Fri, 20 Oct 2017 09:31:42 +0000 (11:31 +0200)]
Merge pull request #1866 from geaaru/fix-sabayon-unpriv-master

Fix start of Sabayon unprivileged containers

7 years agoFix start of Sabayon unprivileged containers
Geaaru [Fri, 20 Oct 2017 07:15:18 +0000 (09:15 +0200)]
Fix start of Sabayon unprivileged containers

Problem happens for image with systemd >=233.
Minor fix for mirrors list.

Signed-off-by: Geaaru <geaaru@gmail.com>
7 years agoMerge pull request #1860 from kilobyte/master
Christian Brauner [Wed, 18 Oct 2017 22:25:16 +0000 (00:25 +0200)]
Merge pull request #1860 from kilobyte/master

fix build failures on x32

7 years agoMerge pull request #1862 from fridtjof/patch-1
Christian Brauner [Tue, 17 Oct 2017 15:04:46 +0000 (17:04 +0200)]
Merge pull request #1862 from fridtjof/patch-1

Change locale "en-US.UTF-8" to "en_US.UTF-8"

7 years agoChange locale "en-US.UTF-8" to "en_US.UTF-8"
Fridtjof Mund [Tue, 17 Oct 2017 10:38:09 +0000 (12:38 +0200)]
Change locale "en-US.UTF-8" to "en_US.UTF-8"

This template would always add "en-US.UTF-8" to the end of the container's locale.gen, which in turn confused locale-gen.

Signed-off-by: Fridtjof Mund <fridtjofmund@gmail.com>
7 years agoMerge pull request #1861 from brauner/2017-10-16/fix_log_stack_smash
Serge Hallyn [Mon, 16 Oct 2017 13:40:16 +0000 (08:40 -0500)]
Merge pull request #1861 from brauner/2017-10-16/fix_log_stack_smash

log: bugfixes

7 years agoUse the proper type for rlim_t, fixing build failure on x32.
Adam Borowski [Sun, 15 Oct 2017 19:20:34 +0000 (19:20 +0000)]
Use the proper type for rlim_t, fixing build failure on x32.

Assuming a particular width of a type (or equivalence with "long") doesn't
work everywhere.  On new architectures, LFS/etc is enabled by default,
making rlim_t same as rlim64_t even if long is only 32-bit.

Not sure how you handle too big values -- you may want to re-check the
strtoull part.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
7 years agoFix a format string build failure on x32.
Adam Borowski [Sun, 15 Oct 2017 19:09:03 +0000 (19:09 +0000)]
Fix a format string build failure on x32.

Both of struct timespec fields are 64-bit on any new architecture, even
32-bit ones.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
7 years agoconf: error out on too many mappings
Christian Brauner [Mon, 16 Oct 2017 10:50:49 +0000 (12:50 +0200)]
conf: error out on too many mappings

The kernel only allows 4k writes to most files in /proc including {g,u}id_map
so let's not try to write partial mappings. (This will obviously become a lot
more relevant when my patch to extend the idmap limit in the kernel is merged.)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolog: prevent stack smashing
Christian Brauner [Mon, 16 Oct 2017 10:22:20 +0000 (12:22 +0200)]
log: prevent stack smashing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1856 from brauner/2017-10-12/preserve_abi_compatibility
Stéphane Graber [Thu, 12 Oct 2017 15:23:56 +0000 (11:23 -0400)]
Merge pull request #1856 from brauner/2017-10-12/preserve_abi_compatibility

lxccontainer: preserve ABI compatibility

7 years agolxccontainer: preserve ABI compatibility
Christian Brauner [Thu, 12 Oct 2017 15:12:38 +0000 (17:12 +0200)]
lxccontainer: preserve ABI compatibility

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1855 from brauner/2017-10-12/append_devel_to_version
Stéphane Graber [Thu, 12 Oct 2017 13:14:09 +0000 (09:14 -0400)]
Merge pull request #1855 from brauner/2017-10-12/append_devel_to_version

arguments: print "-devel" when LXC_DEVEL is true

7 years agoarguments: print "-devel" when LXC_DEVEL is true
Christian Brauner [Thu, 12 Oct 2017 08:06:46 +0000 (10:06 +0200)]
arguments: print "-devel" when LXC_DEVEL is true

liblxc should inform users that they are using a devel version. This will have
liblxc print

    MAJOR.MINOR.PATCH-devel

if LXC_DEVEL is true and

    MAJOR.MINOR.PATCH

otherwise.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1851 from brauner/2017-10-10/setsid_for_mini_init
Serge Hallyn [Wed, 11 Oct 2017 20:21:54 +0000 (15:21 -0500)]
Merge pull request #1851 from brauner/2017-10-10/setsid_for_mini_init

init: rework dumb init

7 years agoMerge pull request #1852 from brauner/2017-10-11/container_live_patching
Serge Hallyn [Wed, 11 Oct 2017 20:20:25 +0000 (15:20 -0500)]
Merge pull request #1852 from brauner/2017-10-11/container_live_patching

POC: container live patching

7 years agotests: test container live patching
Christian Brauner [Wed, 11 Oct 2017 10:13:08 +0000 (12:13 +0200)]
tests: test container live patching

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxccontainer: implement container live patching
Christian Brauner [Wed, 11 Oct 2017 09:13:53 +0000 (11:13 +0200)]
lxccontainer: implement container live patching

This adds set_running_config_item() which is the analogue of
get_running_config_item(). In essence it allows a caller to livepatch the
container's in-memory configuration. This POC is severly limited. Here are the
most obvious ones:
- Only the container's in-memory config can be updated but no further actions
  (e.g. on-disk actions) are made.
- Only keys in the "lxc.net." namespace can be changed. This POC also allows
  updating an existing network. For example it allows to change the network
  type of an existing network. This is obviously nonsense and in a non-POC
  implementation this should be blocked.

Use Case:
Callers can hotplug a new network for the container. For example, LXD can
create a pair of veth devices in the host and in the container and add it to
the container's in-memory config. This means, the container can later be
queried for the name of the device later on etc. Note that liblxc will
currently not delete hotplugged network devices on container shutdown since it
won't have the ifindex of the container.

Relates to https://github.com/lxc/lxd/issues/3920 .

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoinit: rework dumb init
Christian Brauner [Tue, 10 Oct 2017 14:53:25 +0000 (16:53 +0200)]
init: rework dumb init

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1849 from brauner/2017-10-10/update_config
Serge Hallyn [Tue, 10 Oct 2017 14:28:53 +0000 (09:28 -0500)]
Merge pull request #1849 from brauner/2017-10-10/update_config

confile: make update warning opt-in

7 years agoinit: become session leader
Christian Brauner [Tue, 10 Oct 2017 13:53:11 +0000 (15:53 +0200)]
init: become session leader

Before exec()ing we need to become session leader otherwise some shells will
not be able to correctly initialize job control.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: make update warning opt-in
Christian Brauner [Tue, 10 Oct 2017 12:35:40 +0000 (14:35 +0200)]
confile: make update warning opt-in

With the release LXC 2.1 we started warning users who use LXC through the API
and users who use LXC through the tools equally about updating their config.
This quickly got confusing and annoying to API users who e.g. generate configs
on the fly (e.g. LXD). So instead of unconditionally warning users we make this
opt-in. If LXC detects that the env variable LXC_UPDATE_CONFIG_FORMAT is set
then it will warn the user if any legacy configuration keys are present. If it
is not set however, it will not warn the user. This is ok, since the log will
still log WARN()s for all legacy configuration keys.
The tools will all set LXC_UPDATE_CONFIG_FORMAT since it is very much required
that users update to the new configuration format pre-LXC 3.0.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1718 from agaida/patch-1
Stéphane Graber [Fri, 6 Oct 2017 20:37:13 +0000 (16:37 -0400)]
Merge pull request #1718 from agaida/patch-1

Don't force getty@ configuration

7 years agoMerge pull request #1846 from tenforward/japanese
Christian Brauner [Fri, 6 Oct 2017 14:50:59 +0000 (16:50 +0200)]
Merge pull request #1846 from tenforward/japanese

Add lxc.hook.start-host and lxc.execute.cmd to Japanese man page

7 years agodoc: Update lxc.{execute,init}.cmd in lxc.container.conf(5)
KATOH Yasufumi [Fri, 6 Oct 2017 10:40:53 +0000 (19:40 +0900)]
doc: Update lxc.{execute,init}.cmd in lxc.container.conf(5)

* Add lxc.execute.cmd to Japanese lxc.container.conf(5)
* Tweak the description of the "INIT COMMAND" section and lxc.init.cmd
  in en and ja man pages.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agodoc: Add lxc.hook.start-host to Japanese lxc.container.conf(5)
KATOH Yasufumi [Fri, 6 Oct 2017 10:23:48 +0000 (19:23 +0900)]
doc: Add lxc.hook.start-host to Japanese lxc.container.conf(5)

Update for commit 08dd280543e1013dc1a47176167a9572b5450eb8

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agoMerge pull request #1844 from hallyn/2017-10-04/quote
Christian Brauner [Thu, 5 Oct 2017 17:30:12 +0000 (19:30 +0200)]
Merge pull request #1844 from hallyn/2017-10-04/quote

implement lxc_string_split_quoted

7 years agoMerge pull request #1845 from brauner/2017-10-05/lxc-update-config_update
Serge Hallyn [Thu, 5 Oct 2017 16:05:17 +0000 (11:05 -0500)]
Merge pull request #1845 from brauner/2017-10-05/lxc-update-config_update

confile: ignore lxc.kmsg and lxc.pivotdir

7 years agoconfile: ignore lxc.kmsg and lxc.pivotdir
Christian Brauner [Thu, 5 Oct 2017 08:08:00 +0000 (10:08 +0200)]
confile: ignore lxc.kmsg and lxc.pivotdir

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotools: remove lxc.pivotdir and lxc.kmsg entries
Christian Brauner [Thu, 5 Oct 2017 07:55:50 +0000 (09:55 +0200)]
tools: remove lxc.pivotdir and lxc.kmsg entries

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoimplement lxc_string_split_quoted
Serge Hallyn [Wed, 4 Oct 2017 05:14:00 +0000 (05:14 +0000)]
implement lxc_string_split_quoted

lxc_string_split_quoted() splits a string on spaces, but keeps
groups in single or double qoutes together.  In other words,
generally what we'd want for argv behavior.

Switch lxc-execute to use this for lxc.execute.cmd.

Switch lxc-oci template to put the lxc.execute.cmd inside single
quotes, because parse_line() will eat those.  If we don't do that,
then if we have lxc.execute.cmd = /bin/echo "hello, world", then the
last double quote will disappear.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
7 years agoMerge pull request #1839 from hallyn/2017-10-02/oci
Christian Brauner [Tue, 3 Oct 2017 22:28:59 +0000 (00:28 +0200)]
Merge pull request #1839 from hallyn/2017-10-02/oci

Add OCI container creation template

7 years agoAdd OCI container creation template
Serge Hallyn [Sat, 5 Aug 2017 16:24:25 +0000 (11:24 -0500)]
Add OCI container creation template

Closes #1813

This adds preliminary (but working) support for creating application
containers from OCI formats.  Examples:

create a container from a local OCI layout in ../oci:

    sudo lxc-create -t oci -n a1 -- -u oci:../oci:alpine

Or, create a container pulling from the docker hub.

    sudo lxc-create -t oci -n u1 -- -u docker://ubuntu

The url is specified in the same format as for 'skopeo copy'.

Comments appreciated.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
7 years agoMerge pull request #1840 from tych0/drop-useless-denies
Christian Brauner [Tue, 3 Oct 2017 16:11:37 +0000 (12:11 -0400)]
Merge pull request #1840 from tych0/drop-useless-denies

drop useless apparmor denies

7 years agodrop useless apparmor denies
Tycho Andersen [Tue, 3 Oct 2017 05:00:21 +0000 (23:00 -0600)]
drop useless apparmor denies

mem and kmem are really in /dev, so this does us no good.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
7 years agosupport lxc.execute.cmd container configuration option
Serge Hallyn [Mon, 2 Oct 2017 20:23:34 +0000 (20:23 +0000)]
support lxc.execute.cmd container configuration option

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
7 years agoMerge pull request #1838 from brauner/2017-10-01/network_fix_reboot
Serge Hallyn [Mon, 2 Oct 2017 19:05:14 +0000 (14:05 -0500)]
Merge pull request #1838 from brauner/2017-10-01/network_fix_reboot

 network: clear ifindeces

7 years agonetwork: clear ifindeces
Christian Brauner [Sun, 1 Oct 2017 05:27:34 +0000 (07:27 +0200)]
network: clear ifindeces

We need to clear any ifindeces we recorded so liblxc won't have cached stale
data which would cause it to fail on reboot we're we don't re-read the on-disk
config file.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetwork: non-functional changes
Christian Brauner [Sun, 1 Oct 2017 05:27:00 +0000 (07:27 +0200)]
network: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetwork: use single helper to delete networks
Christian Brauner [Sun, 1 Oct 2017 05:12:51 +0000 (07:12 +0200)]
network: use single helper to delete networks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1826 from hallyn/2017-09-21.pre-start-host
Serge Hallyn [Sun, 1 Oct 2017 01:16:42 +0000 (20:16 -0500)]
Merge pull request #1826 from hallyn/2017-09-21.pre-start-host

add a pre-start-host hook

7 years agoadd a start-host hook (v2)
Serge Hallyn [Wed, 20 Sep 2017 21:22:46 +0000 (21:22 +0000)]
add a start-host hook (v2)

This should satisfy several use cases.  The one I tested for was CNI.
I replaced the network configuration in a root owned container with:

lxc.net.0.type = empty
lxc.hook.start-host = /bin/lxc-start-netns

where /bin/lxc-start-netns contained:

=================================

echo "starting" > /tmp/debug
ip link add host1 type veth peer name peer1
ip link set host1 master lxcbr0
ip link set host1 up
ip link set peer1 netns "${LXC_PID}"
=================================

The nic 'peer1' was placed into the container as expected.

For this to work, we pass the container init's pid as LXC_PID in
an environment variable, since lxc-info cannot work at that point.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
7 years agoMerge pull request #1836 from lifeng68/ns_share_pid
Serge Hallyn [Fri, 29 Sep 2017 15:07:44 +0000 (10:07 -0500)]
Merge pull request #1836 from lifeng68/ns_share_pid

Add support share pid namespace

7 years agoAdd support share pid namespace
LiFeng [Fri, 29 Sep 2017 11:53:43 +0000 (19:53 +0800)]
Add support share pid namespace

Signed-off-by: LiFeng <lifeng68@huawei.com>
7 years agoMerge pull request #1835 from brauner/2017-09-28/share_namespaces
Christian Brauner [Thu, 28 Sep 2017 14:38:26 +0000 (10:38 -0400)]
Merge pull request #1835 from brauner/2017-09-28/share_namespaces

start: don't close inherited namespace fds

7 years agostart: don't close inherited namespace fds
LiFeng [Thu, 28 Sep 2017 16:23:30 +0000 (00:23 +0800)]
start: don't close inherited namespace fds

Otherwise we can never share namespaces.

Signed-off-by: LiFeng <lifeng68@huawei.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1833 from brauner/2017-09-27/check_for_initialized_conf
Stéphane Graber [Wed, 27 Sep 2017 21:50:14 +0000 (17:50 -0400)]
Merge pull request #1833 from brauner/2017-09-27/check_for_initialized_conf

cgfsng: check whether we have a conf

7 years agocgfsng: check whether we have a conf
Christian Brauner [Wed, 27 Sep 2017 16:24:42 +0000 (18:24 +0200)]
cgfsng: check whether we have a conf

We can't rely in general on the presence of an initialized conf on cgroup init
time. One good example are our criu codepaths.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1830 from tenforward/japanese
Christian Brauner [Mon, 25 Sep 2017 13:25:09 +0000 (09:25 -0400)]
Merge pull request #1830 from tenforward/japanese

doc: Translate lxc-update-config(1) into Japanese

7 years agodoc: Translate lxc-update-config(1) into Japanese
KATOH Yasufumi [Mon, 25 Sep 2017 11:14:57 +0000 (20:14 +0900)]
doc: Translate lxc-update-config(1) into Japanese

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agoMerge pull request #1828 from brauner/2017-09-23/storage_driver_lvm_fix_thinpool
Stéphane Graber [Sun, 24 Sep 2017 22:26:55 +0000 (18:26 -0400)]
Merge pull request #1828 from brauner/2017-09-23/storage_driver_lvm_fix_thinpool

lvm: fix thinpool logical volumes

7 years agolvm: fix thinpool logical volumes
Christian Brauner [Sat, 23 Sep 2017 20:32:25 +0000 (22:32 +0200)]
lvm: fix thinpool logical volumes

Closes #1827.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1819 from brauner/2017-09-19/lxc-update-config_manpage
Stéphane Graber [Wed, 20 Sep 2017 17:03:23 +0000 (13:03 -0400)]
Merge pull request #1819 from brauner/2017-09-19/lxc-update-config_manpage

doc: add lxc-update-config manpage

7 years agoMerge pull request #1821 from brauner/2017-09-19/fail_on_when_setting_limits_on_unava...
Stéphane Graber [Wed, 20 Sep 2017 17:03:06 +0000 (13:03 -0400)]
Merge pull request #1821 from brauner/2017-09-19/fail_on_when_setting_limits_on_unavailable_controllers

cgfsng: fail when limits fail to apply

7 years agoMerge pull request #1824 from brauner/2017-09-20/fix_best_option
Stéphane Graber [Wed, 20 Sep 2017 15:42:33 +0000 (11:42 -0400)]
Merge pull request #1824 from brauner/2017-09-20/fix_best_option

zfs: return error directly when zfs creation fails

7 years agozfs: return error directly when zfs creation fails
Christian Brauner [Wed, 20 Sep 2017 08:13:30 +0000 (10:13 +0200)]
zfs: return error directly when zfs creation fails

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1822 from tenforward/japanese
Christian Brauner [Tue, 19 Sep 2017 16:07:28 +0000 (10:07 -0600)]
Merge pull request #1822 from tenforward/japanese

doc: fix regex-typo in Japanese and Korean lxc-monitor(1)

7 years agodoc: fix regex-typo in Japanese and Korean lxc-monitor(1)
KATOH Yasufumi [Tue, 19 Sep 2017 15:51:03 +0000 (00:51 +0900)]
doc: fix regex-typo in Japanese and Korean lxc-monitor(1)

Update for commit e3dd06ef41b63d0ee362fea74a3f2d798dbfe929

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agocgfsng: fail when limits fail to apply
Christian Brauner [Tue, 19 Sep 2017 14:24:37 +0000 (16:24 +0200)]
cgfsng: fail when limits fail to apply

So far, we silently skipped over limits that failed to be applied which is very
odd. Let's error on when cgroup limits fail to apply.

Closes #1815.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agodoc: add lxc-update-config manpage
Christian Brauner [Tue, 19 Sep 2017 10:41:24 +0000 (12:41 +0200)]
doc: add lxc-update-config manpage

Closes #1818.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1817 from stgraber/master
Christian Brauner [Tue, 19 Sep 2017 08:41:02 +0000 (02:41 -0600)]
Merge pull request #1817 from stgraber/master

Fix typo

7 years agoMerge pull request #1811 from runejuhl/fix-alpine-apk-keys
Stéphane Graber [Mon, 18 Sep 2017 23:05:13 +0000 (19:05 -0400)]
Merge pull request #1811 from runejuhl/fix-alpine-apk-keys

Change alpine template file check to also check file size (`-f` => `-s`)

7 years agoFix typo
Stéphane Graber [Mon, 18 Sep 2017 23:03:48 +0000 (19:03 -0400)]
Fix typo

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1816 from stgraber/master
Christian Brauner [Mon, 18 Sep 2017 22:30:54 +0000 (16:30 -0600)]
Merge pull request #1816 from stgraber/master

tests: Support systemd hybrid cgroups

7 years agotests: Support systemd hybrid cgroups
Stéphane Graber [Fri, 12 May 2017 16:28:20 +0000 (12:28 -0400)]
tests: Support systemd hybrid cgroups

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoChange file check to also check file size (`-f` => `-s`)
Rune Juhl Jacobsen [Mon, 18 Sep 2017 17:56:42 +0000 (19:56 +0200)]
Change file check to also check file size (`-f` => `-s`)

Because the `fetch` wget wrapper outputs files to stdout we may end up in a
situation where wget fails but the files are still created. This can happen
e.g. when the host date is out of sync leading to a failed certificate
check, resulting in the creation of empty key files.

Once the empty files have been created the template will try to use them which
causes the certificate check to fail.

By using `-s` instead of `-f` the template will re-fetch the files unless they
exist AND have a size greater than zero.

Signed-off-by: Rune Juhl Jacobsen <runejuhl@petardo.dk>
7 years agoMerge pull request #1805 from tenforward/fix_plamo
Stéphane Graber [Mon, 18 Sep 2017 16:45:35 +0000 (09:45 -0700)]
Merge pull request #1805 from tenforward/fix_plamo

plamo: Delete unnecessary process during container shutdown

7 years agoMerge pull request #1810 from brauner/2017-09-12/start_move_env_setup
Stéphane Graber [Mon, 18 Sep 2017 16:45:17 +0000 (09:45 -0700)]
Merge pull request #1810 from brauner/2017-09-12/start_move_env_setup

start: pass LXC_LOG_LEVEL to hooks

7 years agoutils: fix lxc_popen()/lxc_pclose()
Christian Brauner [Wed, 13 Sep 2017 15:07:43 +0000 (17:07 +0200)]
utils: fix lxc_popen()/lxc_pclose()

- rework and fix pipe fd leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: duplicate stderr as well in lxc_popen()
Christian Brauner [Wed, 13 Sep 2017 03:25:22 +0000 (05:25 +0200)]
utils: duplicate stderr as well in lxc_popen()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agodoc: document missing env variables
Christian Brauner [Wed, 13 Sep 2017 03:05:03 +0000 (05:05 +0200)]
doc: document missing env variables

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostart: pass LXC_LOG_LEVEL to hooks
Christian Brauner [Wed, 13 Sep 2017 03:02:50 +0000 (05:02 +0200)]
start: pass LXC_LOG_LEVEL to hooks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1809 from brauner/2017-09-12/start_move_env_setup
Stéphane Graber [Wed, 13 Sep 2017 02:14:27 +0000 (19:14 -0700)]
Merge pull request #1809 from brauner/2017-09-12/start_move_env_setup

start: set environment variables correctly

7 years agostart: set environment variables correctly
Christian Brauner [Wed, 13 Sep 2017 02:01:41 +0000 (04:01 +0200)]
start: set environment variables correctly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1807 from brauner/2017-09-12/start_move_env_setup
Stéphane Graber [Wed, 13 Sep 2017 00:11:13 +0000 (17:11 -0700)]
Merge pull request #1807 from brauner/2017-09-12/start_move_env_setup

start: move env setup before container setup

7 years agostart: move env setup before container setup
Christian Brauner [Tue, 12 Sep 2017 19:23:17 +0000 (21:23 +0200)]
start: move env setup before container setup

The hooks (e.g. lxc.hook.mount) should have the environment variables the user
gave us available.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1806 from roques/patch-1
Christian Brauner [Tue, 12 Sep 2017 17:15:18 +0000 (10:15 -0700)]
Merge pull request #1806 from roques/patch-1

[TRIVIAL] fix regex-typo in documentation example

7 years agofix regex-typo in lxc-monitor.sgml.in
Christian von Roques [Tue, 12 Sep 2017 10:31:23 +0000 (12:31 +0200)]
fix regex-typo in lxc-monitor.sgml.in

To match names beginning with the letters "f" or "b" one can use
the regular expression "[fb].*" or "(f|b).*", but not "[f|b].*",
which would match strings beginning with "f", "|", or "b".

Signed-off-by: Christian von Roques <roques@z12.ch>
7 years agoplamo: Delete unnecessary process during container shutdown
KATOH Yasufumi [Tue, 12 Sep 2017 06:29:34 +0000 (15:29 +0900)]
plamo: Delete unnecessary process during container shutdown

Since some remounts/umounts is executed in the plamo shutdown script,
the filesystem on where a container exists might be mount as
read-only. This patch delete some mounts and umounts from the shutdown
script. It also delete hwclock setting process.

And delete an unncecessary output.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agoMerge pull request #1803 from brauner/2017-09-10/lxc_execute_switch_ids_last
Serge Hallyn [Mon, 11 Sep 2017 20:27:58 +0000 (13:27 -0700)]
Merge pull request #1803 from brauner/2017-09-10/lxc_execute_switch_ids_last

start: switch ids at last possible instance

7 years agostorage: avoid segfault
Christian Brauner [Mon, 11 Sep 2017 01:30:00 +0000 (03:30 +0200)]
storage: avoid segfault

When the "lxc.rootfs.path" property is not set and users request a container
copy we would segfault since strstr() would be called on a NULL pointer.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostart: switch ids at last possible instance
Christian Brauner [Mon, 11 Sep 2017 01:16:06 +0000 (03:16 +0200)]
start: switch ids at last possible instance

This is technically not necessary but it is a privilege sensitive operation.
Meaning if anyone wants to do something that requires privilege it should be
done before the id switch. So let's move the id switch immediately before the
exec so that it's called at the last possible moment.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1801 from brauner/2017-09-09/userns_exec
Serge Hallyn [Sun, 10 Sep 2017 23:42:54 +0000 (18:42 -0500)]
Merge pull request #1801 from brauner/2017-09-09/userns_exec

conf: add userns_exec_full()

7 years agoexecute: enable console & standard /dev symlinks
Christian Brauner [Sun, 10 Sep 2017 11:49:18 +0000 (13:49 +0200)]
execute: enable console & standard /dev symlinks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: preserve newlines
Christian Brauner [Sun, 10 Sep 2017 07:38:57 +0000 (09:38 +0200)]
confile: preserve newlines

Users were confused when the config file created during cloning or copying a
container suddenly missed all newlines. Let's keep them.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetwork: remove dead assignments
Christian Brauner [Sun, 10 Sep 2017 06:23:59 +0000 (08:23 +0200)]
network: remove dead assignments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-user-nic: remove double initialization
Christian Brauner [Sun, 10 Sep 2017 06:23:36 +0000 (08:23 +0200)]
lxc-user-nic: remove double initialization

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: lxc_popen() remove dead assignments
Christian Brauner [Sun, 10 Sep 2017 06:09:52 +0000 (08:09 +0200)]
utils: lxc_popen() remove dead assignments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotests: avoid NULL pointer dereference
Christian Brauner [Sun, 10 Sep 2017 06:09:05 +0000 (08:09 +0200)]
tests: avoid NULL pointer dereference

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotests: remove dead assignments
Christian Brauner [Sun, 10 Sep 2017 06:06:26 +0000 (08:06 +0200)]
tests: remove dead assignments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc_usernsexec: remove dead assignments
Christian Brauner [Sun, 10 Sep 2017 06:03:06 +0000 (08:03 +0200)]
lxc_usernsexec: remove dead assignments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-unshare: do not pass NULL pointer
Christian Brauner [Sun, 10 Sep 2017 06:01:31 +0000 (08:01 +0200)]
lxc-unshare: do not pass NULL pointer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: parse_idmaps() remove dead assignments
Christian Brauner [Sun, 10 Sep 2017 06:00:50 +0000 (08:00 +0200)]
confile: parse_idmaps() remove dead assignments

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agooverlay: fix use after free()
Christian Brauner [Sun, 10 Sep 2017 05:04:34 +0000 (07:04 +0200)]
overlay: fix use after free()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>