Commit Graph

341 Commits

Author SHA1 Message Date
Christian Brauner
0e7ff52c92
tree-wide: remove cgmanager
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-13 05:39:58 +01:00
Christian Brauner
6a342cab36
cmd: move lxc-update-config
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-06 21:03:33 +01:00
Christian Brauner
48b1dc4cdc
cmd: move lxc-checkconfig
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-06 21:03:32 +01:00
Christian Brauner
05f0f93a93
autotools: do not link against libapparmor
Since we write the label directly without going through the AppArmor API it
doesn't make sense to link against it.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-01-22 12:14:21 +01:00
Stéphane Graber
5f98011c3e
Include -devel suffix in version string
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-01-05 16:25:28 -05:00
Serge Hallyn
c06ed219c4 configure.ac: fix the check for static libcap
The existing check doesn't work, because when you statically
link a program against libc, any functions not called are not
included.  So cap_init() which we check for is not there in
the built binary.

So instead just check whether a "gcc -lcap -static" works.
If libcap.a is not available it will fail, if it is it will
succeed.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2018-01-03 21:09:10 -06:00
Jonathan Calmels
1689c7cf90 lxc-oci: read configuration from oci.common.conf if available
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-12-19 15:18:28 -08:00
Jonathan Calmels
84bf5645ed hooks: dhclient hook improvements
- Merge dhclient-start and dhclient-stop into a single hook.
- Wait for a lease before returning from the hook.
- Generate a logfile when LXC log level is either DEBUG or TRACE.
- Rely on namespace file descriptors for the stop hook.
- Use settings from /<sysconf>/lxc/dhclient.conf if available.
- Attempt to cleanup if dhclient fails to shutdown properly.

Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-12-19 15:18:28 -08:00
Serge Hallyn
242146d9e4
Merge pull request #1932 from 3XX0/dhclient-hook
hooks: add dhclient hooks
2017-11-28 20:16:50 -06:00
Marcos Paulo de Souza
a81c46e99a Use AX_PTHREAD config script to detect pthread api
Closes: #84

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2017-11-26 16:45:22 -02:00
Jonathan Calmels
27234deb3a hooks: add dhclient hooks
Add new hooks leveraging dhclient from the host to automatically
configure the container interfaces. This is especially useful for
application containers which rely on an IPAM driver for network
configuration (e.g. Docker).

Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-11-20 16:54:16 -08:00
Fabrice Fontaine
f48b5fd8ab Fix compilation on toolchain without prlimit
Some toolchains which are not bionic like uclibc does not support
prlimit or prlimit64. In this case, return an error.
Moreover, if prlimit64 is available, use lxc implementation of prlimit.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2017-11-02 18:36:00 +01: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
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
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
Stéphane Graber
b737ac4c8c
Switch back to development
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-09-05 22:32:18 -04:00
Stéphane Graber
e94087c985
change version to 2.1.0 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-09-05 22:31:20 -04:00
Christian Brauner
3a12c64d94
configure: remove slash from cgroup pattern
This is the cause of the unnecessary extraneous slashes when creating cgroups.
Our lxc.system.conf page also clearly shows "lxc/%n" as example, not "/lxc%n".

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-08-30 16:45:45 +02:00
Christian Brauner
555200a6f4
tools: add lxc-update-config.in
This tool can be used to switch from a pre 2.1 to a 2.1 config file.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-08-21 17:19:16 +02:00
0x0916
82b479119d Merge ubuntu and debiancase
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-05-11 15:16:14 +08:00
0x0916
234f9815ff Install systemd units for CentOS
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-05-11 15:15:18 +08:00
Christian Brauner
69924fff1b
autotools: check for cap_get_file
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-04-19 01:02:10 +02:00
Christian Brauner
a04f540725
android: add prlimit implementation for 32bit
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-04-15 00:18:31 +02:00
Wolfgang Bumiller
c6d09e15c5 conf: implement resource limits
This adds lxc.limit.<name> options consisting of one or two
colon separated numerical values (soft and optional hard
limit). If only one number is specified it'll be used for
both soft and hard limit. Additionally the word 'unlimited'
can be used instead of numbers.

Eg.
  lxc.limit.nofile = 30000:32768
  lxc.limit.stack = unlimited

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-04-11 14:01:11 +02:00
Stéphane Graber
a75c00c6d0 Merge pull request #1371 from ganto/lxc-fedora
Complete rework of lxc-fedora template
2017-02-16 22:12:33 +01:00
Fabrice Fontaine
e37dda7156 Add HAVE_LIBCAP
Currently it is impossible to build lxc with --disable-capabilities if
the user has libcap-dev installed on his system as:
 - calls to cap_xxx functions are not protected by HAVE_LIBCAP defines.
 The whole file is only protected by HAVE_SYS_CAPABILITY_H.
 - AC_CHECK_LIB default action-if-found is overriden by [true] so
 HAVE_LIBCAP is never written to config.h

