]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
9 years agoMerge pull request #408 from yosida95/patch-1
hallyn [Sun, 25 Jan 2015 00:01:24 +0000 (18:01 -0600)]
Merge pull request #408 from yosida95/patch-1

fix failed to fallback at lxclock_name

9 years agosystemd: enable delegate in service file
Jörg Thalheim [Fri, 19 Dec 2014 11:22:11 +0000 (12:22 +0100)]
systemd: enable delegate in service file

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoGentoo template - Add a hwaddr if there is only one veth
Vicente Olivert Riera [Fri, 23 Jan 2015 16:03:13 +0000 (16:03 +0000)]
Gentoo template - Add a hwaddr if there is only one veth

Reuse the code from the Debian template to associate a hwaddr if there
is only one veth interface in the container's config file.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agorpm: added dependency to lxc-libs to lxc package
Johannes Kastl [Fri, 23 Jan 2015 18:28:10 +0000 (19:28 +0100)]
rpm: added dependency to lxc-libs to lxc package

Ensures matching versions of lxc and lxc-libs being installed

Signed-off-by: Johannes Kastl <mail@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoSmall fix for Lua 5.3 compatibility.
Thomas Moschny [Fri, 23 Jan 2015 21:00:40 +0000 (22:00 +0100)]
Small fix for Lua 5.3 compatibility.

Signed-off-by: Thomas Moschny <thomas.moschny@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoBug #158: Deletion of unnecessary checks before a few calls of LXC functions
Markus Elfring [Sat, 24 Jan 2015 19:38:49 +0000 (20:38 +0100)]
Bug #158: Deletion of unnecessary checks before a few calls of LXC functions

The following functions return immediately if a null pointer was passed.
* container_destroy
* lxc_cgroup_process_info_free_and_remove
* lxc_cgroup_put_meta
* toss_list

It is therefore not needed that a function caller repeats a corresponding check.

This issue was fixed by using the software Coccinelle 1.0.0-rc23.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoBug #158: Deletion of unnecessary checks before calls of the function "free"
Markus Elfring [Sat, 24 Jan 2015 18:55:36 +0000 (19:55 +0100)]
Bug #158: Deletion of unnecessary checks before calls of the function "free"

The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software Coccinelle 1.0.0-rc23.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-start-ephemeral: fix pep-8 and pyflakes3
Stéphane Graber [Thu, 22 Jan 2015 16:54:46 +0000 (11:54 -0500)]
lxc-start-ephemeral: fix pep-8 and pyflakes3

This defines a missing variable and re-indents the code a bit.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agofix failed to fallback at lxclock_name
Kohei YOSHIDA [Thu, 22 Jan 2015 06:16:39 +0000 (15:16 +0900)]
fix failed to fallback at lxclock_name

lxclock_name will fallback to /tmp/$(id -u)/lxc$lxcpath/.$lxcname when failed
to create directories into rundir. But, in currently, lxclock_name returns
untill preparing directories under the /tmp, so invoker will fail to get
the container lock.  This patch fixes fixes this.

Signed-off-by: Kohei YOSHIDA <kohei.yoshida@gehirn.co.jp>
9 years agochange version to 1.1.0.rc1 in configure.ac
Stéphane Graber [Wed, 21 Jan 2015 21:19:42 +0000 (16:19 -0500)]
change version to 1.1.0.rc1 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoadd "--mask-tmp" to lxc-fedora, plus some template script fixes]
Michael Adam [Mon, 19 Jan 2015 21:50:58 +0000 (22:50 +0100)]
add "--mask-tmp" to lxc-fedora, plus some template script fixes]

Hi Michael,

do you have any concerns with the attached patch to
the fedora template that adds an option --mask-tmp
that prevents fedora/systemd from over-mounting
/tmp with tmpfs, which is useful in some cases?

Thanks - Michael

----- Forwarded message from Michael Adam <obnox@samba.org> -----

