Christian Brauner
8408a9cc8d
tree-wide: s/recursive_destroy/lxc_rm_rf/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:55 +01:00
Christian Brauner
de6fe1328c
cgroups: better helper naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:55 +01:00
Christian Brauner
c468e4d429
cgroups: move check for valid monitor process up
...
Cc: cenxianlong <cenxianlong@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:44 +01:00
Christian Brauner
24e84b34e0
Merge pull request #3337 from bale-cen/master
...
monitor process exited by signal SIGKILL, clean cgroup resource by th…
2020-03-28 10:56:49 +01:00
Stéphane Graber
c396f8e654
Merge pull request #3336 from brauner/2020-03-28/fixes
...
cgroups: please compilers
2020-03-27 21:48:18 -04:00
cenxianlong
8fcb908d9f
monitor process exited by signal SIGKILL, clean cgroup resource by third party
...
Writing the value 0 to a cgroup.procs file causes the
writing process to be moved to the corresponding cgroup
Signed-off-by: cenxianlong <cenxianlong@huawei.com>
2020-03-28 03:16:27 +02:00
Christian Brauner
5045306b33
cgroups: please compilers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 00:27:00 +01:00
Stéphane Graber
3021b574a0
Merge pull request #3335 from brauner/2020-03-27/fixes
...
cgroups: use hidden directory for attaching cgroup
2020-03-27 17:33:59 -04:00
Christian Brauner
275e8ef8aa
cgroups: use hidden directory for attaching cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 22:22:05 +01:00
Stéphane Graber
334c3bfea5
Merge pull request #3333 from brauner/2020-03-27/fixes
...
conf: simplify userns_exec_minimal()
2020-03-27 17:01:17 -04:00
Christian Brauner
dbfcdf8600
conf: simplify userns_exec_minimal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 21:48:46 +01:00
Stéphane Graber
64e4f71582
Merge pull request #3332 from brauner/2020-03-27/fixes
...
attach: fixes
2020-03-27 15:37:00 -04:00
Christian Brauner
edf8828912
conf: introduce and use userns_exec_minimal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 20:11:41 +01:00
Christian Brauner
4b86fefd0f
Revert "cgroups: fix unified cgroup attach"
...
This reverts commit ba7ca43b0b
.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 19:46:10 +01:00
Stéphane Graber
c0c183b345
Merge pull request #3331 from brauner/2020-03-27/fixes
...
tree-wide: fixes
2020-03-27 11:02:27 -04:00
Wolfgang Bumiller
f7a97743a3
fixup i/o handler return values
...
Particularly important for lxc_cmd_handler() handles client
input and should not be capable of canceling the main loop,
some syscall return values leaked through overlapping with
LXC_MAINLOOP_ERROR, causing unauthorized clients connecting
to the command socket to shutdown the main loop.
In turn, signal_handler() receiving unexpected
`signalfd_siginfo` struct sizes seems like a reason to bail
(since it's a kernel interface).
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 15:45:11 +01:00
Christian Brauner
ba7ca43b0b
cgroups: fix unified cgroup attach
...
There's a fundamental problem with futexes and setid calls and the go runtime.
POSIX requires that when one thread setids all threas must setids and it uses
futexes and signals to synchronize the state across threads. This causes
deadlocks which means we can't use the pretty solution I first implemented.
Instead we need to chown after we create the directory. I might come up with
something smarter later but for now this will do.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 15:45:11 +01:00
Stéphane Graber
d4a5002bb7
Merge pull request #3330 from brauner/2020-03-27/fixes
...
conf: rework and fix leak in userns_exec_1()
2020-03-27 08:52:30 -04:00
Christian Brauner
0d113b16f0
cgroups: remove unused variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 12:00:22 +01:00
Christian Brauner
8bc2b675f2
attach: use close_prot_errno_disarm()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:52:44 +01:00
Christian Brauner
32908bfd12
cgroups: rework __cg_unified_attach()
...
We didn't account for cgroup_attach() succeeding and just tried to attach to
the same cgroup again which doesn't make sense.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:49 +01:00
Christian Brauner
7c2c435c52
cgroups: move pointer dereference after check
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:49 +01:00
Christian Brauner
a5263e59fd
commands: log actual errno when lxc_cmd_get_cgroup2_fd() fails
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:48 +01:00
Christian Brauner
766c5b6d75
conf: rework and fix leak in userns_exec_1()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:48 +01:00
Stéphane Graber
8c6a7ee44c
Merge pull request #3329 from brauner/2020-03-25/fixes
...
cgroups: fix attaching to the unified cgroup
2020-03-26 15:11:50 -04:00
Christian Brauner
7581a82fde
cgroups: fix attaching to the unified cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 19:27:07 +01:00
Stéphane Graber
45d6d89ba4
Merge pull request #3328 from brauner/2020-03-25/fixes
...
tree-wide: fixes
2020-03-26 11:22:34 -04:00
Christian Brauner
65146c9729
dir: improve dir backend
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:47:11 +01:00
Christian Brauner
0f2e356612
dir: use cleanup macro in dir_mount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:32:29 +01:00
Christian Brauner
a08bfbe340
tree-wide: harden mount option parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:31:57 +01:00
Stéphane Graber
75688909d2
Merge pull request #3327 from P-EB/master
...
lxc.service: Starts after remote-fs.target
2020-03-25 13:31:45 -04:00
Pierre-Elliott Bécue
c82d7763cd
[lxc.service] Starts after remote-fs.target to allow containers relying on remote FS to work
...
Signed-off-by: Pierre-Elliott Bécue <becue@crans.org>
2020-03-25 17:50:27 +01:00
Christian Brauner
591f6f44a7
lxc_init: add missing O_CLOEXEC
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-25 12:53:13 +01:00
Christian Brauner
ed58616410
lxc_init: move main() down
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-25 12:47:07 +01:00
Stéphane Graber
c40aa8c893
configure.ac: Reset devel flag post-release
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-03-24 16:36:14 -04:00
Stéphane Graber
a8565bb4aa
Release LXC 4.0.0
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-03-24 16:35:48 -04:00
Stéphane Graber
cf4c63394f
Merge pull request #3325 from brauner/2020-03-24/fixes
...
make dist: add missing files
2020-03-24 15:56:34 -04:00
Christian Brauner
57bb83f008
Merge pull request #3324 from stgraber/master
...
lxc-download: Pre-release bump of compat
2020-03-24 20:38:41 +01:00
Christian Brauner
fef909cf62
make dist: add missing files
...
deleted: CODING_STYLE.md
deleted: LICENSE.GPL2
deleted: LICENSE.LGPL2.1
deleted: README.md
deleted: coccinelle/exit.cocci
deleted: coccinelle/run-coccinelle.sh
deleted: coccinelle/while-true.cocci
deleted: doc/api-extensions.md
deleted: src/tests/lxc-test-exit-code
deleted: src/tests/travis.sh
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-24 20:37:00 +01:00
Stéphane Graber
7a930fe7fd
lxc-download: Pre-release bump of compat
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-03-24 14:44:08 -04:00
Christian Brauner
b492fc2a40
Merge pull request #3323 from tych0/fix-readonly-bind-mounts
...
conf: fix read-only bind mounts
2020-03-24 18:59:10 +01:00
Tycho Andersen
94bef7e4b4
conf: fix read-only bind mounts
...
Here we would always set MS_RDONLY in required_flags if it was set in
mountflags, so the expression:
!(required_flags & ~mountflags)
would always be true, and we would always skip the remount.
Instead, let's treat readonly as special: always do the remount if
MS_RDONLY is present. Unfortunately it doesn't seem to show up in
sb.f_flag, so we can't use the same path as everything else.
This only inadvertently worked before because of a bug fixed in
f759178580
("conf: don't accidently double-mount").
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2020-03-24 10:20:44 -06:00
Stéphane Graber
e4e80aa9e9
Merge pull request #3322 from brauner/2020-03-24/fixes
...
utils: allow removal of immutable files
2020-03-23 11:32:09 -04:00
Christian Brauner
066210f0b9
utils: allow removal of immutable files
...
Closes #3185 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-23 16:06:40 +01:00
Stéphane Graber
99a1811c85
Merge pull request #3321 from brauner/2020-03-24/fixes
...
lxc-update-config: handle lxc.rootfs.backend correctly
2020-03-23 09:02:49 -04:00
Christian Brauner
309b71d7e6
lxc-local: remove -l/--list from help
...
Closes #2877 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-23 13:23:19 +01:00
Christian Brauner
6b40b0c200
lvm: don't generate uuid for ext4 snapshots
...
only btrfs and xfs need it.
Closes #2375 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-23 13:16:14 +01:00
Christian Brauner
046c3a1cdf
lxc-update-config: handle lxc.rootfs.backend correctly
...
Closes #2424 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-23 12:29:38 +01:00
Stéphane Graber
cb47a5af6a
Merge pull request #3320 from brauner/2020-03-22/fixes
...
overlay: rewrite
2020-03-22 15:22:37 -04:00
Christian Brauner
27d79d0a84
lxc_copy: only overmount overlay subdirectory with tmpfs
...
Closes #2959 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-22 18:37:38 +01:00