]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
7 years agosabayon: Use /bin/bash
Stéphane Graber [Fri, 17 Feb 2017 22:06:23 +0000 (17:06 -0500)]
sabayon: Use /bin/bash

The script is full of bashisms making it break when run with a simple
POSIX shell.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1371 from ganto/lxc-fedora
Stéphane Graber [Thu, 16 Feb 2017 21:12:33 +0000 (22:12 +0100)]
Merge pull request #1371 from ganto/lxc-fedora

Complete rework of lxc-fedora template

7 years agoMerge pull request #1428 from kilobyte/master
Serge Hallyn [Wed, 15 Feb 2017 05:35:02 +0000 (23:35 -0600)]
Merge pull request #1428 from kilobyte/master

fix seccomp blocking x32 guests on amd64 (userspace) hosts

7 years agoMerge pull request #1430 from ffontaine/master
Christian Brauner [Sun, 12 Feb 2017 15:32:37 +0000 (16:32 +0100)]
Merge pull request #1430 from ffontaine/master

Add HAVE_LIBCAP

7 years agoAdd HAVE_LIBCAP
Fabrice Fontaine [Sat, 11 Feb 2017 21:40:19 +0000 (22:40 +0100)]
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>
7 years agoseccomp: allow x32 guests on amd64 hosts.
Adam Borowski [Sun, 12 Feb 2017 06:26:54 +0000 (07:26 +0100)]
seccomp: allow x32 guests on amd64 hosts.

Without this patch, x32 guests (and no others) worked "natively" with x32
host lxc, but not on regular amd64 hosts.  That was especially problematic
as a number of ioctls such as those needed by netfilter don't work in such
scenarios, thus you want to run amd64 on the host.

With the patch, you can use all three ABIs: i386 x32 amd64 on amd64 hosts.

Despite x32 being little used, there's no reason to deny it by default:
the admin needs to compile their own kernel with CONFIG_X86_X32=y or (on
Debian) boot with syscall.x32=y.  If they've done so, it is a reasonable
assumption they want x32 guests.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
7 years agoMerge pull request #1424 from brauner/2017-02-08/thomasDOTjaroschATintra2netDOTcom_pt...
Stéphane Graber [Wed, 8 Feb 2017 16:07:26 +0000 (17:07 +0100)]
Merge pull request #1424 from brauner/2017-02-08/thomasDOTjaroschATintra2netDOTcom_pty_sigttou

lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals

7 years agoMerge pull request #1425 from cebe/patch-1
Stéphane Graber [Wed, 8 Feb 2017 16:06:33 +0000 (17:06 +0100)]
Merge pull request #1425 from cebe/patch-1

Make lxc-net return non-zero on failure

7 years agoMake lxc-net return non-zero on failure
Carsten Brandt [Wed, 8 Feb 2017 13:46:59 +0000 (14:46 +0100)]
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>
7 years agolxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals
Thomas Jarosch [Thu, 2 Feb 2017 11:48:35 +0000 (12:48 +0100)]
lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals

Prevent an endless loop while executing lxc-attach in the background:

The kernel might fire SIGTTOU while an ioctl() in tcsetattr()
is executed. When the ioctl() is resumed and retries,
the signal handler interrupts it again.

We can't configure the TTY to stop sending
the signals in the first place since that
is a modification/write to the TTY already.

Still we clear the TOSTOP flag to prevent further signals.

Command to reproduce the hang:
----------------------------
cat > lxc_hang.sh << EOF
/usr/bin/timeout 5s /usr/bin/lxc-attach -n SOMECONTAINER -- /bin/true
EOF
sh lxc_hang.sh    # hangs
----------------------------

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
7 years agoChange Fedora mirror downloads to https by default, rsync optional
Reto Gantenbein [Tue, 7 Feb 2017 05:59:15 +0000 (06:59 +0100)]
Change Fedora mirror downloads to https by default, rsync optional