Date: Sat, 10 Jan 2015 13:12:06 +0100
From: Michael Adam <obnox@samba.org>
To: LXC development mailing-list <lxc-devel@lists.linuxcontainers.org>
Subject: Re: [lxc-devel] [PATCHES] add "--mask-tmp" to lxc-fedora, plus some
template script fixes
User-Agent: Mutt/1.5.23 (2014-03-12)

On 2015-01-10 at 13:08 +0100, Michael Adam wrote:
> On 2015-01-10 at 04:05 +0000, Serge Hallyn wrote:
>
> > The less controversial one is adding mask-tmp to the fedora template.
> > It looks fine to me, but that should go separately to mwarfield, our
> > fedora template maintainer :)
>
> I had notified mhw of my patches on irc, but apparently he is
> currently very busy.
>
> For a start, following is an update of the uncontroversial fix
> patches, i.e. the fix patche without the path ones, and without
> the mask-tmp patch.

And here comes the mask-tmp patch.
It needs to be applied onto the previous fix-patchset.

From 9589dca113535ed2f4faad89db2fab33bb8a9d7e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox@samba.org>
Date: Thu, 8 Jan 2015 10:25:24 +0100
Subject: [PATCH] lxc-fedora: add a new option --mask-tmp

This will configure the container to prevent the standard
behaviour of over-mounting /tmp with tmpfs, which can be
undesirable in some cases.

My personal use case is vagrant-lxc in combination with
vagrant-cachier.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #397 from axn/master
hallyn [Wed, 21 Jan 2015 15:33:59 +0000 (09:33 -0600)]
Merge pull request #397 from axn/master

Fix instantiation of multiple vlan interfaces with same id

9 years agoAdd common.conf.d
Stéphane Graber [Mon, 19 Jan 2015 20:16:14 +0000 (15:16 -0500)]
Add common.conf.d

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoSet kmsg to 0 by default
Stéphane Graber [Tue, 20 Jan 2015 23:40:17 +0000 (18:40 -0500)]
Set kmsg to 0 by default

It's now been proven over and over again that the symlink from /dev/kmsg
to /dev/console is harmful for everything but upstart systems. As Ubuntu
is now switching over to systemd too, lets switch the default.

Upstart users wishing to see boot messages can always set lxc.kmsg = 1
manually in their config (so long as they don't expect to then
dist-upgrade the container to systemd succesfuly).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoTurn autodev on by default
Stéphane Graber [Tue, 20 Jan 2015 23:40:16 +0000 (18:40 -0500)]
Turn autodev on by default

Now that autodev works fine with unprivileged containers and shouldn't
come with any side effect, lets turn it on by default.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoyet another problem with new overlay fs
Serge Hallyn [Mon, 19 Jan 2015 05:06:55 +0000 (05:06 +0000)]
yet another problem with new overlay fs

It turns out that the new upstream overlay fs requires that the delta
and work dirs be under the same mount.  So create a $lxcpath/tmpfs
and create delta0 and work0 under that.  If the user asks for a
tmpfs that'll be mounted under $lxcpath/tmpfs and workdir and delta0
both created under that.

This isn't heavily tested.  But if fixes mounting of 'overlay' fs
for me.

It's "not backward compatible", since it moves delta0, but that
shouldn't matter since ephemeral containers are either destroyed
on exit, or re-started with lxc-start.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agorestore the dropped bits of 1c1bb85ad2b6 and also implement the logic
S.Çağlar Onur [Sun, 18 Jan 2015 00:08:01 +0000 (19:08 -0500)]
restore the dropped bits of 1c1bb85ad2b6 and also implement the logic
suggested at
https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-December/010985.html

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoupdate hwaddr to fill in xx at create time
Serge Hallyn [Tue, 20 Jan 2015 16:59:27 +0000 (16:59 +0000)]
update hwaddr to fill in xx at create time

Commit 67702c21 regressed the case where lxc-create use a config
file with 'xx:xx' in lxc.network.hwaddr, so that the 'xx' were
preserved in the container's configuration file.  Expand those
in the unexpanded_config file whenever we are reading a
config file which is not coming from a 'lxc.include'.

The config file will have \n-terminated lines, so update
rand_complete_hwaddr to also stop on \n.

