]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
10 years agobig big login delays in CentOS 7 systemd 342/head
tukiyo [Thu, 9 Oct 2014 21:44:45 +0000 (06:44 +0900)] 
big big login delays in CentOS 7 systemd

10 years agoInclude network prefix when ipv4/ipv6 keys are queried
Sergio Jimenez [Wed, 24 Sep 2014 21:55:14 +0000 (23:55 +0200)] 
Include network prefix when ipv4/ipv6 keys are queried

Signed-off-by: Sergio Jimenez <tripledes@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoadd src/python-lxc/setup.py into .gitignore
S.Çağlar Onur [Wed, 24 Sep 2014 21:28:24 +0000 (17:28 -0400)] 
add src/python-lxc/setup.py into .gitignore

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochange version to 1.0.6 in configure.ac lxc-1.0.6
Stéphane Graber [Wed, 24 Sep 2014 19:58:40 +0000 (15:58 -0400)] 
change version to 1.0.6 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix presentation of IPv6 addresses and gateway
Andre Nathan [Wed, 24 Sep 2014 13:08:50 +0000 (10:08 -0300)] 
Fix presentation of IPv6 addresses and gateway

Signed-off-by: Andre Nathan <andre@digirati.com.br>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodownload: Make --keyserver actually work
Stéphane Graber [Tue, 23 Sep 2014 14:23:27 +0000 (10:23 -0400)] 
download: Make --keyserver actually work

Reported-by: NeilGreenwood <neil.greenwood@gmail.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix the unprivileged tests cgroup management
Stéphane Graber [Mon, 22 Sep 2014 22:08:49 +0000 (18:08 -0400)] 
Fix the unprivileged tests cgroup management

To cover all the cases we have around, we need to:
 - Attempt to use cgm if present (preferred)
 - Attempt to use cgmanager directly over dbus otherwise
 - Fallback to cgroupfs

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agodoc: Add description about ignoring lxc.cgroup.use when using cgmanager
KATOH Yasufumi [Tue, 23 Sep 2014 13:36:03 +0000 (22:36 +0900)] 
doc: Add description about ignoring lxc.cgroup.use when using cgmanager

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix build failure due to slightly different rmdir
Stéphane Graber [Mon, 22 Sep 2014 22:21:47 +0000 (18:21 -0400)] 
Fix build failure due to slightly different rmdir

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-archlinux: Properly set default locale in /etc/locale.conf
Bill Kolokithas [Thu, 21 Aug 2014 12:52:50 +0000 (15:52 +0300)] 
lxc-archlinux: Properly set default locale in /etc/locale.conf

Signed-off-by: Bill Kolokithas <kolokithas.b@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoAs discussed on ML, do not clean autodev dir on reboot
Jean-Tiare LE BIGOT [Wed, 13 Aug 2014 08:30:56 +0000 (10:30 +0200)] 
As discussed on ML, do not clean autodev dir on reboot

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoclean autodev dir on container exit
Jean-Tiare LE BIGOT [Wed, 13 Aug 2014 08:30:04 +0000 (10:30 +0200)] 
clean autodev dir on container exit

When "lxc.autodev = 1", LXC creates automatically a "/dev/.lxc/<name>.<hash>"
folder to put container's devices in so that they are visible from both
the host and the container itself.

On container exit (ne it normal or not), this folder was not cleaned
which made "/dev" folder grow continuously.

We fix this by adding a new `int lxc_delete_autodev(struct lxc_handler
*handler)` called from `static void lxc_fini(const char *name, struct
lxc_handler *handler)`.

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_map_ids: add a comment
Serge Hallyn [Mon, 15 Sep 2014 00:35:02 +0000 (00:35 +0000)] 
lxc_map_ids: add a comment

Explain why we insist that root use newuidmap if it is available.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_map_ids: don't do bogus chekc for newgidmap
Serge Hallyn [Fri, 22 Aug 2014 03:50:36 +0000 (22:50 -0500)] 
lxc_map_ids: don't do bogus chekc for newgidmap

If we didn't find newuidmap, then simply require the caller to be
root and write to /proc/self/uidmap manually.  Checking for
newgidmap to exist is bogus.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoFix build error(ISO C90 specs violation) in lxc.c
Masami Ichikawa [Mon, 22 Sep 2014 14:32:46 +0000 (23:32 +0900)] 
Fix build error(ISO C90 specs violation) in lxc.c

This patch fixes following build errors.

running build_ext
building '_lxc' extension
creating build/temp.linux-x86_64-3.4
gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -I../../src -I../../src -I/usr/include/python3.4m -c lxc.c -o ./build/temp.linux-x86_64-3.4/lxc.o
lxc.c: In function ‘convert_tuple_to_char_pointer_array’:
lxc.c:49:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
     char **result = (char**) calloc(argc + 1, sizeof(char*));
     ^
lxc.c:60:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
         char *str = NULL;
         ^
