]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
10 years agoautostart: Fix bug with containers being started in reverse order 465/head
Bostjan Skufca [Wed, 4 Mar 2015 19:07:52 +0000 (20:07 +0100)] 
autostart: Fix bug with containers being started in reverse order

Signed-off-by: Bostjan Skufca <bostjan@a2o.si>
10 years agoUpdate Travis configuration 451/head 461/head
Stéphane Graber [Mon, 23 Feb 2015 23:39:19 +0000 (18:39 -0500)] 
Update Travis configuration

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-busybox: use lxc.rebootsignal = SIGTERM
Bogdan Purcareata [Mon, 16 Feb 2015 09:38:36 +0000 (09:38 +0000)] 
lxc-busybox: use lxc.rebootsignal = SIGTERM

Otherwise lxc-stop -r has no effect on the container.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agodocument lxc.rebootsignal
Bogdan Purcareata [Mon, 16 Feb 2015 09:38:35 +0000 (09:38 +0000)] 
document lxc.rebootsignal

Also fix some minor indentation mishaps since we're here.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoadd lxc.rebootsignal
Bogdan Purcareata [Mon, 16 Feb 2015 09:38:34 +0000 (09:38 +0000)] 
add lxc.rebootsignal

Following the model of f0f1d8c076ae93d8ecf735c2eeae471e27ca6abd, add a reboot
signal for special init processes that work on something other than SIGINT.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agodoc: Add about zfs, aufs, overlayfs to '-s' option of lxc-clone(1)
KATOH Yasufumi [Tue, 10 Feb 2015 07:19:09 +0000 (16:19 +0900)] 
doc: Add about zfs, aufs, overlayfs to '-s' option of lxc-clone(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Update lxc-snapshot(1) for moving snapshot directory
KATOH Yasufumi [Tue, 10 Feb 2015 07:26:58 +0000 (16:26 +0900)] 
doc: Update lxc-snapshot(1) for moving snapshot directory

At the commit 18aa217, the snapshot dir was moved to /var/lib/lxc/c/snaps.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoMerge pull request #444 from tukiyo/patch-1
Stéphane Graber [Wed, 18 Feb 2015 02:28:11 +0000 (21:28 -0500)] 
Merge pull request #444 from tukiyo/patch-1

no such option: --releasever on CentOS5's yum

10 years agono such option: --releasever on CentOS5's yum 444/head
tukiyo [Tue, 17 Feb 2015 01:05:25 +0000 (10:05 +0900)] 
no such option: --releasever on CentOS5's yum

Signed-off-by: tukiyo3 <tukiyo3@gmail.com>
10 years agoMerge pull request #441 from ovr/patch-1
Stéphane Graber [Mon, 16 Feb 2015 14:15:58 +0000 (09:15 -0500)] 
Merge pull request #441 from ovr/patch-1

Update CONTRIBUTING

10 years agoUpdate CONTRIBUTING 441/head
Дмитрий Пацура [Sat, 14 Feb 2015 14:30:49 +0000 (22:30 +0800)] 
Update CONTRIBUTING

Signed-off-by: Dmitry Patsura <talk@dmtry.me>
10 years agoconfig: Allow all containers to use fuse
brauner [Sun, 8 Feb 2015 15:48:31 +0000 (16:48 +0100)] 
config: Allow all containers to use fuse

This enables containers to mount fuse filesystems per default. The mount
is designed to be safe. Hence, it can be enabled per default in
common.conf. It will lead to a cleaner boot for some unprivileged
systemd-based containers.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoIn lxc.mount.auto, skip on ENONENT
Stéphane Graber [Mon, 2 Feb 2015 09:21:20 +0000 (11:21 +0200)] 
In lxc.mount.auto, skip on ENONENT

This resolves the case where /proc/sysrq-trigger doesn't exist by simply
ignoring any mount failure on ENOENT. With the current mount list, this
will always result in a safe environment (typically the read-only
underlay).

Closes #425

v2: Don't always show an error

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoproc:mixed make /proc/sys/net writable
Stéphane Graber [Tue, 3 Feb 2015 07:21:18 +0000 (09:21 +0200)] 
proc:mixed make /proc/sys/net writable

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoProcess command line is null terminated
Tycho Andersen [Wed, 4 Feb 2015 12:02:02 +0000 (14:02 +0200)] 
Process command line is null terminated

It turns out the process command line is in fact null terminated on the stack;
this caused a bug where when the new process title was smaller than the old
one, the first environment entry would be rendered as part of the process
title.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoplamo: Change how to create objects under /dev in the container
KATOH Yasufumi [Fri, 6 Feb 2015 05:25:58 +0000 (14:25 +0900)] 
plamo: Change how to create objects under /dev in the container

lxc-plamo stop:
* creating objects under /dev when creating the container
* removing /dev population process from original rc script

now populate /dev at container boot time, and allow to enable
lxc.autodev=1

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agogetproctitle - check for null after last strchr
Serge Hallyn [Sat, 31 Jan 2015 13:09:47 +0000 (14:09 +0100)] 
getproctitle - check for null after last strchr

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoAlso define PR_SET_MM (fixes Android)
Stéphane Graber [Fri, 30 Jan 2015 17:24:04 +0000 (18:24 +0100)] 
Also define PR_SET_MM (fixes Android)

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodefine some macros to fix the build
Tycho Andersen [Fri, 30 Jan 2015 14:53:53 +0000 (15:53 +0100)] 
define some macros to fix the build

Not all kernels have these macros; they'll just give an EINVAL if/when invoked.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoset the monitor process title to something useful
Tycho Andersen [Fri, 30 Jan 2015 13:59:13 +0000 (14:59 +0100)] 
set the monitor process title to something useful

Instead of having a parent process that's called whatever the caller of the
library is called, we instead set it to "[lxc monitor] <lxcpath> <container>"

Closes #180

v2: check for null in tok for loop, only truncate environment when necessary

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agochange version to 1.1.0 in configure.ac lxc-1.1.0
Stéphane Graber [Fri, 30 Jan 2015 13:11:30 +0000 (14:11 +0100)] 
change version to 1.1.0 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Add the description of sys:mixed in Japanese lxc.container.conf(5)
KATOH Yasufumi [Fri, 30 Jan 2015 07:05:59 +0000 (16:05 +0900)] 
doc: Add the description of sys:mixed in Japanese lxc.container.conf(5)

Update for commit f24a52d

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoapparmor: support lxc.ttydir when bind-mounting ptys
Serge Hallyn [Thu, 29 Jan 2015 23:50:41 +0000 (23:50 +0000)] 
apparmor: support lxc.ttydir when bind-mounting ptys

Because we now create the ttys from inside the container, we had to
add an apparmor rule for start-container to bind-mount /dev/pts/** -> /dev/tty*/.
However that's not sufficient if the container sets lxc.ttydir, in
which case we need to support mounting onto files in subdirs of /dev.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoubuntu: Drop lucid support and refresh releaess list
Stéphane Graber [Thu, 29 Jan 2015 22:06:05 +0000 (23:06 +0100)] 
ubuntu: Drop lucid support and refresh releaess list

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle: Fix /dev/shm
Stéphane Graber [Thu, 29 Jan 2015 21:59:59 +0000 (22:59 +0100)] 
oracle: Fix /dev/shm

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agocentos: Fix booting a Centos 6 container
Stéphane Graber [Thu, 29 Jan 2015 21:59:58 +0000 (22:59 +0100)] 
centos: Fix booting a Centos 6 container

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agochange version to 1.1.0.rc4 in configure.ac lxc-1.1.0.rc4
Stéphane Graber [Thu, 29 Jan 2015 22:55:55 +0000 (23:55 +0100)] 
change version to 1.1.0.rc4 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoclone_paths: use 'rootfs' for destination directory
Serge Hallyn [Thu, 29 Jan 2015 16:09:45 +0000 (16:09 +0000)] 
clone_paths: use 'rootfs' for destination directory

We were trying to be smart and use whatever the last part of
the container's rootfs path was.  However for block devices
that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
chances are that /var/lib/lxc/c1/md-1 does not exist.

So always use the $lxcpath/$lxcname/rootfs, and if it does
not exist, try to create it.

With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocreate lxc.tty ptys from container process
Serge Hallyn [Thu, 29 Jan 2015 10:13:36 +0000 (10:13 +0000)] 
create lxc.tty ptys from container process

Lxc has always created the ptys for use by console and ttys early
on from the monitor process.  This has some advantages, but also
has disadvantages, namely (1) container ptys counting against the
max ptys for the host, and (2) not having a /dev/pts/N in the
container to pass to getty.  (2) was not a problem for us historically
because we bind-mounted the host's /dev/pts/N onto a /dev/ttyN in
the container.  However, systemd hardocdes a check for container_ttys
that the path have 'pts/' in it.  If it were only for (2) I'd have
opted for a systemd patch to check the device major number, but (1)
made it worth moving the openpty to the container namespace.

So this patch moves the tty creation into the task which becomes
the container init.  It then passes the fds for the opened ptys
back to the monitor over a unix socketpair (for use by lxc-console).
The /dev/console is still created in the monitor process, so that
it can for instance be used by lxc.logfd.

So now if you have a foreground container with lxc.tty = 4, you
should end up with one host /dev/pts entry per container rather than 5.

And lxc-console now works with systemd containers.

Note that if the container init mounts its own devpts over the
one mounted by lxc, the tty /dev/pts/n will be hidden.  This is ok
since it's only systemd that needs it, and systemd won't do that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoUse consistent /proc, /sys and /sys/fs/cgroup (v2)
Stéphane Graber [Wed, 28 Jan 2015 18:41:26 +0000 (19:41 +0100)] 
Use consistent /proc, /sys and /sys/fs/cgroup (v2)

 - Implements mixed mode for /sys where it's mounted read-only but with
   /sys/devices/virtual/net/ writable.

 - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all
   templates.

 - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup.

 - Get rid of the fstab file by default, using lxc.mount.entry instead.

 - Set sys:mixed as the default for "sys". sys:mixed is slightly more
   permissive than sys:ro so this shouldn't be a problem.

The read-only bind mount of /sys on top of itself is there so that
mountall and other init systems don't attempt to remount /sys
read-write.

v2 changes:
 - Fix the mount list, don't specify a source for the remount.
 - Update the documentation.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoFix clearing IPv4/IPv6 addresses
Stéphane Graber [Wed, 28 Jan 2015 09:33:58 +0000 (10:33 +0100)] 
Fix clearing IPv4/IPv6 addresses

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-{centos|fedora}: Respect --rootfs
Stéphane Graber [Wed, 28 Jan 2015 08:47:44 +0000 (09:47 +0100)] 
lxc-{centos|fedora}: Respect --rootfs

Close #406

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoFix lxc-create -h with absolute template path
Stéphane Graber [Wed, 28 Jan 2015 08:28:22 +0000 (09:28 +0100)] 
Fix lxc-create -h with absolute template path

Close #421

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agosystemd: specify container_ttys in environment
Serge Hallyn [Tue, 27 Jan 2015 23:06:22 +0000 (23:06 +0000)] 
systemd: specify container_ttys in environment

The lxc.tty configuration item specifies a number of ttys to create.
Historically, for each of those, we create a /dev/pts/N entry and
symlink it to /dev/ttyN for older inits to use.  For systemd, we should
instead specify each tty name in a $container_ttys environment variable
passed to init.

See http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ and
https://github.com/lxc/lxc/issues/419.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoOnly use clear_config_item for lists
Stéphane Graber [Tue, 27 Jan 2015 17:02:13 +0000 (18:02 +0100)] 
Only use clear_config_item for lists

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoclear_config_item should only work for lists
Stéphane Graber [Mon, 26 Jan 2015 20:52:11 +0000 (15:52 -0500)] 
clear_config_item should only work for lists

Close #394

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-plamo: remove unnecessary lxc.autodev=0
KATOH Yasufumi [Tue, 27 Jan 2015 11:54:17 +0000 (20:54 +0900)] 
lxc-plamo: remove unnecessary lxc.autodev=0

It is set in plamo.common.conf, so it do not need in plamo.userns.conf

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-plamo: Set lxc.autodev to 0
KATOH Yasufumi [Tue, 27 Jan 2015 09:48:14 +0000 (18:48 +0900)] 
lxc-plamo: Set lxc.autodev to 0

At this time, a container that is created by lxc-plamo can't work with
lxc.autodev=1

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoMerge pull request #420 from hallyn/fixbusybox.1
Stéphane Graber [Tue, 27 Jan 2015 09:33:26 +0000 (09:33 +0000)] 
Merge pull request #420 from hallyn/fixbusybox.1

fix busybox unpriv

10 years agofix busybox unpriv 420/head
Serge Hallyn [Tue, 27 Jan 2015 09:29:17 +0000 (10:29 +0100)] 
fix busybox unpriv

1. tty5 is not needed
2. the devices should be optional in case they didn't exist in the
host / parent-container
3. switch from 'touch $rootfs/dev/$dev' to using create=file in the
mount entry.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoChange the default value of kmsg and autodev in Japanese man
KATOH Yasufumi [Tue, 27 Jan 2015 05:49:24 +0000 (14:49 +0900)] 
Change the default value of kmsg and autodev in Japanese man

Update Japanese lxc.container.conf(5) for commit 124fa0a and d89de23.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochange version to 1.1.0.rc3 in configure.ac lxc-1.1.0.rc3
Stéphane Graber [Mon, 26 Jan 2015 23:03:44 +0000 (18:03 -0500)] 
change version to 1.1.0.rc3 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoUse 'overlay' as fs name when needed
Serge Hallyn [Mon, 26 Jan 2015 05:58:50 +0000 (05:58 +0000)] 
Use 'overlay' as fs name when needed

Close #389

We will probably also want to switch the order of the mount attempts, as
the new overlay fs should quickly become the more common scenario.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolua: fix crash on missing blkio
Stéphane Graber [Mon, 26 Jan 2015 05:11:55 +0000 (00:11 -0500)] 
lua: fix crash on missing blkio

Closes: #403
Signed-off-by: Dwight Engen
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochange version to 1.1.0.rc2 in configure.ac lxc-1.1.0.rc2
Stéphane Graber [Sun, 25 Jan 2015 20:45:37 +0000 (15:45 -0500)] 
change version to 1.1.0.rc2 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoimprove "lxc-create -t debian -h" help text
Tomas Pospisek [Sun, 25 Jan 2015 15:27:10 +0000 (16:27 +0100)] 
improve "lxc-create -t debian -h" help text

- document environment variables
- add missing --packages switch to command line
- describe how to pass template options to lxc-create (since
  lxc-create -h doesn't tell you)
- render help text in the same pretty format as lxc-create does

Signed-off-by: Tomáš Posíšek <tpo_deb@sourcepole.ch>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoreplace deprecated `index` with `strchr`
Patrick O'Leary [Wed, 17 Dec 2014 01:47:21 +0000 (19:47 -0600)] 
replace deprecated `index` with `strchr`

The `index` libc function was removed in POSIX 2008, and `strchr` is a direct
replacement. The bionic (Android) libc has removed `index` when you are
compiling for a 64-bit architecture, such as AArch64.

Signed-off-by: Patrick O'Leary <patrick.oleary@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agofix failed to fallback at lxclock_name 408/head
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>
10 years agochange version to 1.1.0.rc1 in configure.ac lxc-1.1.0.rc1
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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agoFix instantiation of multiple vlan interfaces with same id 397/head
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>
10 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>
10 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.

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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