Add a test case to make sure xx gets expanded at lxc-create.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUpdate MAINTAINERS
Stéphane Graber [Mon, 19 Jan 2015 21:23:21 +0000 (16:23 -0500)]
Update MAINTAINERS

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-centos: pass releasever parameter to yum
Alexander Vladimirov [Fri, 16 Jan 2015 10:37:00 +0000 (17:37 +0700)]
lxc-centos: pass releasever parameter to yum

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Update the description of the veth in the Japanese lxc.container.conf(5)
KATOH Yasufumi [Fri, 16 Jan 2015 06:54:11 +0000 (15:54 +0900)]
doc: Update the description of the veth in the Japanese lxc.container.conf(5)

Update for the commit 38005c5

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoimplement lxc.include for directories
Serge Hallyn [Fri, 16 Jan 2015 20:22:46 +0000 (20:22 +0000)]
implement lxc.include for directories

If you have 'lxc.include = /some/dir' and /some/dir is a directory, then any
'*.conf" files under /some/dir will be read.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agofill_autodev: bind-mount if mknod fails (v3)
Serge Hallyn [Mon, 12 Jan 2015 23:56:28 +0000 (23:56 +0000)]
fill_autodev: bind-mount if mknod fails (v3)

First, rename setup_autodev to fill_autodev, since all it
does is populate it, not fully set it up.

Secondly, if mknod of a device fails, then try bind-mounting
it from the host rather than failing immediately.

Note that this isn't an urgent patch because the common.userns
configuration hook already specifies bind,create=file mount
entries for all the devices we would want.

Changelog (v3): ignore if /dev doesn't exist

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoautodev: switch strategies (v3)
Serge Hallyn [Mon, 12 Jan 2015 23:54:36 +0000 (23:54 +0000)]
autodev: switch strategies (v3)

Do not keep container devs under /dev/.lxc.  Instead, always
keep them in a small tmpfs mounted at $(mounted_root)/dev.

The tmpfs is mounted in the container monitor's namespace.  This
means that at every reboot it will get re-created.  It seems to
me this better replicates what happens on a real host.

If we want devices persisting across reboots, then perhaps we can
implement a $lxcpath/$name/keepdev directory containing devices to
bind into the container at each startup.

Changelog (v2): don't bother with the $lxcpath/$name/rootfs.dev
directory, just mount the tmpfs straight into the container.

Changelog (v3): Don't create /dev if it doesn't exist

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-download: improve help text.
Michael Adam [Thu, 15 Jan 2015 23:15:50 +0000 (00:15 +0100)]
lxc-download: improve help text.

--help and --list are special in the sense that they
are independent of the other options and exit early.
Document them separately.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-download: make --list more useful.
Michael Adam [Thu, 15 Jan 2015 23:14:15 +0000 (00:14 +0100)]
lxc-download: make --list more useful.

Make it possible to use --list without having to specify
--dist, --release, and --arch, which does not make a lot
of sense.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-download: fix typo in help text.
Michael Adam [Thu, 15 Jan 2015 23:13:35 +0000 (00:13 +0100)]
lxc-download: fix typo in help text.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoclose-all-fds: fix behavior
Serge Hallyn [Tue, 13 Jan 2015 06:02:26 +0000 (06:02 +0000)]
close-all-fds: fix behavior

We want to close all inherited fds in three cases - one, if a container
is daemonized.  Two, if the user specifies -C on the lxc-start command
line.  Three, in src/lxc/monitor.c.  The presence of -C is passed in the
lxc_conf may not always exist.

One call to lxc_check_inherited was being done from lxc_start(), which
doesn't know whether we are daemonized.  Move that call to its caller,
lxcapi_start(), which does know.

Pass an explicit closeall boolean as second argument to lxc_check_inherited.
If it is true, then all fds are closed.  If it is false, then we check
the lxc_conf->close_all_fds.

With this, all tests pass, and the logic appears correct.