This mainly affects the download of the bootstrap image when
running on a non-Fedora host and the initial download of the
repo and release RPMs. The container rootfs creation will then
be verified by dnf against the GPG signatures in the repos RPM.

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoQuery Fedora mirror list over HTTPS
Reto Gantenbein [Mon, 6 Feb 2017 07:17:13 +0000 (08:17 +0100)]
Query Fedora mirror list over HTTPS

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoMerge pull request #1422 from brauner/2017-06-02/clear_config_vals
Stéphane Graber [Mon, 6 Feb 2017 22:49:30 +0000 (23:49 +0100)]
Merge pull request #1422 from brauner/2017-06-02/clear_config_vals

confile: clear lxc.network.<n>.ipv{4,6} when empty

7 years agoconfile: clear lxc.network.<n>.ipv{4,6} when empty
Christian Brauner [Mon, 6 Feb 2017 22:08:26 +0000 (23:08 +0100)]
confile: clear lxc.network.<n>.ipv{4,6} when empty

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1410 from brauner/2017-02-02/fix_compiler_error
Stéphane Graber [Thu, 2 Feb 2017 10:34:16 +0000 (05:34 -0500)]
Merge pull request #1410 from brauner/2017-02-02/fix_compiler_error

conf/ile: make sure buffer is large enough

7 years agoMerge pull request #1409 from tych0/setproctitle-comments
Christian Brauner [Thu, 2 Feb 2017 09:54:49 +0000 (10:54 +0100)]
Merge pull request #1409 from tych0/setproctitle-comments

util: update setproctitle comments

7 years agoMerge pull request #1398 from geaaru/lxc-sabayon
Stéphane Graber [Thu, 2 Feb 2017 09:45:46 +0000 (04:45 -0500)]
Merge pull request #1398 from geaaru/lxc-sabayon

Add LXC template script of Sabayon OS

7 years agoconf/ile: make sure buffer is large enough
Christian Brauner [Thu, 2 Feb 2017 09:31:30 +0000 (10:31 +0100)]
conf/ile: make sure buffer is large enough

conf.c: In function 'lxc_assign_network':
conf.c:3096:25: error: '%lu' directive output may be truncated writing between 1 and 20 bytes into a region of size 19 [-Werror=format-truncation=]
   snprintf(pidstr, 19, "%lu", (unsigned long) pid);
                         ^~~
conf.c:3096:24: note: using the range [1, 18446744073709551615] for directive argument
   snprintf(pidstr, 19, "%lu", (unsigned long) pid);
                        ^~~~~
In file included from /usr/include/stdio.h:938:0,
                 from conf.c:35:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 2 and 21 bytes into a destination of size 19
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
confile.c: In function 'network_new_hwaddrs':
confile.c:2889:38: error: '%02x' directive output may be truncated writing between 2 and 8 bytes into a region of size 6 [-Werror=format-truncation=]
  snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x",
                                      ^~~~
confile.c:2889:23: note: using the range [0, 4294967295] for directive argument
  snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x",
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
confile.c:2889:23: note: using the range [0, 4294967295] for directive argument
In file included from /usr/include/stdio.h:938:0,
                 from confile.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 18 and 36 bytes into a destination of size 18
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Not sure whether the latter is really a problem. We might need an additional
fix later on.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutil: update setproctitle comments
Tycho Andersen [Thu, 2 Feb 2017 09:30:43 +0000 (10:30 +0100)]
util: update setproctitle comments

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
7 years agoMerge pull request #1408 from tych0/setproctitle-always-malloc
Christian Brauner [Thu, 2 Feb 2017 09:09:23 +0000 (10:09 +0100)]
Merge pull request #1408 from tych0/setproctitle-always-malloc

util: always malloc for setproctitle

7 years agoutil: always malloc for setproctitle
Tycho Andersen [Thu, 2 Feb 2017 08:36:31 +0000 (09:36 +0100)]
util: always malloc for setproctitle

Closes #1407

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
7 years agoMerge pull request #1402 from mabes/patch-1
Christian Brauner [Mon, 30 Jan 2017 13:52:36 +0000 (14:52 +0100)]
Merge pull request #1402 from mabes/patch-1

lxc-opensuse: fix default value for release code

7 years agolxc-opensuse: fix default value for release code
Maxime Besson [Mon, 30 Jan 2017 12:08:40 +0000 (13:08 +0100)]
lxc-opensuse: fix default value for release code

