Commit Graph

354 Commits

Author SHA1 Message Date
Christian Brauner
aafb5ea2a8
tree-wide: rm templates in favor of distrobuilder
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
98619a7362
autotools: remove --enable-deprecated
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
e144a06bd7
tree-wide: remove python3 bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
b52a5bef6f
tree-wide: remove lua bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
a9145d622f
tree-wide: cleanup
- remove legacy binaries
- conditionalize creation of docs and tests for the command line tools and the
  shared library helper commands

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
8d0609371e
autotools: add --{enable,disable}-{commands,tools}
This allows users to only compile the shared libray without having to compile
any of the command line tools or command helpers for the shared library.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:30 +01:00
Stéphane Graber
d4feae43a6
Merge pull request #2192 from brauner/2018-02-26/enable_pam_flag
configure: add --enable-pam
2018-02-26 12:11:13 -05:00
Christian Brauner
f7a8609fab
configure: add --enable-pam
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:27:46 +01:00
Christian Brauner
35444f3827
templates: add lxc-local template
Closes #2184.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:22:48 +01:00
Christian Brauner
7ac43d3d21
Revert "Revert "pam: create writable cgroups for unpriv users""
This reverts commit 79cf25e826.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:01:18 +01:00
Stéphane Graber
79cf25e826
Revert "pam: create writable cgroups for unpriv users"
This reverts commit 7995662124.

Before we can merge something like this we need to have it be behind a
configure flag and quite probably be an opt-in feature (--enable-pam).

This should fix Jenkins, PPA builds and the current binary conflicts
between the lxcfs and lxc package builds (snap and archive).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-02-21 17:25:58 -05:00
Serge Hallyn
e235f961bf
Merge pull request #2148 from brauner/2018-02-09/move_pam_module_to_liblxc
pam: create writable cgroups for unpriv users
2018-02-21 13:27:59 -06:00
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
7995662124
pam: create writable cgroups for unpriv users
This moves pam_cgfs from the LXCFS repo into the LXC repo. This will allow us
to share a bunch of code between the cgroup backends and the pam module. The
next step obviously is to share code.

Closes #1307.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-09 14:39:43 +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