Note that when -C is not true, then we only warn about inherited fds,
but we do not abort the container start.  This appears to have ben the case
since commit 92c7f6295518 in 2011.  Unfortunately the referenced URL with
the justification is no longer valid.  We may want to consider becoming
stricter about this again.  (Note that the commit did say "for now")

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-start-ephemeral: handle the overlayfs workdir option (v2)
Serge Hallyn [Tue, 13 Jan 2015 00:08:37 +0000 (00:08 +0000)]
lxc-start-ephemeral: handle the overlayfs workdir option (v2)

We fixed this some time ago for basic lxc-start, but never did
lxc-start-ephemeral.

Since the lxc-start patches were pushed, Miklos has given us a
way to detect whether we need the workdir= option.  So the
bdev.c code could be simplified to check for "overlay\n" in
/proc/filesystems just as lxc-start-ephemeral does.  This
patch doesn't do that.

Changelog (v2):
1. use 'overlay' fstype for new overlay upstream module
2. avoid using unneeded readlines().

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: clarify the description of the veth network type in the manpage.
Michael Adam [Tue, 13 Jan 2015 21:27:08 +0000 (22:27 +0100)]
doc: clarify the description of the veth network type in the  manpage.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix instantiation of multiple vlan interfaces with same id
Axel Neumann [Tue, 13 Jan 2015 09:48:52 +0000 (10:48 +0100)]
Fix instantiation of multiple vlan interfaces with same id

Container fail to start with configs (as shown below) where the same
vlan id is used for several type=vlan container interfaces.
Then, during the instantiation of the vlan interfaces, an error occurs
because the lxc code tries to assign the same temporary name to both
of them before it is bound into the container.

> lxc.network.type      = vlan
> lxc.network.flags     = up
> lxc.network.link      = eth1
> lxc.network.vlan.id   = 3842
> lxc.network.name      = iso0
>
> lxc.network.type      = vlan
> lxc.network.flags     = up
> lxc.network.link      = eth2
> lxc.network.vlan.id   = 3842
> lxc.network.name      = iso1

Signed-off-by: Axel Neumann <neumann@cgws.de>
9 years agodecide whether daemonize implies close_all_fds at start
Serge Hallyn [Tue, 13 Jan 2015 05:07:28 +0000 (23:07 -0600)]
decide whether daemonize implies close_all_fds at start

This isn't the perfect fix.  In fact close_all_fds shouldn't be stored
in the lxc_conf.  But this will fix the tests short-term.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoRevert "set close-all-fds by default"
Serge Hallyn [Tue, 13 Jan 2015 05:06:01 +0000 (23:06 -0600)]
Revert "set close-all-fds by default"

it has unfortunate reprecussions elsewhere, and the needed fix
can be done another way

This reverts commit 1f76453a74f555e30384591567d87b5b4dac7e21.

9 years agocontainertests: don't expect NULL lxc_conf
Serge Hallyn [Tue, 13 Jan 2015 04:24:26 +0000 (22:24 -0600)]
containertests: don't expect NULL lxc_conf

Because we never have that any more

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix reversed args in mount call
Serge Hallyn [Fri, 9 Jan 2015 22:00:28 +0000 (22:00 +0000)]
Fix reversed args in mount call

Riya Khanna reported that with a ramfs rootfs the mount to make
/ rprivate was returning -EFAULT.  NULL was being passed as the
mount target.  Pass "/" instead.

Reported-by: riya khanna <riyakhanna1983@gmail.com>>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoset close-all-fds by default
Serge Hallyn [Fri, 9 Jan 2015 16:33:42 +0000 (16:33 +0000)]
set close-all-fds by default

When containers request to be daemonized, close-all-fd is
set to true.  But when we switched ot daemonize-by-default we didn't
set close-all-fd by default.

Fix that.  In order to do that we have to always have a lxc_conf
object.  As a consequence, after this patch we can drop a bunch
of checks for c->lxc_conf existing.  We should consider removing
those.  This patch does not do that.

This should close https://github.com/lxc/lxc/issues/354

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-fedora: let help text fit into 80 columns
Michael Adam [Thu, 8 Jan 2015 09:22:18 +0000 (10:22 +0100)]
lxc-fedora: let help text fit into 80 columns