Signed-off-by: Maxime Besson <maxime.besson@smile.fr>
7 years ago[lxc-sabayon] Add common scripts for daily image generation.
Geaaru [Sun, 29 Jan 2017 18:03:55 +0000 (19:03 +0100)]
[lxc-sabayon] Add common scripts for daily image generation.

Signed-off-by: Geaaru <geaaru@gmail.com>
7 years agoMerge pull request #1400 from bneumeier/master
Christian Brauner [Sun, 29 Jan 2017 16:23:47 +0000 (17:23 +0100)]
Merge pull request #1400 from bneumeier/master

Allow build without sys/capability.h

7 years agoAllow build without sys/capability.h
Brett Neumeier [Sun, 29 Jan 2017 14:29:53 +0000 (08:29 -0600)]
Allow build without sys/capability.h

There is no guard clause around a reference to CAP_EFFECTIVE and
CAP_SETGID, causing compilation to fail if sys/capability.h is not
available.

Signed-off-by: Brett Neumeier <brett@neumeier.us>
7 years agoAdd LXC template script of Sabayon OS
Geaaru [Sat, 28 Jan 2017 21:55:25 +0000 (22:55 +0100)]
Add LXC template script of Sabayon OS

Signed-off-by: Geaaru <geaaru@gmail.com>
7 years agoMerge pull request #1397 from stgraber/master
Christian Brauner [Fri, 27 Jan 2017 22:49:49 +0000 (23:49 +0100)]
Merge pull request #1397 from stgraber/master

Fix typo

7 years agoFix typo
Stéphane Graber [Fri, 27 Jan 2017 22:40:11 +0000 (17:40 -0500)]
Fix typo

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1392 from cjwatson/start-ephemeral-python32
Stéphane Graber [Thu, 26 Jan 2017 16:45:20 +0000 (11:45 -0500)]
Merge pull request #1392 from cjwatson/start-ephemeral-python32

Make lxc-start-ephemeral Python 3.2-compatible

7 years agoMake lxc-start-ephemeral Python 3.2-compatible
Colin Watson [Thu, 26 Jan 2017 14:32:08 +0000 (14:32 +0000)]
Make lxc-start-ephemeral Python 3.2-compatible

On Ubuntu 12.04 LTS with Python 3.2, `lxc-start-ephemeral` breaks as
follows:

    Traceback (most recent call last):
      File "/usr/bin/lxc-start-ephemeral", line 371, in attach_as_user
      File "/usr/lib/python3.2/subprocess.py", line 515, in check_output
      File "/usr/lib/python3.2/subprocess.py", line 732, in __init__
    LookupError: unknown encoding: ANSI_X3.4-1968

This is because `universal_newlines=True` causes `subprocess` to use
`io.TextIOWrapper`, and in versions of Python earlier than 3.3 that
fetched the preferred encoding using `locale.getpreferredencoding()`
rather than `locale.getpreferredencoding(False)`, thereby changing the
locale and causing codecs to be reloaded.  However, `attach_as_user`
runs inside the container and thus can't rely on having access to the
same Python standard library on disk.

The workaround is to decode by hand instead, avoiding the temporary
change of locale.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
7 years agoMerge pull request #1388 from trofi/master
Christian Brauner [Sat, 21 Jan 2017 12:41:36 +0000 (13:41 +0100)]
Merge pull request #1388 from trofi/master

Use AC_HEADER_MAJOR to detect major()/minor()/makedev()

7 years agoUse AC_HEADER_MAJOR to detect major()/minor()/makedev()
Sergei Trofimovich [Sat, 21 Jan 2017 11:57:13 +0000 (11:57 +0000)]
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>
7 years agoMerge pull request #1382 from evgeni/lsb-cgroupfs-mount
Christian Brauner [Thu, 12 Jan 2017 14:38:27 +0000 (15:38 +0100)]
Merge pull request #1382 from evgeni/lsb-cgroupfs-mount

add cgroupfs-mount to Should-Start/Stop sysvinit LSB headers

