Commit Graph

223 Commits

Author SHA1 Message Date
Josh Soref
da43e9e51a spelling: timeout
Signed-off-by: Josh Soref <jsoref@gmail.com>
2018-10-30 08:14:58 +00:00
Christian Brauner
e6fe24e134
autotools: support -z relro and -z now
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-28 22:58:20 +02:00
Stéphane Graber
810fd51c92
Merge pull request #2618 from CameronNemo/lxcmountroot
apparmor: account for specified rootfs path (closes #2617)
2018-09-25 14:46:21 -04:00
Christian Brauner
cf0fd972be
autotools: add -Wimplicit-fallthrough
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-21 15:24:14 +02:00
Cameron Nemo
b19c5d1237 apparmor: account for specified rootfs path (closes #2617)
Signed-off-by: Cameron Nemo <camerontnorman@gmail.com>
2018-09-20 15:56:05 -07:00
Wolfgang Bumiller
242a9fa7ee apparmor: allow start-container to change to lxc-**
For generated profiles with apparmor namespaces we get
profile names with slashes in them. To match those, we need
to allow changing to lxc-**, not just lxc-*.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-25 14:40:26 +02:00
Wolfgang Bumiller
6e6aca3e3e apparmor: update current profiles
remove cgmanager rules and add fstype=cgroup2 variants for
the existing fstype=cgroup rules

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-25 12:13:17 +02:00
Markos Chandras
733e375760 apparmor: Allow /usr/lib* paths for mount and pivot_root
openSUSE Leap 15 is using --libdir=/usr/lib64 when building for
x86_64 so we need to allow this path in the apparmor profiles.

Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1099239
Signed-off-by: Markos Chandras <mchandras@suse.de>
2018-07-19 12:17:24 +01:00
duguhaotian
8d6aae92d3 support tls in cross-compile
AC_RUN_IFELSE will fail in cross-compile,
we can use AC_COMPILE_IFELSE replace.

Signed-off-by: duguhaotian <duguhaotian@gmail.com>
2018-06-04 19:42:23 +08:00
Christian Brauner
c6df6dd98b
config: allow read-write /sys in user namespace
Unprivileged containers can safely mount /sys as read-write. This also allows
systemd-udevd to be started in unprivileged containers.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-05-15 15:51:58 +02: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
Christian Brauner
5c0d54cd8c
config: start with a full capability set
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-01 17:09:44 +01:00
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
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
Kaarle Ritvanen
ecef04af71 lxc-alpine: allow retaining sys_ptrace per container
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
2018-01-16 16:02:49 +02: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
bbb8e190f1 lxc-net: add LXC_DHCP_PING boolean option
Excerpt from dnsmasq(8):
By default, the DHCP server will attempt to ensure that an address in not
in use before allocating it to a host. It does this by sending an ICMP echo
request (aka "ping") to the address in question. If it gets a reply, then the
address must already be in use, and another is tried. This flag disables this check.

This is useful if one expects all the containers to get an IP address
from the LXC authoritative DHCP server and wants to speed up the process
of getting a lease.

Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-12-19 15:18:28 -08:00
Stéphane Graber
7ded3c1878
Merge pull request #1988 from abbasally5/feature-improve-bash-completion-1236
Add bash completion to list backing store types for lxc-create -B
2017-12-03 23:57:43 -08:00
Abbas Ally
caba109477 Add bash completion to list backing store types for lxc-create -B
- Backing Store types are hard-coded (Not sure how to get programmatically)
- Closes #1236

Signed-off-by: Abbas Ally <abbasally5@yahoo.com>
2017-12-03 05:51:44 +00:00
i.Dark_Templar
23002e923e
Update gentoo.moresecure.conf.
Closes https://github.com/lxc/lxc/issues/1928

Signed-off-by: i.Dark_Templar <darktemplar@dark-templar-archives.net>
2017-12-02 10:33:51 +03: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
Christian Brauner
0d8e40c687
config: remove SIGRTMIN+14 as lxc.signal.stop
We want to be able to SIGKILL an Archlinux container.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-07 00:54:28 +01:00
adrian5
09a4c38063 Fix typo in lxc-net script
Signed-off-by: adrian5 <adrian5@users.noreply.github.com>
2017-10-27 20:29:50 +02:00
Tycho Andersen
408dd86c76 drop useless apparmor denies
mem and kmem are really in /dev, so this does us no good.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2017-10-03 09:40:08 -06:00
Christian Brauner
307eba8ae3
userns.conf: remove obsolete bind-mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-08-02 17:19:00 +02: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
Serge Hallyn
616e0593cd Merge pull request #1665 from brauner/2017-07-01/deprecate_lxc_rootfs_backend
prepare for LXC 2.1
2017-07-08 21:25:17 +00:00
Frédéric Dalleau
d680929bbc Allow containers to start in AppArmor namespaces
This patch allows users to start containers in AppArmor namespaces.
Users can define their own profiles for their containers, but
lxc-start must be allowed to change to a namespace.

A container configuration file can wrap a container in an AppArmor
profile using lxc.aa_profile.

A process in an AppArmor namespace is restricted to view
or manage only the profiles belonging to this namespace, as if no
other profiles existed. A namespace can be created as follow:
sudo mkdir /sys/kernel/security/apparmor/policy/namespaces/$NAMESPACE

AppArmor can stack profiles so that the contained process is bound
by the intersection of all profiles of the stack. This is achieved
using the '//&' operator as follow:

lxc.aa_profile = $PROFILE//&:$NAMESPACE://unconfined

In this case, even the guest process appears unconfined in the
namespace, it is still confined by $PROFILE.

A guest allowed to access "/sys/kernel/security/apparmor/** rwklix,"
will be able to manage its own profile set, while still being
enclosed in the topmost profile $PROFILE:

Different guests can be assigned the same namespace or different
namespaces. In the first case, they will share their profiles.
In the second case, they will have distinct sets of profiles.

This is validated on privileged containers.

Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.com>
2017-07-07 12:33:38 +02:00
Christian Brauner
0b427da0e7
confile: lxc.seccomp --> lxc.seccomp.profile
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
Christian Brauner
232763d645
confile: lxc.pts --> lxc.pty.max
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
Christian Brauner
fe1c588797
confile: lxc.tty --> lxc.tty.max
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
0x0916
42e53c2920 confile: rename lxc.devttydir to lxc.tty.dir
the legacy keys will be kept around until LXC 3.0 and then will be
removed

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-30 09:41:25 +08:00
0x0916
55c84efcba confile: namespace lxc.signal keys
* rename lxc.haltsignal to lxc.signal.halt
* rename lxc.rebootsignal to lxc.signal.reboot
* rename lxc.stopsignal to lxc.signal.stop

the legacy keys will be kept around until LXC 3.0 and then will be
removed.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-30 09:41:25 +08:00
0x0916
935cfd3e36 testcase: define a network before checks
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
7fa3f2e9eb replace all lxc.network* with lxc.net*
This patch wipe all references to lxc.network{[i]}.*
and replace with lxc.net.{[i]}.* in templates, documentation
and configuration files.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
Christian Brauner
39b8f404dc
confile: remove lxc.pivotdir
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-23 16:00:24 +02:00
JD Friedrikson
c08d29b6d1
Use lxc-stop to stop systemd service
Ever since 8eb62c2, systemd has not been able to cleanly stop lxc
containers (via lxc@) because it's still using SIGPWR for systemd-based
containers.

We should now use the nice logic in 330ae3d to stop the containers
instead.

Signed-off-by: JD Friedrikson <yours@decompo.site>
2017-05-31 18:04:37 -04:00
Christian Brauner
2c056d3836
config: remove /dev/console bind mount
The code in conf will bind-mount a /dev/pts/<n> device over a dummy regular
/dev/console file. If users really want /dev/console bind-mount from the host
they can request it explicitly in the containers config file. This change will
have no effect on current LX{C,D} behavior since we (as said above) overmount
the /dev/console bind-mount anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-09 23:24:29 +02:00
Torsten Fohrer
723d30f7ff Avoid waiting for bridge interface if disabled in sysconfig/lxc | lxc-net via USE_LXC_BRIDGE
Signed-off-by: Torsten Fohrer <tfohrer@googlemail.com>
2017-03-30 11:57:14 +02:00
Geaaru
3d288bbe37 [lxc-sabayon] Disable _unprivileged_shift_owner for create unprivileged container images for lxd and lxc-download.
Signed-off-by: Geaaru <geaaru@gmail.com>
2017-03-15 20:23:39 +01:00
Stéphane Graber
bd657b44e9
Fix mixed tab/spaces in previous patch
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2017-03-14 12:44:35 +00:00
Harald Dunkel
8fc698019c
Fix lxc-containers to support multiple bridges
Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
2017-03-14 12:42:15 +00:00
Carsten Brandt
4f4e7141dd
Make lxc-net return non-zero on failure
I found that even though the service lxc-net failed to start because I made some wrong configuration
settings the command exists zero.
So systemd reports the status of the service as good even though it failed:

    # service lxc-net status
    ● lxc-net.service - LXC network bridge setup
       Loaded: loaded (/lib/systemd/system/lxc-net.service; enabled)
       Active: active (exited) since Wed 2017-02-08 08:17:32 EST; 21min ago
      Process: 529 ExecStart=/usr/lib/x86_64-linux-gnu/lxc/lxc-net start (code=exited, status=0/SUCCESS)
     Main PID: 529 (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/lxc-net.service

    Feb 08 08:17:30 dvm2 systemd[1]: Starting LXC network bridge setup...
    Feb 08 08:17:32 dvm2 lxc-net[529]: dnsmasq: failed to create listening socket for 10.2.2.1: Address already in use
    Feb 08 08:17:32 dvm2 lxc-net[529]: Failed to setup lxc-net.
    Feb 08 08:17:32 dvm2 systemd[1]: Started LXC network bridge setup.

Adding `exit 1` here makes it exit non-zero to make systemd recognize the failure.

Signed-off-by: Carsten Brandt <mail@cebe.cc>
2017-02-08 14:54:02 +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
Evgeni Golov
2704c1ccdd add cgroupfs-mount to Should-Start/Stop sysvinit LSB headers
otherwise init might try to start the containers before cgroupfs was
mounted.

Debian-Bug: https://bugs.debian.org/850212

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2017-01-12 12:51:55 +01:00
Cam Cope
84432621ed
Configure a static MAC address on the LXC bridge
Signed-off-by: Cam Cope <cam@dropbox.com>
2016-11-22 15:16:32 -08:00
Christian Brauner
d3c57812b5 Merge pull request #1293 from evgeni/always-stop-lxc-net
also stop lxc-net in runlevels 0 and 6
2016-11-12 11:13:25 -05: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
Evgeni Golov
79c07e4b11 also stop lxc-net in runlevels 0 and 6
there is no reason to not do this :)

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-11-12 12:29:26 +01:00