Commit Graph

6355 Commits

Author SHA1 Message Date
Stéphane Graber
7c8f5d1d01 Merge pull request #1718 from agaida/patch-1
Don't force getty@ configuration
2017-10-06 16:37:13 -04:00
Christian Brauner
a363e3264b Merge pull request #1846 from tenforward/japanese
Add lxc.hook.start-host and lxc.execute.cmd to Japanese man page
2017-10-06 16:50:59 +02:00
KATOH Yasufumi
fcd95ae926 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>
2017-10-06 19:40:53 +09:00
KATOH Yasufumi
1e074e8ebe doc: Add lxc.hook.start-host to Japanese lxc.container.conf(5)
Update for commit 08dd280543

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2017-10-06 19:23:48 +09:00
Christian Brauner
c38d860cc3 Merge pull request #1844 from hallyn/2017-10-04/quote
implement lxc_string_split_quoted
2017-10-05 19:30:12 +02:00
Serge Hallyn
fe0fe85d00 Merge pull request #1845 from brauner/2017-10-05/lxc-update-config_update
confile: ignore lxc.kmsg and lxc.pivotdir
2017-10-05 11:05:17 -05:00
Christian Brauner
63bab717a8
confile: ignore lxc.kmsg and lxc.pivotdir
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-10-05 10:08:00 +02:00
Christian Brauner
727fd34960
tools: remove lxc.pivotdir and lxc.kmsg entries
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-10-05 09:55:50 +02:00
Serge Hallyn
3dca1af064 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>
2017-10-04 18:01:53 +00:00
Christian Brauner
c4c133b472 Merge pull request #1839 from hallyn/2017-10-02/oci
Add OCI container creation template
2017-10-04 00:28:59 +02:00
Serge Hallyn
0ef43a5c1d 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>
2017-10-03 21:45:29 +00:00
Christian Brauner
b90eff8163 Merge pull request #1840 from tych0/drop-useless-denies
drop useless apparmor denies
2017-10-03 12:11:37 -04:00
Tycho Andersen
408dd86c76 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>
2017-10-03 09:40:08 -06:00
Serge Hallyn
5cda27c18f support lxc.execute.cmd container configuration option
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2017-10-02 20:40:24 +00:00
Serge Hallyn
ee018c676f Merge pull request #1838 from brauner/2017-10-01/network_fix_reboot
network: clear ifindeces
2017-10-02 14:05:14 -05:00
Christian Brauner
66a7c406b0
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>
2017-10-02 09:16:08 +02:00
Christian Brauner
5284511847
network: non-functional changes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-10-02 09:16:08 +02:00
Christian Brauner
bb84beda1e
network: use single helper to delete networks
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-10-02 09:16:08 +02:00
Serge Hallyn
31f460b268 Merge pull request #1826 from hallyn/2017-09-21.pre-start-host
add a pre-start-host hook
2017-09-30 20:16:42 -05:00
Serge Hallyn
08dd280543 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>
2017-09-30 21:55:02 +00:00
Serge Hallyn
08dc351a36 Merge pull request #1836 from lifeng68/ns_share_pid
Add support share pid namespace
2017-09-29 10:07:44 -05:00
LiFeng
03df7ab598 Add support share pid namespace
Signed-off-by: LiFeng <lifeng68@huawei.com>
2017-09-29 19:53:43 +08:00
Christian Brauner
943b491286 Merge pull request #1835 from brauner/2017-09-28/share_namespaces
start: don't close inherited namespace fds
2017-09-28 10:38:26 -04:00
LiFeng
3659cba9d7
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>
2017-09-28 16:26:08 +02:00
Stéphane Graber
39911798d0 Merge pull request #1833 from brauner/2017-09-27/check_for_initialized_conf
cgfsng: check whether we have a conf
2017-09-27 17:50:14 -04:00
Christian Brauner
9b5396f9d5
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>
2017-09-27 18:24:42 +02:00
Christian Brauner
50b92d006b Merge pull request #1830 from tenforward/japanese
doc: Translate lxc-update-config(1) into Japanese
2017-09-25 09:25:09 -04:00
KATOH Yasufumi
607a8de552 doc: Translate lxc-update-config(1) into Japanese
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2017-09-25 20:14:57 +09:00
Stéphane Graber
17a643b754 Merge pull request #1828 from brauner/2017-09-23/storage_driver_lvm_fix_thinpool
lvm: fix thinpool logical volumes
2017-09-24 18:26:55 -04:00
Christian Brauner
4280c0e46d
lvm: fix thinpool logical volumes
Closes #1827.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-23 22:32:25 +02:00
Stéphane Graber
dfc8e7fe8b Merge pull request #1819 from brauner/2017-09-19/lxc-update-config_manpage
doc: add lxc-update-config manpage
2017-09-20 13:03:23 -04:00
Stéphane Graber
87f349acd1 Merge pull request #1821 from brauner/2017-09-19/fail_on_when_setting_limits_on_unavailable_controllers
cgfsng: fail when limits fail to apply
2017-09-20 13:03:06 -04:00
Stéphane Graber
5355740f3c Merge pull request #1824 from brauner/2017-09-20/fix_best_option
zfs: return error directly when zfs creation fails
2017-09-20 11:42:33 -04:00
Christian Brauner
24f84f1e31
zfs: return error directly when zfs creation fails
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-20 10:13:30 +02:00
Christian Brauner
796349bfc7 Merge pull request #1822 from tenforward/japanese
doc: fix regex-typo in Japanese and Korean lxc-monitor(1)
2017-09-19 10:07:28 -06:00
KATOH Yasufumi
03c9e2d51b doc: fix regex-typo in Japanese and Korean lxc-monitor(1)
Update for commit e3dd06ef41

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2017-09-20 00:57:21 +09:00
Christian Brauner
b3646d7e99
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>
2017-09-19 16:24:37 +02:00
Christian Brauner
0a29a3ef6a
doc: add lxc-update-config manpage
Closes #1818.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-19 12:51:43 +02:00
Christian Brauner
364c5d97de Merge pull request #1817 from stgraber/master
Fix typo
2017-09-19 02:41:02 -06:00
Stéphane Graber
aedfcb8acb Merge pull request #1811 from runejuhl/fix-alpine-apk-keys
Change alpine template file check to also check file size (`-f` => `-s`)
2017-09-18 19:05:13 -04:00
Stéphane Graber
eee1a9d773
Fix typo
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-09-18 19:03:48 -04:00
Christian Brauner
6cc7d050ca Merge pull request #1816 from stgraber/master
tests: Support systemd hybrid cgroups
2017-09-18 16:30:54 -06:00
Stéphane Graber
8d5a91fc65
tests: Support systemd hybrid cgroups
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-09-18 18:18:12 -04:00
Rune Juhl Jacobsen
fc20af631e
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>
2017-09-18 19:56:42 +02:00
Stéphane Graber
89dd4bff65 Merge pull request #1805 from tenforward/fix_plamo
plamo: Delete unnecessary process during container shutdown
2017-09-18 09:45:35 -07:00
Stéphane Graber
329414e0d1 Merge pull request #1810 from brauner/2017-09-12/start_move_env_setup
start: pass LXC_LOG_LEVEL to hooks
2017-09-18 09:45:17 -07:00
Christian Brauner
8bd8018e3d
utils: fix lxc_popen()/lxc_pclose()
- rework and fix pipe fd leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-13 17:07:43 +02:00
Christian Brauner
3f32320757
utils: duplicate stderr as well in lxc_popen()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-13 05:26:39 +02:00
Christian Brauner
b68c6a71d4
doc: document missing env variables
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-13 05:05:36 +02:00
Christian Brauner
b8f88d9bb2
start: pass LXC_LOG_LEVEL to hooks
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-13 05:05:36 +02:00