7 years agoadd cgroupfs-mount to Should-Start/Stop sysvinit LSB headers
Evgeni Golov [Thu, 12 Jan 2017 11:50:15 +0000 (12:50 +0100)]
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>
7 years agoMerge pull request #1381 from brauner/2017-01-11/fix_volatile_containers
Serge Hallyn [Wed, 11 Jan 2017 16:05:32 +0000 (10:05 -0600)]
Merge pull request #1381 from brauner/2017-01-11/fix_volatile_containers

tools/lxc-start: remove c->is_defined(c) check

7 years agotools/lxc-start: remove c->is_defined(c) check
Christian Brauner [Wed, 11 Jan 2017 15:20:20 +0000 (16:20 +0100)]
tools/lxc-start: remove c->is_defined(c) check

We do not check here whether the container is defined, because we support
volatile containers. Which means the container does not need to be created for
it to be started. You can just pass a configuration file as argument and start
the container right away.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1373 from brauner/2016-01-02/fix_execute_and_improve_setgroups
Serge Hallyn [Sat, 7 Jan 2017 16:33:57 +0000 (10:33 -0600)]
Merge pull request #1373 from brauner/2016-01-02/fix_execute_and_improve_setgroups

start: fix execute and improve setgroups() calls

7 years agostart: check for CAP_SETGID before setgroups()
Christian Brauner [Sat, 7 Jan 2017 11:41:18 +0000 (12:41 +0100)]
start: check for CAP_SETGID before setgroups()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocaps: add lxc_cap_is_set()
Christian Brauner [Sat, 7 Jan 2017 11:40:37 +0000 (12:40 +0100)]
caps: add lxc_cap_is_set()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostart: fix execute and improve setgroups() calls
Christian Brauner [Mon, 2 Jan 2017 14:14:22 +0000 (15:14 +0100)]
start: fix execute and improve setgroups() calls

lxc_execute() and lxc-execute where broken when a user tried to switch to a
non-root uid/gid. This prevented necessary setup operations like mounting the
rootfs which require root in the user namespace. This commit separates
switching to root in the user namespace from switching to the requested uid/gid
by lxc_execute().
This should be safe: Once we switched to root in the user namespace via
setuid() and then switch to a non-root uid/gid in the user namespace for
lxc_execute() via setuid() we cannot regain root privileges again. So we can
only make us safer (Unless I forget about some very intricate user namespace
nonsense; which is not as unlikely as I try to make it sound.).

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: add uid, gid, group convenience wrappers
Christian Brauner [Mon, 2 Jan 2017 14:12:10 +0000 (15:12 +0100)]
utils: add uid, gid, group convenience wrappers

This commit adds lxc_switch_uid_gid() which allows to switch the uid and gid of
a process via setuid() and setgid() and lxc_setgroups() which allows to set
groups via setgroups(). The main advantage is that they nicely log the switches
they perform.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoRestrict package locales to en_US
Reto Gantenbein [Thu, 5 Jan 2017 06:22:35 +0000 (07:22 +0100)]
Restrict package locales to en_US

Adjust locale setup to official Fedora cloud setup. This will
shrink the image size for e.g. Fedora 25 from around 350MB to
260MB.

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoFix chroot rpmdb path
Reto Gantenbein [Sat, 7 Jan 2017 01:36:38 +0000 (02:36 +0100)]
Fix chroot rpmdb path

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoFix installing multiple packages given with '--packages'
Reto Gantenbein [Fri, 6 Jan 2017 06:06:03 +0000 (07:06 +0100)]
Fix installing multiple packages given with '--packages'

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoFix version comparison
Reto Gantenbein [Fri, 6 Jan 2017 06:03:04 +0000 (07:03 +0100)]
Fix version comparison

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoMerge pull request #1379 from brauner/2017-01-04/fix_android
Stéphane Graber [Wed, 4 Jan 2017 16:30:09 +0000 (17:30 +0100)]
Merge pull request #1379 from brauner/2017-01-04/fix_android

tools: only check for O_RDONLY

