Commit Graph

6489 Commits

Author SHA1 Message Date
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
Stéphane Graber
dbac6c0256 Merge pull request #1809 from brauner/2017-09-12/start_move_env_setup
start: set environment variables correctly
2017-09-12 19:14:27 -07:00
Christian Brauner
149857af10
start: set environment variables correctly
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-13 04:01:41 +02:00
Stéphane Graber
03afa514d0 Merge pull request #1807 from brauner/2017-09-12/start_move_env_setup
start: move env setup before container setup
2017-09-12 17:11:13 -07:00
Christian Brauner
98ff08ca8d
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>
2017-09-13 01:47:59 +02:00
Christian Brauner
52109c4bac Merge pull request #1806 from roques/patch-1
[TRIVIAL] fix regex-typo in documentation example
2017-09-12 10:15:18 -07:00
Christian von Roques
e3dd06ef41 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>
2017-09-12 18:37:06 +02:00
KATOH Yasufumi
d3953cdca9 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>
2017-09-12 16:03:31 +09:00
Serge Hallyn
2569f6f6f5 Merge pull request #1803 from brauner/2017-09-10/lxc_execute_switch_ids_last
start: switch ids at last possible instance
2017-09-11 13:27:58 -07:00
Christian Brauner
45b4bb9618
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>
2017-09-11 08:45:54 +02:00
Christian Brauner
76bdf2992c
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>
2017-09-11 08:44:06 +02:00
Serge Hallyn
42f055d0f6 Merge pull request #1801 from brauner/2017-09-09/userns_exec
conf: add userns_exec_full()
2017-09-10 18:42:54 -05:00
Christian Brauner
ed8704d040
execute: enable console & standard /dev symlinks
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-10 23:51:58 +02:00
Christian Brauner
3b13691dca
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>
2017-09-10 23:51:58 +02:00
Christian Brauner
5fe9c0a0e6
network: remove dead assignments
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-10 23:51:57 +02:00
Christian Brauner
cef588fcf0
lxc-user-nic: remove double initialization
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-10 23:51:57 +02:00
Christian Brauner
2468599d8e
utils: lxc_popen() remove dead assignments
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-09-10 23:51:57 +02:00