by breaking and shortening some lines.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-fedora: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:01:18 +0000 (10:01 +0100)]
lxc-fedora: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-fedora: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:00:06 +0000 (10:00 +0100)]
lxc-fedora: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-centos: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:03:53 +0000 (10:03 +0100)]
lxc-centos: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-centos: fix tab/space mixup in help text.
Michael Adam [Thu, 8 Jan 2015 09:03:31 +0000 (10:03 +0100)]
lxc-centos: fix tab/space mixup in help text.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-centos: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:03:05 +0000 (10:03 +0100)]
lxc-centos: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-openmandriva: protect possibly unset variable with quotes in -z check
Michael Adam [Thu, 8 Jan 2015 09:49:19 +0000 (10:49 +0100)]
lxc-openmandriva: protect possibly unset variable with quotes in -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-openmandriva: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:48:40 +0000 (10:48 +0100)]
lxc-openmandriva: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-altlinux: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:43:52 +0000 (10:43 +0100)]
lxc-altlinux: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-altlinux: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:43:12 +0000 (10:43 +0100)]
lxc-altlinux: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: protect possibly unset variable with quotes in -z check
Michael Adam [Thu, 8 Jan 2015 09:36:06 +0000 (10:36 +0100)]
lxc-opensuse: protect possibly unset variable with quotes in -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:35:20 +0000 (10:35 +0100)]
lxc-opensuse: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: fix tab/whitespace mixup in usage text.
Michael Adam [Thu, 8 Jan 2015 09:34:49 +0000 (10:34 +0100)]
lxc-opensuse: fix tab/whitespace mixup in usage text.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-debian: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 08:58:09 +0000 (09:58 +0100)]
lxc-debian: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-debian: document "--clean" in the usage.
Michael Adam [Thu, 8 Jan 2015 08:38:48 +0000 (09:38 +0100)]
lxc-debian: document "--clean" in the usage.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-debian: fix parsing of option "--clean": it takes no argument.
Michael Adam [Thu, 8 Jan 2015 08:32:39 +0000 (09:32 +0100)]
lxc-debian: fix parsing of option "--clean": it takes no argument.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #393 from martinpitt/master
hallyn [Thu, 8 Jan 2015 16:57:57 +0000 (10:57 -0600)]
Merge pull request #393 from martinpitt/master

apparmor: Fix slave bind mounts

9 years agoapparmor: Fix slave bind mounts
Martin Pitt [Thu, 8 Jan 2015 12:09:37 +0000 (13:09 +0100)]
apparmor: Fix slave bind mounts

The permission to make a mount "slave" is spelt "make-slave", not "slave", see
https://launchpad.net/bugs/1401619. Also, we need to make all mounts slave, not
just the root dir.

https://launchpad.net/bugs/1350947

9 years agoAlso drop caps in unpriv containers
Stéphane Graber [Thu, 25 Dec 2014 23:17:25 +0000 (00:17 +0100)]
Also drop caps in unpriv containers

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoapparmor: Block access to /proc/kcore
Stéphane Graber [Sun, 28 Dec 2014 17:33:29 +0000 (18:33 +0100)]
apparmor: Block access to /proc/kcore

Just like we block access to mem and kmem, there's no good reason for
the container to have access to kcore.

Reported-by: Marc Schaefer
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-alpine: use yaml for detection of latest release
Natanael Copa [Wed, 31 Dec 2014 07:31:45 +0000 (08:31 +0100)]
lxc-alpine: use yaml for detection of latest release

Alpine Linux provides yaml files with latest release instead of the old
approach with .latest.txt.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-fedora: In fedora21, the fedora-repos package is needed.
Michael Adam [Fri, 2 Jan 2015 19:28:59 +0000 (20:28 +0100)]
lxc-fedora: In fedora21, the fedora-repos package is needed.

fedora-release has been split into fedora-release and fedora-repos.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-fedora: when using systemd, set lxc.kmsg = 0 in the config
Michael Adam [Fri, 2 Jan 2015 20:12:21 +0000 (21:12 +0100)]
lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config