lxc.c: In function ‘Container_get_cgroup_item’:
lxc.c:822:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
     char* value = (char*) malloc(sizeof(char)*len + 1);
     ^
lxc.c: In function ‘Container_get_config_item’:
lxc.c:861:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
     char* value = (char*) malloc(sizeof(char)*len + 1);
     ^
lxc.c: In function ‘Container_get_keys’:
lxc.c:903:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
     char* value = (char*) malloc(sizeof(char)*len + 1);
     ^
cc1: some warnings being treated as errors
error: command 'gcc' failed with exit status 1
Makefile:472: recipe for target 'all' failed
make[3]: *** [all] Error 1
make[3]: Leaving directory '/home/masami/codes/lxc/src/python-lxc'
Makefile:394: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/masami/codes/lxc/src'
Makefile:338: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/masami/codes/lxc/src'
Makefile:484: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

build env:
distribution: Arch Linux
gcc version 4.9.1 20140903 (prerelease) (GCC)

Signed-off-by: Masami Ichikawa <masami256@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolog: fix quiet mode
William Dauchy [Thu, 18 Sep 2014 15:18:55 +0000 (17:18 +0200)] 
log: fix quiet mode

quiet mode was overriden by the double call of lxc_log_init
see lxc_container_new

use lxc_log_options_no_override in order to fix this

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: William Dauchy <william@gandi.net>
10 years agosupport use of 'all' containers when cgmanager supports it
Serge Hallyn [Thu, 18 Sep 2014 21:20:02 +0000 (21:20 +0000)] 
support use of 'all' containers when cgmanager supports it

Introduce a new list of controllers just containing "all".

Make the lists of controllers null-terminated.

If the cgmanager api version is high enough, use the 'all' controller
rather than walking all controllers, which should greatly reduce the
amount of dbus overhead.  This will be especially important for
those going through a cgproxy.

Also remove the call to cleanup cgroups when a cgroup existed.  That
usually fails (and failure is ignored) since the to-be-cleaned-up
cgroup is busy, but we shouldn't even be trying.  Note this can
create for extra un-cleanedup cgroups, however it's better than us
accidentally removing a cgroup that someone else had created and was
about to use.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-gentoo: keep original uid/gid of files/dirs when installing
TAMUKI Shoichi [Thu, 11 Sep 2014 08:33:00 +0000 (17:33 +0900)] 
lxc-gentoo: keep original uid/gid of files/dirs when installing

Call tar with --numeric-owner option to use numbers for user/group
names because the whole uid/gid in rootfs should be consistently
unchanged as in original stage3 tarball and private portage.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-plamo: keep original uid/gid of files/dirs when installing
TAMUKI Shoichi [Thu, 4 Sep 2014 22:29:29 +0000 (07:29 +0900)] 
lxc-plamo: keep original uid/gid of files/dirs when installing

Regardless of whether "installpkg" command exists or not, install the
command temporarily with static linked tar command into the lxc cache
directory to keep the original uid/gid of files/directories.  Also,
use sed command instead of ed command for simplicity.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoReport container exit status to monitord
Jean-Tiare LE BIGOT [Thu, 28 Aug 2014 09:32:49 +0000 (11:32 +0200)] 
Report container exit status to monitord

When managing containers, I need to take action based on container
exit status. For instance, if it exited abnormally (status!=0), I
sometime want to respawn it automatically. Or, when invoking
`lxc-stop` I want to know if it terminated gracefully (ie on `SIGTERM`)
or on `SIGKILL` after a timeout.

This patch adds a new message type `lxc_msg_exit_code,` to preserve
ABI. It sends the raw status code as returned by `waitpid` so that
listening application may want to apply `WEXITSTATUS` before. This is
what `lxc-monitor` does.

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
10 years agolxc-cgm: fix issue with nested chowning
Serge Hallyn [Fri, 29 Aug 2014 14:20:44 +0000 (14:20 +0000)] 
lxc-cgm: fix issue with nested chowning

To ask cgmanager to chown files as an unpriv user, we must send the
request from the container's namespace (with our own userid also
mapped in).  However when we create a new namespace then we must
open a new dbus connection, so that our credential and the credential
on the dbus socket match.  Otherwise the proxy will refuse the request.

Because we were warning about this failure but not exiting, the failure
was not noticed until the unprivileged container went on to try to
administer its cgroups, i.e. creating a container inside itself.

Fix this by having the do_chown_cgroup create a new cgmanager connection.
In order to reduce the number of connections, since the list of subsystems
is global anyway, don't call do_chown_cgroup once for each controller,
just call it once and have it run over all controllers.

(This patch does not change the fact that we don't fail if the
chown failed.  I think we should change that, but let's do it in a
later patch)

Reported-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agohandle hashed command socket names (v2)
S.Çağlar Onur [Mon, 25 Aug 2014 23:54:51 +0000 (19:54 -0400)] 
handle hashed command socket names (v2)

With the new hashed command socket names (e85898415c), it's possible to
have something like below;

