Commit Graph

6489 Commits

Author SHA1 Message Date
Stéphane Graber
f1401c06ae Merge pull request #1716 from brauner/2017-07-28/bugfix
lvm: fix check
2017-07-28 15:59:28 +02:00
Christian Brauner
505dd98779
lvm: fix check
Signed-off-by: Thomas Hipp <thipp@suse.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-28 15:33:50 +02:00
Stéphane Graber
41609c461b Merge pull request #1715 from brauner/2017-07-27/fix_gcc7_bug
lvm: check whether lxc.bdev.lvm.vg is empty
2017-07-28 07:13:04 +02:00
Christian Brauner
bb30b52a76
cgroups: use tight scoping
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-28 06:17:28 +02:00
Christian Brauner
01e5fa0792
lvm: check whether lxc.bdev.lvm.vg is set
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-28 06:17:01 +02:00
Stéphane Graber
bef81ce588 Merge pull request #1714 from brauner/2017-07-27/fix_gcc7_bug
cgroups: workaround gcc-7 bug
2017-07-27 21:33:19 +02:00
Christian Brauner
66b66624fc
cgroups: workaround gcc-7 bug
Also: LOL

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-27 21:04:59 +02:00
Serge Hallyn
d9f78406d0 Merge pull request #1713 from brauner/2017-07-26/hybrid_cgroup_support
cgroups: handle hybrid cgroup layouts
2017-07-26 18:12:46 -05:00
Christian Brauner
6328fd9c05
cgroups: handle hybrid cgroup layouts
Closes #1669.
Closes #1678.
Relates to https://github.com/systemd/systemd/issues/6408.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-26 15:20:01 +02:00
Christian Brauner
04ad7ffe2a
utils: move helpers from cgfsng.c to utils.{c,h}
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-26 14:57:35 +02:00
aeris
c8bf519d7e Allow full path in lxc.devices.allow
Some devices like LVM or cryptsetup entries have no stable major/minor, changing between host reboots.
In this case, hardcoded numbers are not usable in config file and there is currently no way to use hook with lxc-device to do the link at guest startup :

    * `pre-start`/`autodev` hook runs in host context but has the guest in stopped state and so lxc-device not usable
    * `start` hook is in running state but runs in guest context and so lxc-device not available

This patch converts fullpath in lxc.devices.allow to current major/minor numbers to address those changing numbers.

Signed-off-by: aeris <aeris@imirhil.fr>
2017-07-26 12:17:33 +02:00
Serge Hallyn
c1cecfdd05 Merge pull request #1606 from brauner/2017-06-01/lxc_setup_after_cgroup_unshare
call lxc_setup() after unshare(CLONE_NEWCGROUP)
2017-07-25 10:18:10 -05:00
Christian Brauner
f4152036dd
start: lxc_setup() after unshare(CLONE_NEWCGROUP)
When the running kernel supports cgroup namespaces and users want to manually
set up cgroups via lxc.hook.mount before the init binary starts the cgroup
namespace needs to be already unshared. Otherwise the view on the cgroup mounts
is wrong. This commit places the call to lxc_setup() after the
LXC_SYNC_POST_CGROUP barrier.

Before this commit, the tty fds we allocate from a fresh devpts instance in the
container's namespaces before the init binary starts were referring to the
host's cgroup namespace since lxc_setup() was called before
unshare(CLONE_NEWCGROUP). Although not a security risk at this point since
setns() restricts its calls to /proc/<self>/ns files it's still better to do it
*after* the cgroup namespace has been unshared.

Adding a Suggested-by line for the lxc.mount.hook fix for Quentin.

Closes #1597.