This is to prevent systemd-journald to enter a 100% cpu loop.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong...
Johannes Kastl [Wed, 17 Dec 2014 20:06:34 +0000 (21:06 +0100)]
lxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong version of build package is installed

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-opensuse: default release changed to 13.1, as 12.3 reaches end-of-life soon
Johannes Kastl [Fri, 12 Dec 2014 20:51:21 +0000 (21:51 +0100)]
lxc-opensuse: default release changed to 13.1, as 12.3 reaches end-of-life soon

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoEnable seccomp by default for unprivileged users.
Serge Hallyn [Fri, 19 Dec 2014 18:23:52 +0000 (18:23 +0000)]
Enable seccomp by default for unprivileged users.

In contrast to what the comment above the line disabling it said,
it seems to work just fine.  It also is needed on current kernels
(until Eric's patch hits upstream) to prevent unprivileged containers
from hosing fuse filesystems they inherit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoseccomp: add rule to reject umount -f
Serge Hallyn [Fri, 19 Dec 2014 18:22:55 +0000 (18:22 +0000)]
seccomp: add rule to reject umount -f

If a container has a bind mount from a host nfs or fuse
filesystem, and does 'umount -f', it will disconnect the
host's filesystem.  This patch adds a seccomp rule to
block umount -f from a container.  It also adds that rule
to the default seccomp profile.

Thanks stgraber for the idea :)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agotypofixes - https://github.com/vlajos/misspell_fixer
Veres Lajos [Thu, 4 Dec 2014 21:57:38 +0000 (21:57 +0000)]
typofixes - https://github.com/vlajos/misspell_fixer

Signed-off-by: Veres Lajos <vlajos@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agormdir and lxc_unpriv returns non-negative error codes
S.Çağlar Onur [Thu, 4 Dec 2014 17:59:47 +0000 (12:59 -0500)]
rmdir and lxc_unpriv returns non-negative error codes

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoaudit: added capacity and reserve() to nlmsg
Shuai Zhang [Sun, 30 Nov 2014 13:03:37 +0000 (21:03 +0800)]
audit: added capacity and reserve() to nlmsg

There are now two (permitted) ways to add data to netlink message:

 1. put_xxx()
 2. call nlmsg_reserve() to get a pointer to newly reserved room within the
    original netlink message, then write or memcpy data to that area.

Both of them guarantee adding requested length data do not overflow the
pre-allocated message buffer by checking against its cap field first.

And there may be no need to access nlmsg_len outside nl module, because both
put_xxx() and nlmsg_reserve() have alread did that for us.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agotests: try again when waitpid() sets errno as EINTR
Arjun Sreedharan [Thu, 4 Dec 2014 08:56:04 +0000 (14:26 +0530)]
tests: try again when waitpid() sets errno as EINTR

when waitpid() is interrupted, errno is not set to the negative
value -EINTR. It is set to EINTR. check against EINTR.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agochange version to 1.1.0.alpha3 in configure.ac
Stéphane Graber [Wed, 3 Dec 2014 19:59:15 +0000 (14:59 -0500)]
change version to 1.1.0.alpha3 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agofixed typo in comment
Shuai Zhang [Wed, 3 Dec 2014 06:13:20 +0000 (14:13 +0800)]
fixed typo in comment

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoImprove veth error cases logging
Stéphane Graber [Wed, 3 Dec 2014 16:01:45 +0000 (11:01 -0500)]
Improve veth error cases logging

The previous error message made it look like the host interface name was
the concatenation of both the host and guest interface names.

Closes #374

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-debian: mask both Wheezy and Jessie udev services
Cameron Norman [Mon, 1 Dec 2014 21:35:52 +0000 (13:35 -0800)]
lxc-debian: mask both Wheezy and Jessie udev services

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-debian: adjust init system configurations
Cameron Norman [Mon, 1 Dec 2014 21:29:26 +0000 (13:29 -0800)]
lxc-debian: adjust init system configurations