7 years agoMerge pull request #1376 from brauner/2017-01-04/sic_semper_assertis
Stéphane Graber [Wed, 4 Jan 2017 15:40:31 +0000 (16:40 +0100)]
Merge pull request #1376 from brauner/2017-01-04/sic_semper_assertis

tree-wide: Sic semper assertis!

7 years agotools: only check for O_RDONLY
Christian Brauner [Wed, 4 Jan 2017 15:28:50 +0000 (16:28 +0100)]
tools: only check for O_RDONLY

On some Android systems the lxc folders where containers are stored might be
read-only and so checking for O_RDWR, will effectively make the tools useless
on these systems, so let's dumb the check down to O_RDONLY.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotree-wide: Sic semper assertis!
Christian Brauner [Wed, 4 Jan 2017 09:28:25 +0000 (10:28 +0100)]
tree-wide: Sic semper assertis!

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1378 from Cypresslin/fix-api-test-s390x
Christian Brauner [Wed, 4 Jan 2017 12:33:52 +0000 (13:33 +0100)]
Merge pull request #1378 from Cypresslin/fix-api-test-s390x

python3-lxc: fix api_test.py on s390x

7 years agopython3-lxc: fix api_test.py on s390x
Po-Hsu Lin [Wed, 4 Jan 2017 11:23:04 +0000 (19:23 +0800)]
python3-lxc: fix api_test.py on s390x

The api_test.py script uses Trusty release by default, which does not
have s390x image. Switch to Xenial to solve this.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
7 years agoMerge pull request #1374 from brauner/2017-01-03/fix_suggest_default_idmap
Stéphane Graber [Tue, 3 Jan 2017 17:22:47 +0000 (18:22 +0100)]
Merge pull request #1374 from brauner/2017-01-03/fix_suggest_default_idmap

conf: fix suggest_default_idmap()

7 years agoconf: fix suggest_default_idmap()
Christian Brauner [Tue, 3 Jan 2017 10:08:25 +0000 (11:08 +0100)]
conf: fix suggest_default_idmap()

We need to remove the newline otherwise lxc_safe_uint() will fail as it detects
an invalid (non-numeric) char in the string.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoExplicitly mount squashfs in case autodetection fails
Reto Gantenbein [Mon, 2 Jan 2017 16:13:11 +0000 (17:13 +0100)]
Explicitly mount squashfs in case autodetection fails

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoAlso add lxc-fedora-legacy to AC_CONFIG_FILES
Reto Gantenbein [Sun, 1 Jan 2017 17:53:01 +0000 (18:53 +0100)]
Also add lxc-fedora-legacy to AC_CONFIG_FILES

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoComplete rework of lxc-fedora template
Reto Gantenbein [Sat, 31 Dec 2016 00:43:10 +0000 (01:43 +0100)]
Complete rework of lxc-fedora template

Heavily refactored version of the Fedora container creation template.
Removed compatibility to unsupported Fedora releases including sysvinit
and yum stuff. Added new commandline arguments found in other templates:

  --mirror   : To set custom HTTP(s) Fedora download mirror
  --packages : List of custom packages to install into a new container
  --debug    : Run with shell script with 'set -x'

There are also some new environment variables which can be used to
customize the template behaviour. See --help output.

Supports Fedora >=24. By default Fedora 25 will be installed except on
Fedora hosts, where the host release is taken. To simplify the code
path (or at least not make it more complex) all non-Fedora hosts will
now use the LiveOS-image based bootstrap environment even when they
would natively support rpm, yum or even dnf (e.g. Gentoo, CentOS).

Mainly runs systemd services by default (journald, networkd, resolved
logind).

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoRename fedora template to fedora-legacy
Reto Gantenbein [Sun, 25 Dec 2016 17:09:06 +0000 (18:09 +0100)]
Rename fedora template to fedora-legacy

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoMerge pull request #1365 from brauner/2016-12-25/skip_test_on_broken_overlayfs_symlinks
Stéphane Graber [Thu, 29 Dec 2016 14:09:39 +0000 (09:09 -0500)]
Merge pull request #1365 from brauner/2016-12-25/skip_test_on_broken_overlayfs_symlinks

tests: skip unpriv tests on broken overlay module