Suggested-by: Quentin Dufour <quentin@dufour.tk>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-24 14:21:23 +02:00
Christian Brauner
fa1bafd3f0 Merge pull request #1706 from lifeng68/do_remount
Fix issue #1702, do remount with the MS_REMOUNT flag when mounts with MS_RDONLY
2017-07-24 02:47:33 +02:00
Li Feng
5ae72b98f8 Using 'add-required_remount_flags' function to add required flags
Signed-off-by: Li Feng <lifeng68@huawei.com>
2017-07-24 16:26:52 +08:00
Li Feng
5ee0b2693e Add test script to test the ro option of lxc.rootfs.options
Signed-off-by: Li Feng <lifeng68@huawei.com>
2017-07-18 18:31:35 +08:00
Li Feng
0a693043fb Fix issue #1702, do remount with the MS_REMOUNT flag when mounts with MS_RDONLY
Signed-off-by: Li Feng <lifeng68@huawei.com>
2017-07-17 17:09:16 +08:00
Christian Brauner
82ce69b151 Merge pull request #1696 from 0x0916/2017-07-12/remove-old-workaround-case
cgfsng: remove the old workdaround code
2017-07-12 10:47:53 +02:00
Christian Brauner
cdb4bcc26b Merge pull request #1695 from 0x0916/2017-07-12/update-doc-and-test
update doc and test
2017-07-12 10:45:51 +02:00
Long Wang
a7896f5836 cgfsng: remove the old workdaround code
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 15:34:36 +08:00
Long Wang
f30ab9fe2a tests: fix typo
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 11:08:01 +08:00
Long Wang
08d9d0e5bd doc: s/lxc.net.ipv6/lxc.net.ipv6.address/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:56:20 +08:00
Long Wang
2c67dc7987 doc: s/lxc.net.ipv4/lxc.net.ipv4.address/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:54:28 +08:00
Long Wang
48d5fccf10 doc: s/lxc.mount/lxc.mount.fstab/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:51:16 +08:00
Long Wang
e4075f8385 doc: s/lxc.pts/lxc.pty.max/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:47:34 +08:00
Long Wang
0873f85ce7 doc: s/lxc.tty/lxc.tty.max/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:45:17 +08:00
Long Wang
5042d96d12 doc: s/lxc.console/lxc.console.path/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:35:51 +08:00
Long Wang
a64f3157a1 doc: s/lxc.rootfs/lxc.rootfs.path/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:23:22 +08:00
Long Wang
501cf9b019 doc: s/seccomp/seccomp.profile/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 10:04:58 +08:00
Long Wang
b84702ab43 doc: s/se_context/selinux.context/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 09:58:35 +08:00
Long Wang
a1d5fdfd9b doc: s/aa_profile/apparmor.profile/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 09:53:58 +08:00
Long Wang
69e38e009b doc: s/aa_allow_incomplete/apparmor.allow_incomplete/g
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-12 09:46:20 +08:00
Christian Brauner
93e2c33651 Merge pull request #1692 from 0x0916/2017-07-11/cgfsng
cgfsng: only output debug info when we set cgroup data
2017-07-11 11:48:20 +02:00
Christian Brauner
05ad2eb3f1 Merge pull request #1693 from tenforward/japanese
Update Japanese man pages
2017-07-11 11:09:15 +02:00
KATOH Yasufumi
35a92cd7af doc: Update Japanese lxc-ls(1)
add "--defined" option

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2017-07-11 17:31:20 +09:00
KATOH Yasufumi
e71b47b239 doc: Update Japanese lxc.containers.conf(5)
Follow updates of configuration keys:
* Delete lxc.kmsg (commit 26a38fb)
* lxc.console -> lxc.console.path (commit 3aed493)
* lxc.mount -> lxc.mount.fstab (commit 47148e9)
* lxc.net.ipv{4,6} -> lxc.net.ipv{4,6}.address (commit 9ff60df, 2e44ae2)
* lxc.tty -> lxc.tty.max, lxc.devttydir -> lxc.tty.dir (commit fe1c588)
* lxc.pts -> lxc.pty.max (commit 232763)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2017-07-11 17:22:46 +09:00
Long Wang
6a628f4a1e cgfsng: only output debug info when we set cgroup data
Only output debug info `cgroup 'xxxx' set to 'yyyy'` when we set
cgroup data.

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-11 16:03:45 +08:00
Stéphane Graber
cc58d0e234
Fix syntax error in lxc-download
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-07-11 02:58:56 -04:00
William Gathoye
3f7be9d079 Sanitize lxc-download script with shellcheck
Fix potential CVE when using spaces in LXC names

Signed-off-by: William Gathoye <william@gathoye.be>
2017-07-10 22:23:09 -05:00
Christian Brauner
ed38feee45 Merge pull request #1690 from brauner/2017-07-10/lifeng68-Modify_fds
start: dup std{in,out,err} to pty slave
2017-07-10 12:25:05 +02:00
Christian Brauner
bbbf65ee77
utils: set_stdfds()
non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-10 11:46:54 +02:00
Li Feng
c5b93afba1
start: dup std{in,out,err} to pty slave
In the case the container has a console with a valid slave pty file descriptor
we duplicate std{in,out,err} to the slave file descriptor so console logging
works correctly. When the container does not have a valid slave pty file
descriptor for its console and is started daemonized we should dup to
/dev/null.

Closes #1646.

Signed-off-by: Li Feng <lifeng68@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-10 11:41:02 +02:00
Christian Brauner
1a6cb1cea4 Merge pull request #1687 from 0x0916/2017-07-09/delete-comments
delete comments
2017-07-09 11:48:53 +02:00
Serge Hallyn
74d2af40dd Merge pull request #1688 from 0x0916/2017-07-09/use-access
utils: use access instead of stat
2017-07-09 01:08:47 +00:00
Long Wang
e57cd7e9bb
utils: use access instead of stat
we shoud test whether the file exists and grants
execute permissions.

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-09 08:38:13 +08:00
Long Wang
1e8cfdf6f9
commonds: fix typo
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-09 08:10:34 +08:00
Long Wang
2945ea9778
commands: delete meaningless comments
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-09 08:08:54 +08:00
Serge Hallyn
3f0af363e4 Merge pull request #1659 from brauner/2017-06-28/do_not_use_cmd_socket_on_daemonized_start
start: use separate socket on daemonized start
2017-07-08 23:44:06 +00:00
Christian Brauner
ee8377bd91
commands: handle EINTR
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-09 00:14:47 +02:00
Christian Brauner
c01c2be6e8
commands: abstract cmd socket handling + logging
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-09 00:14:46 +02:00