Commit Graph

6893 Commits

Author SHA1 Message Date
C0deAi
125a2e044c
lxc init: remove dead code
Value stored is never read.

Closes #2262.

Signed-off-by: C0deAi <techsupport@mycode.ai>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 20:40:02 +02:00
Christian Brauner
24927339bd
attach: always drop supplementary groups
Closes #1704.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 18:01:38 +02:00
Christian Brauner
4e256f6fe1
Merge pull request #2263 from ffontaine/master
Fix compilation with static libcap and shared gnutls
2018-04-09 10:15:09 +02:00
Fabrice Fontaine
49bc916b1d Fix compilation with static libcap and shared gnutls
Commit c06ed219c4 has broken
compilation with a static libcap and a shared gnutls.
This results in a build failure on init_lxc_static if gnutls is
a shared library as init_lxc_static is built with -all-static option
(see src/lxc/Makefile.am) and AC_CHECK_LIB adds gnutls to LIBS.

This commit fix the issue by removing default behavior of AC_CHECK_LIB
and handling manually GNUTLS_LIBS and HAVE_LIBGNUTLS

Fixes:
 - http://autobuild.buildroot.net/results/b655d6853c25a195df28d91512b3ffb6c654fc90

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-04-07 18:12:12 +02:00
Christian Brauner
5eda487c1c
Merge pull request #2261 from brauner/2018-04-06/thmo_patch_1
Fix temp file creation
2018-04-06 16:24:25 +02:00
Christian Brauner
709384a02e
ringbuf: fix temporary file creation
lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
template to contain 'XXXXXX' and be writable.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-06 10:54:41 +02:00
Christian Brauner
a324e7eba0
conf: fix temporary file creation
lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
template to contain 'XXXXXX' and be writable.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-06 10:54:02 +02:00
Guido Jäkel
63fc76c3e0
rootfs pinning: On NFS, make file hidden but don't delete it
On NFS, avoid random names of the root pin file due to "NFS silly renaming" but use a fixed hidden name instead.
2018-04-06 09:35:21 +02:00
Serge Hallyn
83ffaa1d39
Merge pull request #2258 from tych0/fix-signal-sending-to-lxc-init
fix signal sending in lxc.init
2018-04-05 16:03:44 -05:00
Tycho Andersen
9cb943843a fix signal sending in lxc.init
The problem here is that these two clauses were ordered backwards: we first
check if the signal came from not the init pid, and if it did, then we give
a notice and return. The comment notes that this is intended to protect
against SIGCHLD, but we don't in fact know if the signal is a SIGCHLD yet,
because that's tested in the next hunk.

The symptom is that if I e.g. send SIGTERM from the outside world to the
container init, it ignores it and gives this notice. If we re-order these
clauses, it forwards non SIGCHLD signals, and ignores SIGCHLD signals from
things that aren't the real container process.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-04-04 17:50:50 -06:00
Christian Brauner
22b2b9c87c
Merge pull request #2256 from tenforward/japanese
doc: Tweak Japanese translation in lxc.container.conf(5)
2018-04-03 15:00:08 +02:00
KATOH Yasufumi
09dd49ab20 doc: Tweak Japanese translation in lxc.container.conf(5)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2018-04-03 21:29:09 +09:00
Christian Brauner
94b437d17d
Merge branch 'FengtuWang-make_rslave' into lxc/master 2018-04-02 15:58:06 +02:00
Fengtu Wang
e599717bc5
conf: ensure umounts don't propagate to host
Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-02 15:56:40 +02:00
Stéphane Graber
0474e8a8e5
Merge pull request #2247 from brauner/2018-03-31/expand_lxc_environment
confile: expand lxc.environment
2018-04-02 01:08:39 -04:00
Christian Brauner
5eab47bce5
confile: expand lxc.environment
When a bare environment variable is specified then retrieve the value from the
current environment. For example, setting

lxc.environment = PATH

will cause LXC to inherit the value of PATH from the current environment.

Suggested-by: Jonathan Calmels <jcalmels@nvidia.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-31 17:57:00 +02:00
Stéphane Graber
dae29309e3
Merge pull request #2244 from brauner/2018-03-29/fixup
bugfixes
2018-03-30 11:29:56 -04:00
Christian Brauner
59ecb672d0
locktests: fix test suite
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-30 07:53:02 +02:00
Christian Brauner
b19aabf5be
lxclock: use thread-safe *_OFD_* fcntl() locks
If they aren't available fallback to BSD flock()s.

Closes #2245.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-30 07:30:00 +02:00
Christian Brauner
68c084cbd9
Merge pull request #2246 from flx42/lxc-oci-cmd-parsing-and-umoci
lxc-oci: cmd parsing and less verbose umoci
2018-03-29 12:31:54 -07:00
Felix Abecassis
845ba283d6 lxc-oci: make umoci less verbose
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:21:22 -07:00
Felix Abecassis
d99e3b2ea7 lxc-oci: fix Cmd/Entrypoint parsing
Don't use the -r option of jq, since it will strip the double quotes.