7 years agotests: skip unpriv tests on broken overlay module
Christian Brauner [Sun, 25 Dec 2016 11:26:17 +0000 (12:26 +0100)]
tests: skip unpriv tests on broken overlay module

This mainly affects Trusty. The 3.13 kernel has a broken overlay module which
does not handle symlinks correctly. This is a problem for containers that use
an overlay based rootfs since safe_mount() uses /proc/<pid>/fd/<fd-number> in
its calls to mount().

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1360 from ffontaine/master
Christian Brauner [Mon, 19 Dec 2016 08:07:55 +0000 (09:07 +0100)]
Merge pull request #1360 from ffontaine/master

Add --enable-gnutls option

7 years agoAdd --enable-gnutls option
Fabrice Fontaine [Sun, 18 Dec 2016 20:39:24 +0000 (21:39 +0100)]
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>
7 years agoMerge pull request #1343 from lifupan/master
Serge Hallyn [Fri, 16 Dec 2016 18:46:32 +0000 (12:46 -0600)]
Merge pull request #1343 from lifupan/master

confile: support the network link string pattern matching

7 years agoMerge pull request #1358 from evgeni/no-default-passwords
Christian Brauner [Thu, 15 Dec 2016 23:16:34 +0000 (00:16 +0100)]
Merge pull request #1358 from evgeni/no-default-passwords

do not set insecure passwords

7 years agoMerge pull request #1357 from evgeni/opensuse-systemd-fixes
Christian Brauner [Thu, 15 Dec 2016 23:15:47 +0000 (00:15 +0100)]
Merge pull request #1357 from evgeni/opensuse-systemd-fixes

OpenSUSE systemd fixes

7 years agodo not set insecure passwords
Evgeni Golov [Thu, 15 Dec 2016 18:52:50 +0000 (19:52 +0100)]
do not set insecure passwords

Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agolxc-opensuse: rm poweroff.target -> sigpwr.target copy
Evgeni Golov [Thu, 15 Dec 2016 19:02:10 +0000 (20:02 +0100)]
lxc-opensuse: rm poweroff.target -> sigpwr.target copy

Given commit 330ae3d350e060e5702a0e5ef5d0faeeeea8df6e:

    lxccontainer: detect if we should send SIGRTMIN+3

    This is required by systemd to cleanly shutdown. Other init systems should not
    have SIGRTMIN+3 in the blocked signals set.

we should stop poking around with sigpwr.target for systemd.

Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agodon't try to get stuff from /usr/lib/systemd on the host
Evgeni Golov [Thu, 15 Dec 2016 18:59:13 +0000 (19:59 +0100)]
don't try to get stuff from /usr/lib/systemd on the host

it might not even be there…

Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agoconfile: support the network link string pattern matching
fli [Tue, 6 Dec 2016 08:59:52 +0000 (00:59 -0800)]
confile: support the network link string pattern matching

Enable lxc network config support the following type and link:

lxc.network.type = phys
lxc.network.link = eth+

Here, the suffix '+' will trigger a string pattern matching
and when lxc find any network interfaces name prefixed with
"eth" such as "eth0", "eth1", "ethxxxx" and so on, it will
try to move them into the container's namespace; If it didn't
find any matching, it would do nothing for this configure
line.

Signed-off-by: fli <fupan.li@windriver.com>
7 years agoMerge pull request #1354 from tsdmgz/leap-422-template
Christian Brauner [Mon, 12 Dec 2016 23:11:28 +0000 (00:11 +0100)]
Merge pull request #1354 from tsdmgz/leap-422-template

templates: update openSUSE release to 42.2

7 years agoMerge pull request #1352 from evgeni/powerpc
Christian Brauner [Mon, 12 Dec 2016 21:37:44 +0000 (22:37 +0100)]
Merge pull request #1352 from evgeni/powerpc

Debian: powerpc and architecture fixes

7 years agoRemove libgcc_s1 from openSUSE template
Terzeus S. Dominguez [Mon, 12 Dec 2016 21:01:05 +0000 (05:01 +0800)]
Remove libgcc_s1 from openSUSE template

Removed libgcc_s1 because it breaks container building for openSUSE.