This patch replaces all HAVE_SYS_CAPABILITY_H checks by HAVE_LIBCAP
checks (fix #1361)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2017-02-12 14:55:05 +01:00
Geaaru
74e7574120 [lxc-sabayon] Add common scripts for daily image generation.
Signed-off-by: Geaaru <geaaru@gmail.com>
2017-01-29 19:03:55 +01:00
Geaaru
11f88f10cd Add LXC template script of Sabayon OS
Signed-off-by: Geaaru <geaaru@gmail.com>
2017-01-28 23:22:47 +01:00
Sergei Trofimovich
af6824fce9 Use AC_HEADER_MAJOR to detect major()/minor()/makedev()
Before the change build failed on Gentoo as:

  bdev/lxclvm.c: In function 'lvm_detect':
  bdev/lxclvm.c:140:4: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
    ^~~~~
  bdev/lxclvm.c:140:28: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
                            ^~~~~

glibc plans to remove <sys/sysmacros.h> from glibc's <sys/types.h>:
    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

Gentoo already applied glibc patch to experimental glibc-2.24
to start preparingfor the change.

Autoconf has AC_HEADER_MAJOR to find out which header defines
reqiured macros:
    https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html

This change should also increase portability across other libcs.

Bug: https://bugs.gentoo.org/604360
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
2017-01-21 11:57:13 +00:00
Reto Gantenbein
60fd46237e Also add lxc-fedora-legacy to AC_CONFIG_FILES
Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
2017-01-01 18:54:29 +01:00
Fabrice Fontaine
c8601571aa Add --enable-gnutls option
Previously HAVE_LIBGNUTLS was never set in config.h even if gnutls was
detected as AC_CHECK_LIB default action-if-found was overriden by
enable_gnutls=yes
This patch adds an --enable-gnutls option and will call AC_CHECK_LIB
with the default action to write HAVE_LIBGNUTLS in config.h

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
2016-12-18 21:42:07 +01:00
Christian Brauner
ce44bee117
configure: remove -Werror=vla
Because we include a header that uses a vla (/me scoffs at header).

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-26 07:07:25 +01:00
Stéphane Graber
d53d0a01a9 Merge pull request #1315 from brauner/2016-11-23/memfd_create
conf, criu: add make_anonymous_mount_file()
2016-11-25 23:50:28 -05:00
Stéphane Graber
3f37ede22a Merge pull request #1320 from brauner/2016-11-25/remove_vlas
tree-wide: remove any variable length arrays
2016-11-25 23:04:21 -05:00
Christian Brauner
413c294f75 configure: check for memfd_create()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-26 04:17:14 +01:00
Christian Brauner
d8f2dda5a5
configure: do not allow variable length arrays
There pointless and marked as optional since C11.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-25 22:02:28 +01:00
Christian Brauner
6a22e86258
configure: check whether gettid() is declared
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-25 20:03:50 +01:00
Evgeni Golov
23f4c8a01a install bash completion where pkg-config tells us to
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-11-12 14:57:34 +01:00
Stéphane Graber
26419a7a73 Use libtool for liblxc.so
This should allow proper filtering of build flags for libraries and make
it easier to use PIE/PIC.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-10-21 18:32:18 -04:00
Gregor Reitzenstein
f6bd219e6b Add voidlinux distribution
Signed-off-by: Gregor Reitzenstein <dean4devil@paranoidlabs.org>
2016-10-14 15:20:39 +02:00
Stéphane Graber
d2d6b991b8 Define LXC_DEVEL to detect development releases
This can be used by downstreams to improve their "feature" checks.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-10-04 18:31:29 +02:00
Serge Hallyn
a307c27146 Merge pull request #1166 from brauner/2016-09-02/no_new_privileges
implement PR_SET_NO_NEW_PRIVS in liblxc
2016-09-15 20:35:21 -05:00
Christian Brauner
955e2a0237
attach, start: declare PR_{S,G}PR_GET_NO_NEW_PRIVS
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
2016-09-06 15:57:46 +02:00
Jérôme Pouiller
e9f34eb4e2 configure: add --disable-werror
-Werror may break builds on some scenarios with trivialities
(especially during developments).

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
2016-09-04 09:42:24 +02:00
Elan Ruusamäe
487ea5f603 templates: add PLD Linux support
from pld-linux repo:
https://github.com/pld-linux/lxc/commits/auto/th/lxc-2.0.4-1/lxc-pld.in.sh
https://github.com/pld-linux/lxc/commits/auto/th/lxc-2.0.4-1/lxc-pld.patch

Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
2016-08-23 22:06:17 +03:00
Christian Brauner
ca1e6c0227
tools, tests: reorganize repo
- tools: move lxc commands to common subfolder
- tests: adapt include search path

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-31 13:01:03 +02:00
Aleksandr Mezin
00d98acd9f python-lxc: pass include/library dirs as arguments to setup.py
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:17 +06:00
Evgeni Golov
8d256e4de7 nicer date format and support for SOURCE_DATE_EPOCH in LXC_GENERATE_DATE
Using $(date) for LXC_GENERATE_DATE has various flaws:
* formating depends on the locale of the system we execute configure on
* the output is not really a date but more a timestamp

Let's use $(date --utc '+%Y-%m-%d') instead.

While at it, also support SOURCE_DATE_EPOCH [1] to make the build
reproducible

[1] https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-04-12 19:20:10 +02:00
Stéphane Graber
823765e50b change version to 2.0.0 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-04-06 13:41:56 -04:00
Stéphane Graber
55c91e8367 change version to 2.0.0.rc15 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-03-31 18:10:51 -04:00