Fixes: #2195
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:20:31 -07:00
Christian Brauner
16c92537a5
storage: fix lvm fs uuid generation
Closes #2241.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-29 18:29:49 +02:00
Christian Brauner
9104c79a1d
tools: fix unitialized variable
Closes #2242.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-29 18:20:35 +02:00
Stéphane Graber
5b66b6ee3e
Release LXC 3.0.0
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 21:49:16 -04:00
Stéphane Graber
21773a9522
Merge pull request #2239 from brauner/2018-03-27/fixup_action_script
Allow passing action scripts to CRIU
2018-03-27 16:49:34 -04:00
Eytan Heidingsfeld
590197542e
Allow passing action scripts to CRIU
Closes #2236.

Signed-off-by: Eytan Heidingsfeld <eytanh@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-27 22:33:48 +02:00
Christian Brauner
808108a949
Merge pull request #2238 from stgraber/master
configure.ac: Support redhatenterpriseserver
2018-03-27 13:02:33 -07:00
Stéphane Graber
b195038dfc
configure.ac: Support redhatenterpriseserver
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 15:21:51 -04:00
Stéphane Graber
769cf3c1cc
Release LXC 3.0.0.beta4
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-26 23:38:01 -04:00
Stéphane Graber
f4ffd9f873
Merge pull request #2237 from brauner/2018-03-26/always_make_dumpable
start: always make us dumpable
2018-03-26 18:11:31 -04:00
Christian Brauner
d788372535
start: always make us dumpable
Otherwise lxc.hook.mount hooks that try to inspect /proc/<pid>/*
will fail.

Cc: Jonathan Calmels <jcalmels@nvidia.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-26 23:04:12 +02:00
Stéphane Graber
065d5d0d3a
Merge pull request #2235 from brauner/2018-03-25/simplify_autodev
conf: simplify autodev
2018-03-25 22:30:58 -04:00
Christian Brauner
5e73416ffe
conf: simplify lxc_fill_autodev()
This function was way more syscall heavy than it needed to be.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-26 02:21:56 +02:00
Stéphane Graber
6af6b30a87
Merge pull request #2232 from flx42/dhclient-hook-apparmor
hooks: fix dhclient hook when an AppArmor profile is active
2018-03-24 00:36:32 -04:00
Stéphane Graber
b53a26168c
Release LXC 3.0.0.beta3
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-23 16:22:00 -04:00
Stéphane Graber
2715bbf9bc
Merge pull request #2233 from brauner/2018-03-23/truncate_config_file
lxccontainer: truncate config file
2018-03-23 15:44:52 -04:00
Christian Brauner
10034af509
lxccontainer: truncate config file
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-23 20:30:38 +01:00
Christian Brauner
cc8d4ec015
Merge pull request #2231 from stgraber/master
pam: Fix missing symbols in module
2018-03-23 18:54:22 +01:00
Felix Abecassis
41be52e8ab hooks: fix dhclient hook when an AppArmor profile is active
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-23 10:47:35 -07:00
Stéphane Graber
60534f79d2
pam: Fix missing symbols in module
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-23 13:26:24 -04:00
Stéphane Graber
1b849a8ffa
Merge pull request #2229 from fliiiix/lxc_net_improvements
Rename ifup/down and remove usless parameter passing
2018-03-22 12:35:43 -04:00
Christian Brauner
dad96df80b
Merge pull request #2230 from tych0/drop-log-whitespace
remove leading whitespace from log files
2018-03-22 17:22:55 +01:00
fliiiix
1b459eded4 Rename ifup/down and remove usless parameter passing
Signed-off-by: Felix <de-ch@hotmail.de>
2018-03-22 17:11:17 +01:00
Tycho Andersen
512845bc10 remove leading whitespace from log files
This has annoyed me for a long time, 3.0 seems like the time to fix it :).

I think the way that the log prefix was intended to be used was perhaps a
dynamic prefix per file, but we don't do that today; we include the
filename later in the log message. Instead, we use it as the tool name,
which for liblxc is always "lxc", but could also be things like
"lxc-cgroup" or whatever. There is absolutely no reason to pad this, since
it is always the same for every log file (in fact, we could probably get
rid of the prefix all together, but that seems slightly more drastic).

Instead, let's just drop this padding. Hopefully this will save thousands
of hours of slight annoyance and right scrolling in various pastebins.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-03-22 09:49:08 -06:00
Christian Brauner
4c6fb19b30
Merge pull request #2225 from flx42/nvidia-hook-fixes
NVIDIA hook improvements
2018-03-19 23:57:42 +01:00
Felix Abecassis
89f1ef110e hooks: implement passthrough for latest features of libnvidia-container
The "display" driver capability will expose /dev/nvidia-modeset:
9398d41d9f

The "--ldcache" argument allows overriding the location of the DSO cache:
41656bf9ed

The "--root" argument allows nvidia-container-cli to execute in a different rootfs:
019fdc14e3

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-19 15:38:53 -07:00
Felix Abecassis
4a0a5e89e1 hooks: fix nvidia hook when running under the lxc-start AppArmor profile
For a reason that I don't understand, the profile transition needs to
be done on the current process. Changing the attributes for a
subsequent execve(2) (with /proc/self/attr/exec) will cause the kernel
to set AT_SECURE in the auxiliary vector and thus secure_getenv(3)
inside libnvidia-container will return NULL.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-19 15:34:49 -07:00
Stéphane Graber
14f16c4171
Release LXC 3.0.0.beta2
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-19 16:05:53 -04:00
Christian Brauner
d343541545
Merge pull request #2223 from flx42/fix-lxc-execute-use-after-free
tools: fix container use-after-free
2018-03-16 23:16:22 +01:00