Related: openSUSE/obs-build#188

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
7 years agotemplates/lxc-debian.in: handle ppc hostarch -> powerpc
Santiago Ruano Rincón [Mon, 12 Dec 2016 10:12:26 +0000 (11:12 +0100)]
templates/lxc-debian.in: handle ppc hostarch -> powerpc

Signed-off-by: Santiago Ruano Rincón <santiago@debian.org>
Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agotemplates/lxc-debian.in: Fix typo in calling dpkg with --print-foreign-architectures...
Santiago Ruano Rincón [Mon, 12 Dec 2016 10:00:39 +0000 (11:00 +0100)]
templates/lxc-debian.in: Fix typo in calling dpkg with --print-foreign-architectures option

Signed-off-by: Santiago Ruano Rincón <santiago@debian.org>
Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agoSet openSUSE to be unconfined by AppArmor
Terzeus S. Dominguez [Mon, 12 Dec 2016 19:51:18 +0000 (03:51 +0800)]
Set openSUSE to be unconfined by AppArmor

Uncommented lxc.aa_profile = unconfined. Otherwise, container fails to
start up.

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
7 years agoChange openSUSE default release to Leap 42.2
Terzeus S. Dominguez [Mon, 12 Dec 2016 17:04:31 +0000 (01:04 +0800)]
Change openSUSE default release to Leap 42.2

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
7 years agoUpdate openSUSE template for Leap 42.2
Terzeus S. Dominguez [Mon, 12 Dec 2016 16:56:35 +0000 (00:56 +0800)]
Update openSUSE template for Leap 42.2

Aside from adding a 42.2 option, $DISTRO comparisons for Leap have been
changed [ exp ] => [[ exp ]] to accomodate pattern matching for future
releases.

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
7 years agoMerge pull request #1351 from Blub/cleanup/save-errno
Stéphane Graber [Sat, 10 Dec 2016 18:43:08 +0000 (19:43 +0100)]
Merge pull request #1351 from Blub/cleanup/save-errno

conf, attach: save errno across call to close

7 years agoconf, attach: save errno across call to close
Wolfgang Bumiller [Sat, 10 Dec 2016 09:18:27 +0000 (10:18 +0100)]
conf, attach: save errno across call to close

Save errno across some calls to close() since it can be
interrupted.

Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
7 years agoMerge pull request #1346 from brauner/2016-11-08/fix_attach_fd_leak_master
Stéphane Graber [Fri, 9 Dec 2016 09:37:06 +0000 (10:37 +0100)]
Merge pull request #1346 from brauner/2016-11-08/fix_attach_fd_leak_master

attach: close lsm label file descriptor

7 years agoattach: close lsm label file descriptor
Christian Brauner [Thu, 8 Dec 2016 22:13:11 +0000 (23:13 +0100)]
attach: close lsm label file descriptor

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1344 from FooDeas/fix-getty
Christian Brauner [Thu, 8 Dec 2016 13:22:32 +0000 (14:22 +0100)]
Merge pull request #1344 from FooDeas/fix-getty

templates: fix getty service startup

7 years agotemplates: fix getty service startup
FooDeas [Thu, 8 Dec 2016 13:03:10 +0000 (14:03 +0100)]
templates: fix getty service startup

Commit bf39edb39ecaea25801d716aebef798885277992 broke the handling of the getty service file with an '@' character in filename. So the startup condition was not fixed.

Because the parameter was quoted with the causal commit, the escaping has to be removed.

Signed-off-by: Andreas Eberlein foodeas@aeberlein.de
7 years agoMerge pull request #1342 from brauner/2016-12-06/fix_printf_lxc_top
Stéphane Graber [Tue, 6 Dec 2016 16:02:45 +0000 (11:02 -0500)]
Merge pull request #1342 from brauner/2016-12-06/fix_printf_lxc_top

tools: account for different architectures

7 years agotools: account for different architectures
Christian Brauner [Tue, 6 Dec 2016 15:42:28 +0000 (16:42 +0100)]
tools: account for different architectures

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1341 from attivio/lxc-top-iops
Christian Brauner [Tue, 6 Dec 2016 13:25:32 +0000 (14:25 +0100)]
Merge pull request #1341 from attivio/lxc-top-iops