[caglar@qop:~/go/src/github.com/lxc/go-lxc(master)] cat /proc/net/unix | grep lxc
000000000000000000000002 00000000 00010000 0001 01 53465 @lxc/d086e835c86f4b8d/command
[...]

list_active_containers reads /proc/net/unix to find all running
containers but this new format no longer includes the container name or
its lxcpath.

This patch introduces two new commands (LXC_CMD_GET_NAME and
LXC_CMD_GET_LXCPATH) and starts to use those in list_active_containers
call.

changes since v1:
 - added sanity check proposed by Serge

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agobuild: Make setup.py run from srcdir to avoid distutils errors
Daniel Miranda [Mon, 25 Aug 2014 21:16:43 +0000 (18:16 -0300)] 
build: Make setup.py run from srcdir to avoid distutils errors

distutils can't handle paths to source files containing '..'. It will
try to navigate away from the build directory and fail. To fix that,
before building the python module, transform all the path variables then
cd to the srcdir, and set the build directory manually.

This is hopefully the last needed fix to use separate build and
source diretories.

Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agobuild: don't remove configuration template on clean
Daniel Miranda [Mon, 25 Aug 2014 21:16:42 +0000 (18:16 -0300)] 
build: don't remove configuration template on clean

Now that default.conf is generated/linked during the configuration
phase, it should not longer be removed in the 'clean' stage, or
subsequent builds will fail. Only remove it during 'dist-clean'.

Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agotests: Copy the download cache when available [v2]
Stéphane Graber [Mon, 25 Aug 2014 13:56:50 +0000 (09:56 -0400)] 
tests: Copy the download cache when available [v2]

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoPrevent compiler warning by initializing ifindex
Stéphane Graber [Mon, 25 Aug 2014 19:47:35 +0000 (15:47 -0400)] 
Prevent compiler warning by initializing ifindex

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoAdditional checks in ALTLinux template
Denis Pynkin [Tue, 19 Aug 2014 15:31:03 +0000 (18:31 +0300)] 
Additional checks in ALTLinux template

Added check of services in container before start or stop.
Added check of syslog config existence prior changing.

Signed-off-by: Denis Pynkin <dans@altlinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agostatvfs: do nothing if statvfs does not exist (android/bionic)
Serge Hallyn [Fri, 22 Aug 2014 21:23:56 +0000 (16:23 -0500)] 
statvfs: do nothing if statvfs does not exist (android/bionic)

If statvfs does not exist, then don't recalculate mount flags
at remount.

If someone does need this, they could replace the code (only
if !HAVE_STATVFS) with code parsing /proc/self/mountinfo (which
exists in the recent git history)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_mount_auto_mounts: honor existing nodev etc at remounts
Serge Hallyn [Wed, 20 Aug 2014 23:18:40 +0000 (23:18 +0000)] 
lxc_mount_auto_mounts: honor existing nodev etc at remounts

Same problem as we had with mount_entry().  lxc_mount_auto_mounts()
sometimes does bind mount followed by remount to change options.
With recent kernels it must pass any preexisting NODEV/NOSUID/etc
flags.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agomount_entry: use statvfs
Serge Hallyn [Wed, 20 Aug 2014 22:51:43 +0000 (22:51 +0000)] 
mount_entry: use statvfs

Use statvfs instead of parsing /proc/self/mountinfo to check for the
flags we need to and into the msbind mount flags.  This will be faster
and the code is cleaner.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agobuild: Fix support for split build and source dirs
Daniel Miranda [Thu, 21 Aug 2014 10:56:39 +0000 (07:56 -0300)] 
build: Fix support for split build and source dirs

Building LXC in a separate target directory, by running configure from
outside the source tree, failed with multiple errors, mostly in the
Python and Lua extensions, due to assuming the source dir and build dir
are the same in a few places. To fix that:

- Pre-process setup.py with the appropriate directories at configure
  time
- Introduce the build dir as an include path in the Lua Makefile
- Link the default container configuration file from the alternatives
  in the configure stage, instead of setting a variable and using it
  in the Makefile

Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochmod container dir to 0770 (v2)
Serge Hallyn [Thu, 21 Aug 2014 16:02:18 +0000 (16:02 +0000)] 
chmod container dir to 0770 (v2)

This prevents u2 from going into /home/u1/.local/share/lxc/u1/rootfs
and running setuid-root applications to get write access to u1's
container rootfs.