Do as much as possible to allow containers switching from non-systemd to
systemd to work as intended (but nothing that will cause side effects).
Use update-rc.d disable instead of remove so the init scripts are not
re-enabled when the package is updated

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Always include the Japanese lxc-top manpage
KATOH Yasufumi [Tue, 2 Dec 2014 09:20:15 +0000 (18:20 +0900)]
doc: Always include the Japanese lxc-top manpage

Update for commit e71549f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAdd the Japanese translation for the lxc.init_cmd config option
KATOH Yasufumi [Tue, 2 Dec 2014 09:15:34 +0000 (18:15 +0900)]
Add the Japanese translation for the lxc.init_cmd config option

Update for commit 67c660d

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRevert "audit: added capacity and reserve() to nlmsg"
Stéphane Graber [Mon, 1 Dec 2014 20:37:42 +0000 (15:37 -0500)]
Revert "audit: added capacity and reserve() to nlmsg"

This reverts commit 55ae7edb18c503a4b869dd0089f25f03a05a6563.

This change caused hangs in the testsuite, specifically with lxc-user-nic.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAllow lxc_clear_config_item to clear idmaps.
Casey Marshall [Fri, 28 Nov 2014 07:11:06 +0000 (01:11 -0600)]
Allow lxc_clear_config_item to clear idmaps.

Ran into this when trying to automate stgraber's "GUI in containers"
post.

Signed-off-by: Casey Marshall <casey.marshall@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoIssue #278: lxc-start-ephemeral: add --cdir option for cow-mounts
overlay fs [Wed, 26 Nov 2014 17:11:43 +0000 (04:11 +1100)]
Issue #278: lxc-start-ephemeral: add --cdir option for cow-mounts

This is a copy of patch version 3 for issue #278 on the issue-tracker:

 - Allow multiple bind-mounts (--bdir) and multiple cow-mounts (--cdir).

 - Further fixes to permissions throughout lxc-start-ephemeral (annotated
   in the code).

Signed-off by: Oleg Freedholm <overlayfs@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.
Johannes Kastl [Sat, 29 Nov 2014 20:43:26 +0000 (21:43 +0100)]
lxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Always include the lxc-top manpage
Stéphane Graber [Thu, 27 Nov 2014 19:33:30 +0000 (14:33 -0500)]
doc: Always include the lxc-top manpage

Since it's no longer written in lua.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoDefine a new lxc.init_cmd config option
Stéphane Graber [Wed, 26 Nov 2014 19:33:27 +0000 (14:33 -0500)]
Define a new lxc.init_cmd config option

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
9 years agotabs/spaces consistency
Stéphane Graber [Wed, 26 Nov 2014 19:23:05 +0000 (14:23 -0500)]
tabs/spaces consistency

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAdd missing files to ignore list
Stéphane Graber [Wed, 26 Nov 2014 20:28:38 +0000 (15:28 -0500)]
Add missing files to ignore list

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
9 years agoaudit: added capacity and reserve() to nlmsg
Shuai Zhang [Sun, 30 Nov 2014 13:03:37 +0000 (21:03 +0800)]
audit: added capacity and reserve() to nlmsg

There are now two (permitted) ways to add data to netlink message:

1. put_xxx()
2. call nlmsg_reserve() to get a pointer to newly reserved room within the
   original netlink message, then write or memcpy data to that area.

Both of them guarantee adding requested length data do not overflow the
pre-allocated message buffer by checking against its cap field first.

And there may be no need to access nlmsg_len outside nl module, because both
put_xxx() and nlmsg_reserve() have alread did that for us.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-opensuse: Disable on 13.2
Johannes Kastl [Wed, 26 Nov 2014 19:20:05 +0000 (20:20 +0100)]
lxc-opensuse: Disable on 13.2
Disabled building openSUSE containers on openSUSE 13.2 and  openSUSE
Tumbleweed due to faulty behaviour with newer versions of
init_buildsystem.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-alpine: create a default tty for console
Natanael Copa [Thu, 27 Nov 2014 14:21:21 +0000 (15:21 +0100)]
lxc-alpine: create a default tty for console