attach batch mode with -b flag which prints csv output with a timestamp

7 years agoattach batch mode with -b flag which prints csv output with a timestamp
martin [Mon, 5 Dec 2016 20:09:14 +0000 (15:09 -0500)]
attach batch mode with -b flag which prints csv output with a timestamp

Signed-off-by: martin <martin@attivio.com>
7 years agoMerge pull request #1337 from stgraber/master
Christian Brauner [Sat, 3 Dec 2016 16:29:11 +0000 (11:29 -0500)]
Merge pull request #1337 from stgraber/master

tests; Don't cause test failures on cleanup errors

7 years agoMerge pull request #1340 from brauner/2016-12-02/cap_drop_keep_report_better_error
Stéphane Graber [Fri, 2 Dec 2016 19:04:03 +0000 (14:04 -0500)]
Merge pull request #1340 from brauner/2016-12-02/cap_drop_keep_report_better_error

conf: clearly report to either use drop or keep

7 years agoconf: clearly report to either use drop or keep
Christian Brauner [Fri, 2 Dec 2016 18:41:11 +0000 (19:41 +0100)]
conf: clearly report to either use drop or keep

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1338 from Blub/tools-configfile
Christian Brauner [Fri, 2 Dec 2016 15:37:12 +0000 (10:37 -0500)]
Merge pull request #1338 from Blub/tools-configfile

tools: lxc-start: set configfile after load_config

7 years agotools: lxc-start: set configfile after load_config
Wolfgang Bumiller [Fri, 2 Dec 2016 13:15:40 +0000 (14:15 +0100)]
tools: lxc-start: set configfile after load_config

Same change as in 6118210e0a which was missing in lxc-start
and back then is_defined() wasn't being called.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 years agotests; Don't cause test failures on cleanup errors
Stéphane Graber [Thu, 1 Dec 2016 23:34:00 +0000 (18:34 -0500)]
tests; Don't cause test failures on cleanup errors

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1336 from brauner/2016-11-29/use_clockgettime
Stéphane Graber [Tue, 29 Nov 2016 19:01:39 +0000 (14:01 -0500)]
Merge pull request #1336 from brauner/2016-11-29/use_clockgettime

state: use async signal safe fun in lxc_wait()

7 years agoMerge pull request #1334 from brauner/2016-11-29/correct_date_formatting
Stéphane Graber [Tue, 29 Nov 2016 18:34:02 +0000 (13:34 -0500)]
Merge pull request #1334 from brauner/2016-11-29/correct_date_formatting

log: make sure that date is correctly formatted

7 years agoMerge pull request #1333 from brauner/2016-11-29/macro_cleanups
Stéphane Graber [Tue, 29 Nov 2016 18:33:50 +0000 (13:33 -0500)]
Merge pull request #1333 from brauner/2016-11-29/macro_cleanups

tree-wide: random macro cleanups

7 years agoMerge pull request #1332 from brauner/2016-11-29/fix_possible_hanging_monitord
Stéphane Graber [Tue, 29 Nov 2016 18:33:34 +0000 (13:33 -0500)]
Merge pull request #1332 from brauner/2016-11-29/fix_possible_hanging_monitord

monitord: close mainloop on exit if we opened it

7 years agostate: use async signal safe fun in lxc_wait()
Christian Brauner [Tue, 29 Nov 2016 17:42:22 +0000 (18:42 +0100)]
state: use async signal safe fun in lxc_wait()

gettimeofday() is not async signal safe. So let's switch to clock_gettime() to
be on the safe side.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomonitord: close mainloop on exit if we opened it
Christian Brauner [Tue, 29 Nov 2016 04:42:47 +0000 (05:42 +0100)]
monitord: close mainloop on exit if we opened it

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolog: make sure that date is correctly formatted
Christian Brauner [Tue, 29 Nov 2016 06:50:29 +0000 (07:50 +0100)]
log: make sure that date is correctly formatted

- single digit months, days, hours, minutes, and seconds should always be
  preceded by a 0.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>