v2: set umask to 002 for the mkdir.  Otherwise if umask happens to be,
say, 022, then user does not have write permissions under the container
dir and creation of $containerdir/partial file will fail.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313
S.Çağlar Onur [Fri, 22 Aug 2014 16:36:31 +0000 (12:36 -0400)] 
ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoshow additional info if btrfs subvolume deletion fails (issue #315)
S.Çağlar Onur [Fri, 22 Aug 2014 16:10:12 +0000 (12:10 -0400)] 
show additional info if btrfs subvolume deletion fails (issue #315)

Unprivileged users require "-o user_subvol_rm_allowed" mount option for btrfs.
Make the INFO level message to ERROR to make it clear, which now says following;

[caglar@qop:~] lxc-destroy -n rubik
lxc_container: Is the rootfs mounted with -o user_subvol_rm_allowed?
lxc_container: Error destroying rootfs for rubik
Destroying rubik failed

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoUpdate plamo template
TAMUKI Shoichi [Tue, 19 Aug 2014 00:29:49 +0000 (09:29 +0900)] 
Update plamo template

- If "installpkg" command does not exist, lxc-plamo temporarily
  install the command with static linked tar command into the lxc
  cache directory.  The tar command does not refer to passwd/group
  files, which means that only a few files/directories are extracted
  with wrong user/group ownership.  To avoid this, the installpkg
  command now uses the standard tar command in the system.
- Change mode to 666 for $rootfs/dev/null to allow write access for
  all users.
- Small fix in usage message.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
10 years agomonitor: fix sockname calculation for long lxcpaths
Serge Hallyn [Sat, 9 Aug 2014 00:30:12 +0000 (00:30 +0000)] 
monitor: fix sockname calculation for long lxcpaths

A long enough lxcpath (and small PATH_MAX through crappy defines) can cause
the creation of the string to be hashed to fail.  So just use alloca to
get the size string we need.

More importantly, while I can't explain it, if lxcpath is too long, setting
sockname[sizeof(addr->sun_path)-2] to \0 simply doesn't seem to work.  So set
sockname[sizeof(addr->sun_path)-3] to \0, which does work.

With this, and with

lxc.lxcpath = /opt/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789

in /etc/lxc/lxc.conf, I can run lxc-wait just fine.  Without it, it fails
(as does lxc-start -d, which uses lxc_wait to verify the container started)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocommand socket: use hash if needed
Serge Hallyn [Sat, 9 Aug 2014 00:28:18 +0000 (00:28 +0000)] 
command socket: use hash if needed

The container command socket is an abstract unix socket containing
the lxcpath and container name.  Those can be too long.  In that case,
use the hash of the lxcpath and lxcname.  Continue to use the path and
name if possible to avoid any back compat issues.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Add destroy option to lxc-snapshot(1)
KATOH Yasufumi [Tue, 2 Sep 2014 12:18:45 +0000 (21:18 +0900)] 
doc: Add destroy option to lxc-snapshot(1)

This commit is the same as the commit 18aa217 and 99e616a on master
branch, except "ALL" keyword.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoDiscontinue the use of in-line comments (stable)
Stéphane Graber [Fri, 19 Sep 2014 20:33:32 +0000 (16:33 -0400)] 
Discontinue the use of in-line comments (stable)

Those aren't supported, it's just a lucky coincidence that they weren't
causing problems.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agotests: Call sync before testing a shutdown
Stéphane Graber [Mon, 18 Aug 2014 04:00:59 +0000 (00:00 -0400)] 
tests: Call sync before testing a shutdown

This should avoid tests failure when the machine running the tests has
either very slow disks or a lot of data waiting to be flushed.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodo_mount_entry: add nexec, nosuid, nodev, rdonly flags if needed at remount
Serge Hallyn [Mon, 18 Aug 2014 03:28:21 +0000 (03:28 +0000)] 
do_mount_entry: add nexec, nosuid, nodev, rdonly flags if needed at remount

See http://lkml.org/lkml/2014/8/13/746 and its history.  The kernel now refuses
mounts if we don't add ro,nosuid,nodev,noexec flags if they were already there.

Also use the newly found info to skip remount if unneeded.  For background, if
you want to create a read-only bind mount, then you must first mount(2) with
MS_BIND to create the bind mount, then re-mount(2) again to get the new mount
options to apply.  So if this wasn't a bind mount, or no new mount options were
introduced, then we don't do the second mount(2).

null_endofword() and get_field() were not changed, only moved up in
the file.

(Note, while I can start containers inside a privileged container with
this patch, most of the lxc tests still fail with the kernel in question;
Andy's patch seems to still be needed - a kernel with which is available
at https://launchpad.net/~serge-hallyn/+archive/ubuntu/userns-natty
ppa:serge-hallyn/userns-natty)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Fix Japanese translation of lxc.container.conf(5)
KATOH Yasufumi [Mon, 18 Aug 2014 11:57:01 +0000 (20:57 +0900)] 
doc: Fix Japanese translation of lxc.container.conf(5)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoRevert "chmod container dir to 0770"
Stéphane Graber [Sat, 16 Aug 2014 21:16:36 +0000 (17:16 -0400)] 
Revert "chmod container dir to 0770"

This commit broke the testsuite for unprivileged containers as the
container directory is now 0750 with the owner being the container root
and the group being the user's group, meaning that the parent user can
only enter the directory, not create entries in there.

This reverts commit c86da6a3ac517b78e6f710df7efe2f51d153b73c.

10 years agoFix typo in the previous commit...
Stéphane Graber [Sat, 16 Aug 2014 01:32:34 +0000 (21:32 -0400)] 
Fix typo in the previous commit...

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoAdd extra debugging
Micahel J. Evans [Fri, 11 Jul 2014 03:06:15 +0000 (20:06 -0700)] 
Add extra debugging

This is an hybrid between Micahel's original patch and me making the new
debugging statements look like our existing ones.

Signed-off-by: "Micahel J. Evans" <mjevans1983@gmail.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: language correction
Lars Wikberg [Fri, 15 Aug 2014 09:48:23 +0000 (12:48 +0300)] 
doc: language correction

Signed-off-by: Lars Wikberg <lars.wikberg@anvia.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochmod container dir to 0770
Serge Hallyn [Thu, 14 Aug 2014 18:29:55 +0000 (18:29 +0000)] 
chmod container dir to 0770

This prevents u2 from going into /home/u1/.local/share/lxc/u1/rootfs
and running setuid-root applications to get write access to u1's
container rootfs.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
10 years agocgmanager get/set: clean up child (v2)
Serge Hallyn [Fri, 15 Aug 2014 19:22:02 +0000 (19:22 +0000)] 
cgmanager get/set: clean up child (v2)

(Thanks, Dwight, this one look right?)

Make sure we reap our child at cgm_{s,g}et.

Changelog: Fix change in behavior on empty read from the do_cgm_get()
           helper that was spotted by Dwight.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
10 years agointroduce --with-distro=raspbian
S.Çağlar Onur [Sat, 9 Aug 2014 03:13:27 +0000 (23:13 -0400)] 
introduce --with-distro=raspbian

Raspberry Pi kernel finally supports all the bits required by LXC [1]

This patch makes "./configure --with-distro=raspbian" to install lxcbr0
based config file and upstart jobs.
Also src/lxc/lxc.net now checks the existence of the lxc-dnsmasq user
(and fallbacks to dnsmasq)

RPI users still need to pass
"MIRROR=http://archive.raspbian.org/raspbian/" parameter to lxc-create
to pick the correct packages

MIRROR=http://archive.raspbian.org/raspbian/ lxc-create -t debian -n rpi

[1] https://github.com/raspberrypi/linux/issues/176

stable-1.0: Cherry-picked from master minus the lxc-net change as
lxc-net isn't available in LXC 1.0.x. Instead it is assumed that the
distribution will take care of setting up the network (lxcbr0 in this
case).

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-test-unpriv: test lxc-clone -s
Serge Hallyn [Thu, 14 Aug 2014 21:36:01 +0000 (21:36 +0000)] 
lxc-test-unpriv: test lxc-clone -s

This would have caught a regression in Ubuntu's 3.16 kernel.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocoverity: malloc the right size for btrs_node tree
Serge Hallyn [Mon, 11 Aug 2014 14:10:59 +0000 (14:10 +0000)] 
coverity: malloc the right size for btrs_node tree

We were allocating sizeof(tree) instead of sizeof(*tree).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocoverity: don't use newname after null check
Serge Hallyn [Mon, 11 Aug 2014 14:10:04 +0000 (14:10 +0000)] 
coverity: don't use newname after null check

Actually, get rid of the temporary variables, and set newname
and lxcpath to usable values if they were NULL.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: add lxc.console.logpath to Japanese lxc.container.conf(5)
KATOH Yasufumi [Mon, 11 Aug 2014 10:49:26 +0000 (19:49 +0900)] 
doc: add lxc.console.logpath to Japanese lxc.container.conf(5)

Update for commit 96f15ca

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoadd lxc.console.logpath
Serge Hallyn [Fri, 8 Aug 2014 18:34:38 +0000 (18:34 +0000)] 
add lxc.console.logpath

logpath has been supported through lxc-start command line, but not
through the API.  Since the lxc.console is now required to be a device,
support lxc.console.logfile to be a simple file to which console output
will be logged.

clear_config_item is not supported, as it isn't for lxc.console, bc
you can do 'lxc.console.logfile =' to clear it.

(This patch is for stable-1.0)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoDo not allow snapshots of LVM backed containers
Serge Hallyn [Fri, 8 Aug 2014 18:31:45 +0000 (18:31 +0000)] 
Do not allow snapshots of LVM backed containers

They don't work right now, so until we fix that, don't allow it.

(This patch is for stable-1.0)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoEnsure /dev/pts directory exists on pts setup
Jean-Tiare LE BIGOT [Sat, 2 Aug 2014 13:27:13 +0000 (15:27 +0200)] 
Ensure /dev/pts directory exists on pts setup

When `lxc.autodev = 0` and empty tmpfs is mounted on /dev
and private pts are requested, we need to ensure '/dev/pts'
exists before attempting to mount devpts on it.

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoFix a file descriptor leak in the monitord spawn
Vincent Giersch [Wed, 11 Jun 2014 14:23:27 +0000 (16:23 +0200)] 
Fix a file descriptor leak in the monitord spawn

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoFix a file descriptor leak in the daemonization
Vincent Giersch [Fri, 23 May 2014 09:04:26 +0000 (11:04 +0200)] 
Fix a file descriptor leak in the daemonization

Especially when using the Python API, the child process inherits of
the file descriptiors of the script.

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agofix '--log-priority' --> '--logpriority' in main
Jean-Tiare LE BIGOT [Mon, 4 Aug 2014 15:33:44 +0000 (17:33 +0200)] 
fix '--log-priority' --> '--logpriority' in main

Signed-off-by: Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoUse portageq to determine portage distdir
rabisg [Thu, 31 Jul 2014 13:10:25 +0000 (18:40 +0530)] 
Use portageq to determine portage distdir

Signed-off-by: Rabi Shanker Guha <guha.rabishankar@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoInclude hostname in DHCP requests
Kalman Olah [Tue, 22 Jul 2014 08:38:42 +0000 (10:38 +0200)] 
Include hostname in DHCP requests

With the current old CentOS template, dnsmasq was not able to resolve
the hostname of an lxc container after it had been created. This minor
change rectifies that.

Signed-off-by: Kalman Olah <hello@kalmanolah.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agossh: send hostname to dhcp server
Nikolay Martynov [Tue, 22 Jul 2014 00:12:01 +0000 (20:12 -0400)] 
ssh: send hostname to dhcp server

Send container's hostname to dhcp server when getting ip address.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agotemplates: switch from arch command to uname -m
Michael Werner [Mon, 21 Jul 2014 18:57:17 +0000 (20:57 +0200)] 
templates: switch from arch command to uname -m

Signed-off-by: Michael Werner <xaseron@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoubuntu templates: don't check for $rootfs/run/shm
Serge Hallyn [Thu, 7 Aug 2014 03:23:48 +0000 (03:23 +0000)] 
ubuntu templates: don't check for $rootfs/run/shm

/dev/shm must be turned from a directory into a symlink to /run/shm.
The templates do this only if they find -d $rootfs/run/shm.  Since /run
will be a tmpfs, checking for it in the rootfs is silly.  It also is
currently broken as ubuntu cloud images have an empty /run.

(this should fix https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1353734)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agobtrfs: support recursive subvolume deletion (v2)
Serge Hallyn [Fri, 1 Aug 2014 22:55:21 +0000 (22:55 +0000)] 
btrfs: support recursive subvolume deletion (v2)

Pull the #defines and struct definitions for btrfs into a separate
.h file to not clutter bdev.c

Implement btrfs recursive delete support

A non-root user isn't allow to do the ioctls needed for searching (as you can
verify with 'btrfs subvolume list').  So for an unprivileged user, if the
rootfs has subvolumes under it, deletion will fail.  Otherwise, it will
succeed.

Changelog: Aug 1:
  . Fix wrong objid passing when determining directory paths
  . In do_remove_btrfs_children, avoid dereferencing NULL dirid
  . Fix memleak in error case.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agodoc: Add 'zfs' to the parameter of -B option in lxc-create(1)
KATOH Yasufumi [Fri, 1 Aug 2014 10:37:57 +0000 (19:37 +0900)] 
doc: Add 'zfs' to the parameter of -B option in lxc-create(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agodoc: Update the description of SELinux in Japanese lxc.container.conf(5)
KATOH Yasufumi [Fri, 1 Aug 2014 10:37:56 +0000 (19:37 +0900)] 
doc: Update the description of SELinux in Japanese lxc.container.conf(5)

Update for commit 719fae0

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agodoc: Add -F option to Japanese lxc-start(1)
KATOH Yasufumi [Fri, 1 Aug 2014 10:37:53 +0000 (19:37 +0900)] 
doc: Add -F option to Japanese lxc-start(1)

Update for commit 476d302

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agouse non-thread-safe getpwuid and getpwgid for android
Serge Hallyn [Thu, 31 Jul 2014 19:54:27 +0000 (19:54 +0000)] 
use non-thread-safe getpwuid and getpwgid for android

We only call it (so far) after doing a fork(), so this is fine.  If we
ever need such a thing from threaded context, we'll simply need to write
our own version for android.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoprint a helpful message if creating unpriv container with no idmap
Serge Hallyn [Tue, 29 Jul 2014 18:26:29 +0000 (18:26 +0000)] 
print a helpful message if creating unpriv container with no idmap

This gives me:

ubuntu@c-t1:~$ lxc-create -t download -n u1
lxc_container: No mapping for container root
lxc_container: Error chowning /home/ubuntu/.local/share/lxc/u1/rootfs to container root
lxc_container: You must either run as root, or define uid mappings
lxc_container: To pass uid mappings to lxc-create, you could create
lxc_container: ~/.config/lxc/default.conf:
lxc_container: lxc.include = /etc/lxc/default.conf
lxc_container: lxc.id_map = u 0 100000 65536
lxc_container: lxc.id_map = g 0 100000 65536
lxc_container: Error creating backing store type (none) for u1
lxc_container: Error creating container u1

when I create a container without having an id mapping defined.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoprovide an example SELinux policy for older releases
Dwight Engen [Thu, 24 Jul 2014 21:25:46 +0000 (17:25 -0400)] 
provide an example SELinux policy for older releases

The virtd_lxc_t type provided by the default RHEL/CentOS/Oracle 6.5
policy is an unconfined_domain(), so it doesn't really enforce anything.
This change will provide a link in the documentation to an example
policy that does confine containers.

On more recent distributions with new enough policy, it is recommended
not to use this sample policy, but to use the types already available
on the system from /etc/selinux/targeted/contexts/lxc_contexts, ie:

process = "system_u:system_r:svirt_lxc_net_t:s0"
file = "system_u:object_r:svirt_sandbox_file_t:s0"

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agodownload: Have wget retry 3 times
Stéphane Graber [Mon, 21 Jul 2014 10:25:20 +0000 (12:25 +0200)] 
download: Have wget retry 3 times

This forces wget to retry if it gets a network error.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-start: Add -F (foreground) option
Stéphane Graber [Mon, 21 Jul 2014 09:50:49 +0000 (11:50 +0200)] 
lxc-start: Add -F (foreground) option

Introduce a new -F option (no-op for now) as an opposite of -d.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoapparmor: Allow slave bind mounts
Martin Pitt [Wed, 30 Jul 2014 14:43:10 +0000 (16:43 +0200)] 
apparmor: Allow slave bind mounts

Without this, if the system uses shared subtrees by default (like systemd), you
get a large stream of

  lxc-start: Permission denied - Failed to make /<mountpoint> rslave
  lxc-start: Continuing...

with

  apparmor="DENIED" operation="mount" info="failed flags match" error=-13
  profile="/usr/bin/lxc-start" name="/" pid=17284 comm="lxc-start" flags="rw, slave"

and eventual failure plus a lot of leftover mounts in the host.

https://launchpad.net/bugs/1325468

11 years agoadd help string for ubuntu templete
Trần Ngọc Quân [Mon, 28 Jul 2014 08:34:54 +0000 (15:34 +0700)] 
add help string for ubuntu templete

Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix typo in btrfs error msg
Serge Hallyn [Sun, 27 Jul 2014 15:53:54 +0000 (10:53 -0500)] 
fix typo in btrfs error msg

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agounprivileged containers: use next available nic name if unspecified
Serge Hallyn [Mon, 21 Jul 2014 21:36:44 +0000 (16:36 -0500)] 
unprivileged containers: use next available nic name if unspecified

Rather than always using eth0.  Otherwise unpriv containers cannot have
multiple lxc.network.type = veth's without manually setting
lxc.network.name =.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoSysvinit script fixes
Ansa89 [Thu, 17 Jul 2014 08:53:30 +0000 (10:53 +0200)] 
Sysvinit script fixes

Signed-off-by: Stefano Ansaloni <ansalonistefano@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoAdd SIGPWR support to lxc_init
Nikolay Martynov [Sun, 20 Jul 2014 19:35:04 +0000 (15:35 -0400)] 
Add SIGPWR support to lxc_init

This patch adds SIGPWR support to lxc_init.
This helps to properly shutdown lxc_init based containers.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoremove mountcgroup hook entirely
Serge Hallyn [Thu, 17 Jul 2014 22:20:34 +0000 (17:20 -0500)] 
remove mountcgroup hook entirely

Also fix the comment in lxc-cirros template (which I overlooked last time).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoRemove mention of mountcgroups in ubuntu.common config
Serge Hallyn [Thu, 17 Jul 2014 14:05:35 +0000 (09:05 -0500)] 
Remove mention of mountcgroups in ubuntu.common config

That mount hook predates the lxc.mount.auto = cgroup option.  So mention
that instead.

Perhaps we should simply drop the mountcgroup hook from the tree, but
I'm not doing that in this patch.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-test-{unpriv,usernic.in}: make sure to chgrp as well
Serge Hallyn [Thu, 17 Jul 2014 21:02:06 +0000 (16:02 -0500)] 
lxc-test-{unpriv,usernic.in}: make sure to chgrp as well

These tests are failing on new kernels because the container root is
not privileged over the directories, since privilege no requires
the group being mapped into the container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agodoc: Add mention that veth.pair is ignored for unpriv in Japanese man
KATOH Yasufumi [Wed, 16 Jul 2014 16:32:38 +0000 (01:32 +0900)] 
doc: Add mention that veth.pair is ignored for unpriv in Japanese man

Update Japanese lxc.container.conf(5) for commit 8982c0f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agodoc: Mention that veth.pair is ignored for unpriv
Stéphane Graber [Wed, 16 Jul 2014 01:32:46 +0000 (21:32 -0400)] 
doc: Mention that veth.pair is ignored for unpriv

veth.pair is ignore for unprivileged containers as allowing an
unprivileged user to set a specific device name would allow them to
trigger actions in tools like NetworkManager or other uevent based
handlers that may react based on specific names or prefixes being used.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agocentos template: prevent mingetty from calling vhangup(2)
Claudio Alarcon-Reyes [Fri, 11 Jul 2014 15:32:32 +0000 (11:32 -0400)] 
centos template: prevent mingetty from calling vhangup(2)

When using unprivileged containers, tty fails because of vhangup. Adding
--nohangup to nimgetty, it fixes the issue. This is the same problem
occurred for oracle template, commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589

Signed-off-by: Claudio Alarcon clalarco@gmail.com
11 years agoFix typo in previous patch
Stéphane Graber [Mon, 14 Jul 2014 19:44:41 +0000 (15:44 -0400)] 
Fix typo in previous patch

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoconfile: sanity-check netdev->type before setting netdev->priv elements
Serge Hallyn [Mon, 14 Jul 2014 18:51:41 +0000 (18:51 +0000)] 
confile: sanity-check netdev->type before setting netdev->priv elements

The netdev->priv is shared for the netdev types.  A bad config file
could mix configuration for different types, resulting in a bad
netdev->priv when starting or even destroying a container.  So sanity
check the netdev->type before setting a netdev->priv element.

This should fix https://github.com/lxc/lxc/issues/254

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agorootfs_is_blockdev: don't run if no rootfs is specified
Serge Hallyn [Mon, 14 Jul 2014 18:22:53 +0000 (13:22 -0500)] 
rootfs_is_blockdev: don't run if no rootfs is specified

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agochange version to 1.0.5 in configure.ac lxc-1.0.5
Stéphane Graber [Mon, 14 Jul 2014 15:14:13 +0000 (11:14 -0400)] 
change version to 1.0.5 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agotests: lxc-test-ubuntu doesn't actually need bind9-host
Stéphane Graber [Wed, 9 Jul 2014 17:30:54 +0000 (13:30 -0400)] 
tests: lxc-test-ubuntu doesn't actually need bind9-host

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agotests: Clarify error message and fix return codes
Stéphane Graber [Wed, 9 Jul 2014 17:17:54 +0000 (13:17 -0400)] 
tests: Clarify error message and fix return codes

Reported-by: Michael J. Evans
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-debian: standardize formatting
Alexander Dreweke [Tue, 8 Jul 2014 05:16:54 +0000 (07:16 +0200)] 
lxc-debian: standardize formatting

Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc-debian: fix formatting
Alexander Dreweke [Tue, 8 Jul 2014 05:15:31 +0000 (07:15 +0200)] 
lxc-debian: fix formatting

added space ">/" -> ">  /"

Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoAlso add --verison support to lxc-start-ephemeral
Stéphane Graber [Mon, 7 Jul 2014 16:48:07 +0000 (12:48 -0400)] 
Also add --verison support to lxc-start-ephemeral

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoAdd support for --version to lxc-ls and lxc-device
Stéphane Graber [Mon, 7 Jul 2014 14:17:28 +0000 (10:17 -0400)] 
Add support for --version to lxc-ls and lxc-device

This is based on the patch submitted by:
 Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>

Updated to use lxc.version rather than @LXC_VERSION@ and to apply to
both lxc-ls and lxc-device rather than just the former.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoFix attach_wait and threads
Dorian Eikenberg [Sun, 6 Jul 2014 17:44:19 +0000 (19:44 +0200)] 
Fix attach_wait and threads

Signed-off-by: Dorian Eikenberg <dorian.eikenberg@uni-duesseldorf.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoFix incorrect timeout handling of do_reboot_and_check()
Yuto KAWAMURA(kawamuray) [Fri, 4 Jul 2014 17:35:09 +0000 (02:35 +0900)] 
Fix incorrect timeout handling of do_reboot_and_check()

Currently do_reboot_and_check() is decreasing timeout variable even if
it is set to -1, so running 'lxc-stop --reboot --timeout=-1 ...' will
exits immediately at end of second iteration of loop, without waiting
container reboot.
Also, there is no need to call gettimeofday if timeout is set to -1, so
these statements should be evaluated only when timeout is enabled.

Signed-off-by: Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoChange find_fstype_cb to ignore blank lines and comments
Yuto KAWAMURA(kawamuray) [Fri, 4 Jul 2014 17:40:02 +0000 (02:40 +0900)] 
Change find_fstype_cb to ignore blank lines and comments

/etc/filesystems could be contain blank lines and comments.
Change find_fstype_cb() to ignore blank lines and comments which starts
with '#'.

Signed-off-by: Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoFix invalid seccomp profile name for Ubuntu.
Stéphane Graber [Fri, 4 Jul 2014 15:38:15 +0000 (11:38 -0400)] 
Fix invalid seccomp profile name for Ubuntu.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agomake the container exit code propagate to lxc-start exit code when appropriate
Rodrigo Vaz [Thu, 3 Jul 2014 18:39:51 +0000 (15:39 -0300)] 
make the container exit code propagate to lxc-start exit code when appropriate

Signed-off-by: Rodrigo Sampaio Vaz <rodrigo@heroku.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>