Create a tty so we get login prompt on console by default

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-alpine: make sure /dev/shm is world writeable
Natanael Copa [Thu, 27 Nov 2014 14:20:50 +0000 (15:20 +0100)]
lxc-alpine: make sure /dev/shm is world writeable

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agofix wrong nlmsg_len
Shuai Zhang [Thu, 27 Nov 2014 12:38:01 +0000 (20:38 +0800)]
fix wrong nlmsg_len

nlmsg_len is the length of message including header.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix nbd partition id test
Stéphane Graber [Wed, 26 Nov 2014 21:40:04 +0000 (16:40 -0500)]
Fix nbd partition id test

Reported-by: David Binderman
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRemounts bind mounts if read-only flag is provided
Abin Shahab [Wed, 12 Nov 2014 00:06:52 +0000 (00:06 +0000)]
Remounts bind mounts if read-only flag is provided

Bind mounts do not honor filesystem mount options. This change will
remount filesystems that are bind mounted if there are changes to
filesystem mount options, specifically if the mount is readonly.

Signed-off-by: Abin Shahab <ashahab@altiscale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: change "-t" option of lxc-create(1) to being required
KATOH Yasufumi [Wed, 26 Nov 2014 07:20:54 +0000 (16:20 +0900)]
doc: change "-t" option of lxc-create(1) to being required

* fix "reg" to "req" in English (fix for commit b8683fe)
* change "opt" to "req" in Japanese

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: Check if given argument is a valid release
Johannes Kastl [Fri, 14 Nov 2014 20:57:33 +0000 (21:57 +0100)]
lxc-opensuse: Check if given argument is a valid release

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-opensuse: Added explanation on how to use the template
Johannes Kastl [Thu, 6 Nov 2014 15:29:25 +0000 (16:29 +0100)]
lxc-opensuse: Added explanation on how to use the template

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-opensuse: template now understands release arguments
Johannes Kastl [Thu, 6 Nov 2014 15:24:40 +0000 (16:24 +0100)]
lxc-opensuse: template now understands release arguments

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Update kernel and cgroup info in Japanese lxc(7)
KATOH Yasufumi [Tue, 25 Nov 2014 08:16:08 +0000 (17:16 +0900)]
doc: Update kernel and cgroup info in Japanese lxc(7)

Update for commit 0dcbd62

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-create -t option is not optional
Silvio Fricke [Wed, 12 Nov 2014 09:45:06 +0000 (10:45 +0100)]
lxc-create -t option is not optional

Closes: #355
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix lxc-centos.in typo.
謝致邦 [Thu, 6 Nov 2014 10:38:08 +0000 (18:38 +0800)]
Fix lxc-centos.in typo.

Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix lxc-openmandriva.in typo.
謝致邦 [Thu, 6 Nov 2014 10:43:31 +0000 (18:43 +0800)]
Fix lxc-openmandriva.in typo.

Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoopenwrt: add common configuration file
Petar Koretic [Thu, 30 Oct 2014 12:41:49 +0000 (12:41 +0000)]
openwrt: add common configuration file

This adds OpenWrt common config file.

Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
CC: Luka Perkov <luka.perkov@sartura.hr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-cirros: support creating+running unprivileged
Serge Hallyn [Fri, 31 Oct 2014 02:42:31 +0000 (02:42 +0000)]
lxc-cirros: support creating+running unprivileged

Support creation and use of lxc-cirros by unprivileged users.

If we detect we are an unprivileged user, then insist that we
be in a userns with a id mapping.

If we are in a userns, then don't extract /dev when extracting
the rootfs.

If we are not root, then save the tarball to ~/.cache/lxc/cirros
instead of /var/cache/lxc/cirros.

If we are not roo, then include entries to auto-mount proc and sys,
as well as bind-mount devices.

Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoconf.c: change 'instanciate' to 'instantiate'
Joel Nider [Sun, 9 Nov 2014 16:41:12 +0000 (18:41 +0200)]
conf.c: change 'instanciate' to 'instantiate'

This is a multipart message in MIME format.

Fixes a small (but consistent) spelling mistake in conf.c

Signed-off-by: Joel Nider <joeln@il.ibm.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>