]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
10 years agoAdd '--enable-api-docs' for doxygen-generated public API docs.
James Hunt [Mon, 25 Nov 2013 13:42:09 +0000 (13:42 +0000)]
Add '--enable-api-docs' for doxygen-generated public API docs.

Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ubuntu: Factorize @LOCALSTATEDIR@ variable
Guilhem Lettron [Thu, 14 Nov 2013 09:55:28 +0000 (10:55 +0100)]
lxc-ubuntu: Factorize @LOCALSTATEDIR@ variable

Signed-off-by: Guilhem Lettron <guilhem.lettron@optiflows.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ubuntu: Add mirror and security-mirror options
Guilhem Lettron [Wed, 13 Nov 2013 13:22:10 +0000 (14:22 +0100)]
lxc-ubuntu: Add mirror and security-mirror options

Signed-off-by: Guilhem Lettron <guilhem.lettron@optiflows.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ubuntu: Move package install to post-process
Guilhem Lettron [Wed, 13 Nov 2013 11:42:14 +0000 (12:42 +0100)]
lxc-ubuntu: Move package install to post-process

Signed-off-by: Guilhem Lettron <guilhem.lettron@optiflows.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ubuntu: Add extra options
Guilhem Lettron [Thu, 31 Oct 2013 15:54:55 +0000 (16:54 +0100)]
lxc-ubuntu: Add extra options

This adds support for "packages", "user" and "password"

Signed-off-by: Guilhem Lettron <guilhem.lettron@optiflows.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agouse awk, instead of 'grep | awk'
Elan Ruusamäe [Mon, 18 Nov 2013 23:23:33 +0000 (01:23 +0200)]
use awk, instead of 'grep | awk'

Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Update Japanese lxc-attach(1)
KATOH Yasufumi [Thu, 21 Nov 2013 08:54:24 +0000 (17:54 +0900)]
doc: Update Japanese lxc-attach(1)

Update for commit 4d69b2939ce09fbe624636dc01734a542e050ef9

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodon't fail lxc-init if we couldn't mount proc
Serge Hallyn [Fri, 22 Nov 2013 21:43:51 +0000 (15:43 -0600)]
don't fail lxc-init if we couldn't mount proc

In general proc gets mounted ahead of time, so init shouldn't
have to do it.  Without this patch, you cannot

lxc-execute -n x1 -s lxc.cap.drop=sys_admin /bin/bash

(See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1253669 for
a bug about this)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxcapi_destroy: run in a namespace if we are unprivileged
Serge Hallyn [Fri, 22 Nov 2013 20:39:37 +0000 (14:39 -0600)]
lxcapi_destroy: run in a namespace if we are unprivileged

This is necessary to have the rights to remove files owned by our subuids.

Also update lxc_rmdir_onedev to return 0 on success, -1 on failure.
Callers were not consistent in using it correctly, and this is more
in keeping with the rest of our code.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoAdd lxc.service to extra_DIST
Stéphane Graber [Fri, 22 Nov 2013 19:35:33 +0000 (14:35 -0500)]
Add lxc.service to extra_DIST

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoadd lxc-usernsexec to .gitignore
S.Çağlar Onur [Fri, 22 Nov 2013 18:55:16 +0000 (13:55 -0500)]
add lxc-usernsexec to .gitignore

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoremove HAVE_NEWUIDMAP and NEWUIDMAP
Serge Hallyn [Fri, 22 Nov 2013 04:11:43 +0000 (22:11 -0600)]
remove HAVE_NEWUIDMAP and NEWUIDMAP

Always build lxc-usernsexec.  Else we require having uidmap
installed on the build host for no good reason.  And we never
actually used the NEWUIDMAP path we detected.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_usernsexec: fix build breakage
Serge Hallyn [Fri, 22 Nov 2013 03:55:06 +0000 (21:55 -0600)]
lxc_usernsexec: fix build breakage

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoSupport files for systemd on Fedora.
Michael H. Warfield [Tue, 12 Nov 2013 01:10:29 +0000 (20:10 -0500)]
Support files for systemd on Fedora.

Added a file "lxc.service" for a systemd service file.

Added a file "lxc-devsetup" to setup /dev/ on startup to support autodev
in containers.

Service file references lxc-devsetup as an ExecStartPre command.  The
lxc-devsetup script is not dependent on systemd or Fedora and can
be used at bootup on any system.

Modified lxc.spec.in to install the two new files on Fedora.  The systemd
specific code in the lxc.spec file may need some review and conditionalize
for systemd on non-systemd rpm-based systems.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxcapi_clone: set the right environment variable for mounted fs
Serge Hallyn [Thu, 21 Nov 2013 15:05:59 +0000 (09:05 -0600)]
lxcapi_clone: set the right environment variable for mounted fs

If the container is dir-backed, we don't actually mount it (to
support unprivileged use).  So always set the LXC_ROOTFS_MOUNT
to bdev->dest, not to the rootfs path specified in the container
configuration.

This should fix bug http://pad.lv/1253573

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoSetup devtmpfs and /dev for autodev bind mounts.
Michael H. Warfield [Tue, 12 Nov 2013 01:08:36 +0000 (20:08 -0500)]
Setup devtmpfs and /dev for autodev bind mounts.

If autodev is not specifically set to 0 or 1, attempts to determine if
systemd is being utilized and forces autodev=1 to prevent host system
conflicts and collisions.

If autodev is enabled and the host /dev is mounted with devtmpfs
or /dev/.lxc is mounted with another file system...

Each container created by a privileged user gets a /dev directory
mapped off the host /dev here:

/dev/.lxc/${name}.$( hash $lxcpath/$name )

Each container created by a non-privileged user gets a /dev/directory
mapped off the host /dev here:

/dev/.lxc/user/${name}.$( hash $lxcpath/$name )

The /dev/.lxc/user is mode 1777 to allow unpriv access.

The /dev/.lxc/{containerdev} is bind mounted into the container /dev.

Fallback on failure is to mount tmpfs into the container /dev.

A symlink is created from $lxcpath/$name/rootfs.dev back to the /dev
relative directory to provid a code consistent reference for updating
container devs.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-attach: elevate specific privileges
Nikola Kotur [Wed, 20 Nov 2013 15:07:37 +0000 (16:07 +0100)]
lxc-attach: elevate specific privileges

There are scenarios in which we want to execute process with specific
privileges elevated.

An example for this might be executing a process inside the container
securely, with capabilities dropped, but not in container's cgroup so
that we can have per process restrictions inside single container.

Similar to namespaces, privileges to be elevated can be OR'd:

    lxc-attach --elevated-privileges='CAP|CGROUP' ...

Backward compatibility with previous versions is retained. In case no
privileges are specified behaviour is the same as before: all of them
are elevated.

Signed-off-by: Nikola Kotur <kotnick@gmail.com>
Acked-By: Christian Seiler <christian@iwakd.de>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-usernsexec: fix the default map behavior
Serge Hallyn [Wed, 20 Nov 2013 16:07:40 +0000 (10:07 -0600)]
lxc-usernsexec: fix the default map behavior

We were finding it, but not saving it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agofix memory leaks reported by cppcheck in src/lxc/lxc_usernsexec.c
S.Çağlar Onur [Tue, 19 Nov 2013 23:53:37 +0000 (18:53 -0500)]
fix memory leaks reported by cppcheck in src/lxc/lxc_usernsexec.c

Free previously allocated memory if realloc fails.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc_user_nic: fix fd leak reported by coverity
Serge Hallyn [Tue, 19 Nov 2013 23:10:32 +0000 (17:10 -0600)]
lxc_user_nic: fix fd leak reported by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-user-nic: improve cull_entries
Serge Hallyn [Tue, 19 Nov 2013 16:17:52 +0000 (16:17 +0000)]
lxc-user-nic: improve cull_entries

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: initialize cnic to NULL to please compiler
Serge Hallyn [Tue, 19 Nov 2013 16:17:51 +0000 (16:17 +0000)]
lxc_user_nic: initialize cnic to NULL to please compiler

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: make all fns static for consistency
Serge Hallyn [Tue, 19 Nov 2013 16:17:50 +0000 (16:17 +0000)]
lxc_user_nic: make all fns static for consistency

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: fix get_allotted description.
Serge Hallyn [Tue, 19 Nov 2013 16:17:49 +0000 (16:17 +0000)]
lxc_user_nic: fix get_allotted description.

get_allotted doesn't get the list of nic names, only the # of nics
allowed to the user.  We check the db_file later for existing
number of nics.

Also close the conf file on success, and print filename and errno
if we failed to open conf file.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: report failing filename in open_and_lock error cases
Serge Hallyn [Tue, 19 Nov 2013 16:17:48 +0000 (16:17 +0000)]
lxc_user_nic: report failing filename in open_and_lock error cases

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: only exit from main and usage
Serge Hallyn [Tue, 19 Nov 2013 16:17:47 +0000 (16:17 +0000)]
lxc_user_nic: only exit from main and usage

Everywhere else return an error code instead.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: report strerror(errno)
Serge Hallyn [Tue, 19 Nov 2013 16:17:46 +0000 (16:17 +0000)]
lxc_user_nic: report strerror(errno)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: don't pass unused arg to get_username()
Serge Hallyn [Tue, 19 Nov 2013 16:17:45 +0000 (16:17 +0000)]
lxc_user_nic: don't pass unused arg to get_username()

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: add a check to make sure caller owns target netns
Serge Hallyn [Tue, 19 Nov 2013 16:17:44 +0000 (16:17 +0000)]
lxc_user_nic: add a check to make sure caller owns target netns

Temporarily set our euid back to the calling ruid, so that the
access(2) check can succeed based on the euid being the userns
creator.

Also switch from atoi to strtol

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofix memory leaks reported by cppcheck in src/lxc/conf.c (v2)
S.Çağlar Onur [Mon, 18 Nov 2013 19:28:52 +0000 (14:28 -0500)]
fix memory leaks reported by cppcheck in src/lxc/conf.c (v2)

This also fixes possible crashes due to passing NULL to strlen function

Changes since v1;
* Fixed a typo spotted by Serge

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle template: fix pam login failures under user namespace
Dwight Engen [Mon, 18 Nov 2013 17:28:31 +0000 (12:28 -0500)]
oracle template: fix pam login failures under user namespace

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle template: don't clear console tty
Dwight Engen [Mon, 18 Nov 2013 17:28:23 +0000 (12:28 -0500)]
oracle template: don't clear console tty

This allows the boot messages to be seen which are useful for monitoring
container startup.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle template: prevent mingetty from calling vhangup(2)
Dwight Engen [Mon, 18 Nov 2013 17:28:14 +0000 (12:28 -0500)]
oracle template: prevent mingetty from calling vhangup(2)

This is needed when using the user namespace since the kernel check does
not allow user_ns root to successfully call vhangup(2), and mingetty will
quit in this case.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle template: further disable selinux in ol5 container
Dwight Engen [Mon, 18 Nov 2013 17:28:00 +0000 (12:28 -0500)]
oracle template: further disable selinux in ol5 container

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agop is a pointer and cannot be negative so check if it is NULL
S.Çağlar Onur [Fri, 15 Nov 2013 05:33:54 +0000 (00:33 -0500)]
p is a pointer and cannot be negative so check if it is NULL

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agofree previously allocated memory if realloc fails in src/lxc/lsm/apparmor.c
S.Çağlar Onur [Fri, 15 Nov 2013 05:02:28 +0000 (00:02 -0500)]
free previously allocated memory if realloc fails in src/lxc/lsm/apparmor.c

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoImprove Japanese man pages
KATOH Yasufumi [Sat, 16 Nov 2013 16:22:03 +0000 (01:22 +0900)]
Improve Japanese man pages

Improve the consistency of expression

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-lua: LFS library is not being used
Nikola Kotur [Mon, 18 Nov 2013 10:42:01 +0000 (11:42 +0100)]
lxc-lua: LFS library is not being used

Signed-off-by: Nikola Kotur <kotnick@gmail.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
10 years agofix memory leaks reported by cppcheck in src/lxc/lxc_monitor.c. Since this is a cli...
S.Çağlar Onur [Fri, 15 Nov 2013 04:56:04 +0000 (23:56 -0500)]
fix memory leaks reported by cppcheck in src/lxc/lxc_monitor.c. Since this is a cli tool it doesn't really matter but might silence some warnings for debugging

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoadd missing paranthesis (v2)
S.Çağlar Onur [Fri, 15 Nov 2013 04:22:54 +0000 (23:22 -0500)]
add missing paranthesis (v2)

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agofix memory leaks reported by cppcheck in src/lxc/bdev.c
S.Çağlar Onur [Fri, 15 Nov 2013 04:03:58 +0000 (23:03 -0500)]
fix memory leaks reported by cppcheck in src/lxc/bdev.c

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agochange version to 1.0.0.alpha3 in configure.ac
Stéphane Graber [Fri, 15 Nov 2013 21:08:01 +0000 (16:08 -0500)]
change version to 1.0.0.alpha3 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-info: Rework based on mailinglist thread
Stéphane Graber [Fri, 15 Nov 2013 20:14:00 +0000 (15:14 -0500)]
lxc-info: Rework based on mailinglist thread

So this implements the changes we discussed yesterday:
 - Only one container may be queried at the time
 - -n is now required once again
 - -H + a single filter only returns the value
 - -t/--is-state is now removed

Note that -S is considered as more than a single filter, so -H in that
case only affects the formatting of the values.

For the same reason, I haven't yet implemented the -H + multiple filters
case which we said should return a simple "key: value" output as it
wasn't trivial to re-arrange the stats code to print a different format
(for the other options, it's just a two lines change in the print
functions).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
10 years agolxc-start: if we pass in a config file, then don't use any loaded config
Serge Hallyn [Thu, 14 Nov 2013 18:48:41 +0000 (12:48 -0600)]
lxc-start: if we pass in a config file, then don't use any loaded config

To do this, add a c->clear_config() helper to the api.

(this fixes the bug https://bugs.launchpad.net/bugs/1251352)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agogather all locking related code into src/lxc/lxclock.c
S.Çağlar Onur [Wed, 13 Nov 2013 21:46:11 +0000 (16:46 -0500)]
gather all locking related code into src/lxc/lxclock.c

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agosetup_netdev: re-read ifindex in LXC_NET_PHYS case
Bogdan Purcareata [Thu, 14 Nov 2013 10:58:06 +0000 (12:58 +0200)]
setup_netdev: re-read ifindex in LXC_NET_PHYS case

When moving an interface from the host netns to a container's,
the ifindex might not remain the same. This happens when the
index of the host interface is already assigned to another interface
in the new netns.

For veth/vlan/macvlan, virtual interfaces are first created on the host,
and then moved in the container. Since they are created after all other
interfaces are discovered, there is no chance for its assigned ifindex
to be already present in a freshly created netns, because it's a greater
number.

However, when moving a physical interface, there is a chance that its
ifindex in the host netns is not free in the new netns. The patch
forces ifindex re-read for the LXC_NET_PHYS case to update the
lxc_netdev structure.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agointroduce lxcapi_add_device_node and lxcapi_remove_device_node to API (v3)
S.Çağlar Onur [Wed, 13 Nov 2013 05:39:00 +0000 (00:39 -0500)]
introduce lxcapi_add_device_node and lxcapi_remove_device_node to API (v3)

Adding block/char devices to running container is a common operation so
provide a common implementation for users to consume.

changes since v2;
* lets the user set an alternate path inside the container as Stéphane suggested

changes since v1;
* removed duplicated code

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Update Japanese lxc-info(1) for printing statistics
KATOH Yasufumi [Thu, 7 Nov 2013 07:59:16 +0000 (16:59 +0900)]
doc: Update Japanese lxc-info(1) for printing statistics

Update for commit b9d957c316c3827898b91cc69788d90be3260935

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Update Japanese lxc-top(1) for kernel memory accounting.
KATOH Yasufumi [Tue, 5 Nov 2013 06:33:39 +0000 (15:33 +0900)]
doc: Update Japanese lxc-top(1) for kernel memory accounting.

Update for commit 2752ecec3232c231469a2ad8513a5527fef66fd6

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoUpdate lxc_create.c corrected argument usage example for -t
pc-wurm [Fri, 8 Nov 2013 11:45:51 +0000 (12:45 +0100)]
Update lxc_create.c corrected argument usage example for -t

I think '-t timeout' was mistakenly written, so I corrected it to '-t
template', since the -t argument is used for setting templates, not
timeout as far as I know.

Signed-off-by: pc-wurm <yordanov@pc-wurm.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ubuntu*: Mark non-essential mounts optional
Stéphane Graber [Tue, 12 Nov 2013 18:45:23 +0000 (13:45 -0500)]
lxc-ubuntu*: Mark non-essential mounts optional

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoadd process_lock()/unlock() in save_config()
Dwight Engen [Tue, 12 Nov 2013 19:04:39 +0000 (14:04 -0500)]
add process_lock()/unlock() in save_config()

This is likely unnecessary, but is consistent with other uses of
fopen()/fclose() in lxc.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agofix multithreaded create()
Dwight Engen [Tue, 12 Nov 2013 19:04:45 +0000 (14:04 -0500)]
fix multithreaded create()

We were calling save_config() twice within the create() flow, each
from a different process. Depending on order of scheduling, sometimes
the data from the first save_config() (which was just the stuff from
LXC_DEFAULT_CONFIG) would overwrite the config we wanted (the full
config), causing a truncated config file which would then cause lxc
to segfault once it read it back in because no rootfs.path was set.

This fixes it by only calling save_config() once in the create()
flow. A rejected alternative was to call fsync(fileno(fout)) before
the fclose in save_config.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc_abstract_unix_connect: accomodate containers started before Oct 28
Serge Hallyn [Mon, 11 Nov 2013 18:32:14 +0000 (12:32 -0600)]
lxc_abstract_unix_connect: accomodate containers started before Oct 28

commit aae93dd3dd20dd12c6b8f9f0490e2fb877ee3f09 fixed the command socket
name to use the right pathlen instead of always passing in the max
socket namelen.  However, this breaks lxc-info/lxc-list/etc for
containers started before that commit.  So if the correct command
sock name doesn't work, try the preexising one.

Note we can probably undo this "after awhile".  Maybe in august 2014.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoadd modes argument to lxc-test-concurrent
Dwight Engen [Fri, 8 Nov 2013 19:00:40 +0000 (14:00 -0500)]
add modes argument to lxc-test-concurrent

- This allows testing independently the modes with/without threading

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agowait_on_damonized-start: wait only on the pid we want
Serge Hallyn [Fri, 8 Nov 2013 17:41:16 +0000 (17:41 +0000)]
wait_on_damonized-start: wait only on the pid we want

Otherwise we can reap another thread's forked pid.

Changelog: Per Dwight's suggestion, use pid_t for argument.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: S.Çağlar Onur <caglar@10ur.org>
10 years agoapi_start: refuse to run undaemonized if multithreaded
Serge Hallyn [Fri, 8 Nov 2013 04:20:33 +0000 (22:20 -0600)]
api_start: refuse to run undaemonized if multithreaded

lxc-start is not safe (and doesn't actually make sense) if the
task is nto single-threaded.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc_user_nic: remove duplicate code
Qiang Huang [Fri, 8 Nov 2013 02:54:18 +0000 (10:54 +0800)]
lxc_user_nic: remove duplicate code

It's a duplicate of util.h.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agocoverity 1126129: don't try to print c->name when c is NULL
Dwight Engen [Wed, 6 Nov 2013 15:32:02 +0000 (10:32 -0500)]
coverity 1126129: don't try to print c->name when c is NULL

I accidentally introduced this with the change to lxc-info (commit
b9d957c3).

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-user-nic: rename nic inside container to desired name
Serge Hallyn [Fri, 25 Oct 2013 23:03:57 +0000 (18:03 -0500)]
lxc-user-nic: rename nic inside container to desired name

To do so we do a quick setns into the container's netns.  This
(unexpectedly) turns out cleaner than trying to rename it from
lxc_setup(), because we don't know the original nic name in
the container until we created it which we do in the parent
after the init has been cloned.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocreate_run_template: tell the template what caller's uid was mapped to
Serge Hallyn [Fri, 1 Nov 2013 20:27:49 +0000 (15:27 -0500)]
create_run_template: tell the template what caller's uid was mapped to

conf.c/conf.h: have replaced bool hostid_is_mapped() with int mapped_hostid()
   which returns the mapped uid for the caller's uid on the host, or -1 if
   none

create_run_template: pass caller's uid into template.

lxc-ubuntu-cloud:
1. accept --mapped-uid argument
2. don't write to devices cgroup - not allowed.
3. if running in userns, use $HOME/.cache
4. chown cached files to the uid to which our caller was
   mapped
5. ignore /dev when extracting rootfs in a userns

Changelog: nov 5: remove debugging INFO line.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoadd statistics to lxc-info
Dwight Engen [Tue, 5 Nov 2013 18:17:07 +0000 (13:17 -0500)]
add statistics to lxc-info

- allow lxc-info to show more than one container, using regex for the name

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agofix leak in list_active_containers()
Dwight Engen [Tue, 5 Nov 2013 18:17:02 +0000 (13:17 -0500)]
fix leak in list_active_containers()

Found by running the lxc-test-list test with valgrind. The names were
put into a local array, and never freed in the success case where the
caller didn't want the names returned and in the early out failure case.

Note we don't need to check the return from remove_from_array() because
we just successfully added the name above.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agotests list: refactor and add test for list_all_containers()
Dwight Engen [Tue, 5 Nov 2013 18:16:57 +0000 (13:16 -0500)]
tests list: refactor and add test for list_all_containers()

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoadd list_all_containers(), returns defined and active containers
Dwight Engen [Tue, 5 Nov 2013 18:16:51 +0000 (13:16 -0500)]
add list_all_containers(), returns defined and active containers

Changelog: [serge] remove unneeded explicity qsort call

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoFix tests on Android
Stéphane Graber [Wed, 6 Nov 2013 03:43:38 +0000 (22:43 -0500)]
Fix tests on Android

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoOnly include execinfo.h if MUTEX_DEBUGGING is set
Stéphane Graber [Tue, 5 Nov 2013 19:30:30 +0000 (14:30 -0500)]
Only include execinfo.h if MUTEX_DEBUGGING is set

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofix leak when a veth.pair name is specified
Dwight Engen [Tue, 5 Nov 2013 17:26:34 +0000 (12:26 -0500)]
fix leak when a veth.pair name is specified

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolua: add cmd_get_config_item to API
Dwight Engen [Mon, 4 Nov 2013 22:35:07 +0000 (17:35 -0500)]
lua: add cmd_get_config_item to API

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoallow lxcapi_get_cgroup_item() on lxc-execute containers
Dwight Engen [Mon, 4 Nov 2013 22:35:15 +0000 (17:35 -0500)]
allow lxcapi_get_cgroup_item() on lxc-execute containers

Containers started with lxc-execute may not have a conf, but
nothing in the implementation of lxcapi_get_cgroup_item()
actually needs/uses it, and it can be useful to get items out
of the containers' cgroup items.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-top: show kernel memory being used if available
Dwight Engen [Thu, 31 Oct 2013 20:38:36 +0000 (16:38 -0400)]
lxc-top: show kernel memory being used if available

- Also removed duplicate stats_clear lua function

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolua: fix stats collection using get_cgroup_item
Dwight Engen [Thu, 31 Oct 2013 20:38:30 +0000 (16:38 -0400)]
lua: fix stats collection using get_cgroup_item

Previously, the lua stats collection was building its own paths to the
cgroup files, which could be wrong depending on what --with-cgroup-pattern
was passed to configure. Fix it to use the get_cgroup_item api so it
always finds the files.

Remove cgroup_path_get since it is not used anymore.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoadd [gs]et_cgroup_item to lua api
Dwight Engen [Thu, 31 Oct 2013 20:38:22 +0000 (16:38 -0400)]
add [gs]et_cgroup_item to lua api

fix up api test to run and add test for new [gs]et_cgroup_item

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoallow setting/getting lxc.loglevel and lxc.logfile via set_config_item/get_config_ite...
S.Çağlar Onur [Sat, 2 Nov 2013 04:43:55 +0000 (00:43 -0400)]
allow setting/getting lxc.loglevel and lxc.logfile via set_config_item/get_config_item API calls

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agomake sure to check c->lxc_conf is not NULL before dereferencing it.
S.Çağlar Onur [Sat, 2 Nov 2013 21:15:36 +0000 (17:15 -0400)]
make sure to check c->lxc_conf is not NULL before dereferencing it.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoignore tags files that can be created via make ctags target
S.Çağlar Onur [Fri, 1 Nov 2013 20:39:31 +0000 (16:39 -0400)]
ignore tags files that can be created via make ctags target

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agovalgrind drd tool shows conflicting stores happening at lxc_global_config_value@src...
S.Çağlar Onur [Fri, 1 Nov 2013 20:16:10 +0000 (16:16 -0400)]
valgrind drd tool shows conflicting stores happening at lxc_global_config_value@src/lxc/utils.c (v2)

Conflict occurs between following lines

[...]
269         if (values[i])
270                 return values[i];
[...]

and

[...]
309         /* could not find value, use default */
310         values[i] = (*ptr)[1];
[...]

fix it using a specific lock dedicated to that problem as Serge suggested.

Also introduce a new autoconf parameter (--enable-mutex-debugging) to convert mutexes to error reporting type and to provide a stacktrace when locking fails.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoalways remount / rslave before running creation template (if root)
Serge Hallyn [Fri, 1 Nov 2013 17:17:52 +0000 (12:17 -0500)]
always remount / rslave before running creation template (if root)

If we're not root, our mounts in private userns won't get pushed
back anyway.  If we are root, we need to make sure that anything
the template does gets cleaned up.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoremove a few noisy, unhelpful INFOs in detect_shared_rootfs()
Serge Hallyn [Fri, 1 Nov 2013 14:11:18 +0000 (09:11 -0500)]
remove a few noisy, unhelpful INFOs in detect_shared_rootfs()

They are a nuisance.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoremove left over debug getchar()
Dwight Engen [Wed, 30 Oct 2013 17:50:33 +0000 (13:50 -0400)]
remove left over debug getchar()

I goofed and left in a getchar() that I was using to pause the test program
in a case that was failing for me. Remove it.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agodaemonize implies close_all_fds so set it in lxcapi_want_daemonize instead of setting...
S.Çağlar Onur [Wed, 30 Oct 2013 20:10:26 +0000 (16:10 -0400)]
daemonize implies close_all_fds so set it in lxcapi_want_daemonize instead of setting in every cli or in every binding explicitly

Reported-by: Fatih Arslan <ftharsln@gmail.com>
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoapi_create: undo unneeded chunk in previous commit
Serge Hallyn [Wed, 30 Oct 2013 17:47:38 +0000 (12:47 -0500)]
api_create: undo unneeded chunk in previous commit

lxc_conf exists after api_save_config

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoapi_create and do_bdev_create: a few more fixes
Serge Hallyn [Wed, 30 Oct 2013 15:57:45 +0000 (10:57 -0500)]
api_create and do_bdev_create: a few more fixes

don't use lxcpath variable for rootfs_path, it's confusing.

if rootfs is passed in and tpath is passed in, return error
before we save a new config, and don't delete the container

make sure to check c->lxc_conf is not NULL before dereferencing it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-create: fix conflict of rootfs.path and template default path
Sheng Yong [Sun, 27 Oct 2013 06:38:03 +0000 (14:38 +0800)]
lxc-create: fix conflict of rootfs.path and template default path

1. rootfs.path set, -t not set: rootfs.path is rootfs path
2. rootfs.path set, -t set: change template default path to rootfs path
3. rootfs.path not set, -t set: template default path is rootfs path
4. rootfs.path not set, -t not set: error
5. rootfs.path set but cannot access: error

Signed-off-by: Sheng Yong <shyodx@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxcapi_create: don't delete if container rootfs already exists
Sheng Yong [Sun, 27 Oct 2013 06:37:46 +0000 (14:37 +0800)]
lxcapi_create: don't delete if container rootfs already exists

If lxc.rootfs is specified, we believe rootfs is ready. lxc-start will
check this later. Return true, because the container is created.

Signed-off-by: Sheng Yong <shyodx@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agocoverity 1097616: don't deref NULL when subsystem doesn't have a '.'
Dwight Engen [Tue, 29 Oct 2013 20:46:21 +0000 (16:46 -0400)]
coverity 1097616: don't deref NULL when subsystem doesn't have a '.'

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofix cgpath test
Dwight Engen [Tue, 29 Oct 2013 20:46:16 +0000 (16:46 -0400)]
fix cgpath test

Commit 1ea59ad28 sets memory.use_hierarchy, which means that this test
cannot use memory.swappiness as its dummy cgroup item to set/unset since
writing to it with use_hierarchy set gets -EINVAL. Change test to use
memory.soft_limit_in_bytes instead.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocoverity 1097618: check for NULL return from calloc before deref
Dwight Engen [Tue, 29 Oct 2013 18:49:16 +0000 (14:49 -0400)]
coverity 1097618: check for NULL return from calloc before deref

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofix free() of args to startl
Dwight Engen [Tue, 29 Oct 2013 18:38:00 +0000 (14:38 -0400)]
fix free() of args to startl

Coverity 1076328 marked this as "Use after free", which it isn't really,
its actually just free()ing the wrong 2nd, 3rd, etc... pointers. Test by
passing two or more args to startl, without this change you get segfault
when free()ing the second pointer/arg.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agorpm spec: fix version numbering when building alpha, beta, rc
Serge Hallyn [Tue, 29 Oct 2013 17:48:46 +0000 (12:48 -0500)]
rpm spec: fix version numbering when building alpha, beta, rc

We want to ensure smooth upgrades when doing rpm -U throughout the
release cycle so this change implements the scheme documented at:
http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocoverity: ifr_name buffer not NULL terminated
Dwight Engen [Tue, 29 Oct 2013 13:24:29 +0000 (09:24 -0400)]
coverity: ifr_name buffer not NULL terminated

The kernel (net/core/dev_ioctl.c:dev_ioctl()) is going to NULL terminate
this name after the copy-in of the ifr, so even though this is a fixed
sized array the last byte isn't usable as part of the name. All the ioctls
we're using go through this code path.

Use the ifr name in the DEBUG message in case it was possibly truncated.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agofree getline allocated line variable to make valgrind happy
S.Çağlar Onur [Mon, 28 Oct 2013 19:39:12 +0000 (15:39 -0400)]
free getline allocated line variable to make valgrind happy

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agounnamed semaphores should be destroyed not closed
S.Çağlar Onur [Mon, 28 Oct 2013 19:37:22 +0000 (15:37 -0400)]
unnamed semaphores should be destroyed not closed

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agorpm spec: fix "warning: bogus date in %changelog"
Dwight Engen [Fri, 25 Oct 2013 23:01:54 +0000 (19:01 -0400)]
rpm spec: fix "warning: bogus date in %changelog"

Mar 24 2009 was actually a Tuesday, maybe Daniel was still recovering
from Monday ;) Stranger still that RPM actually checks this!?

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoUse actual length of socket's name for abstract sockets (v3)
S.Çağlar Onur [Fri, 25 Oct 2013 22:04:52 +0000 (18:04 -0400)]
Use actual length of socket's name for abstract sockets (v3)

The addrlen parameter should be the actual length of socket's name for abstract sockets. Otherwise socket gets padded with NULLs.

cat /proc/net/unix | grep lxc
[...]
000000000000000000000003 00000000 00000000 0001 03 226548 @lxc/ad055575fe28ddd5//var/lib/lxc^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
[...]

with this patch;

cat /proc/net/unix | grep lxc
[...]
000000000000000000000002 00000000 00010000 0001 01 109563 @lxc/ad055575fe28ddd5//var/lib/lxc
[...]

Changes since v1:
    * check the length of passed-in string
Changes since v2:
    * remove non-abstract socket code path to simplify functions
    * rename lxc_af_unix_* family to lxc_abstract_unix_*

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoEliminate duplicate entries from list_active_containers (v2)
S.Çağlar Onur [Thu, 24 Oct 2013 04:02:37 +0000 (00:02 -0400)]
Eliminate duplicate entries from list_active_containers (v2)

list_active_containers parses /proc/net/unix which can contain multiple entries for the same container;

000000000000000000000002 00000000 00010000 0001 01 273672 @/var/lib/lxc/6/command
000000000000000000000002 00000000 00010000 0001 01 274395 @/var/lib/lxc/5/command
000000000000000000000002 00000000 00010000 0001 01 273890 @/var/lib/lxc/4/command
000000000000000000000002 00000000 00010000 0001 01 273141 @/var/lib/lxc/3/command
000000000000000000000002 00000000 00010000 0001 01 273915 @/var/lib/lxc/2/command
000000000000000000000002 00000000 00010000 0001 01 273683 @/var/lib/lxc/1/command
000000000000000000000002 00000000 00010000 0001 01 273074 @/var/lib/lxc/0/command
000000000000000000000002 00000000 00010000 0001 01 273931 @/var/lib/lxc/9/command
000000000000000000000002 00000000 00010000 0001 01 273110 @/var/lib/lxc/8/command
000000000000000000000002 00000000 00010000 0001 01 273390 @/var/lib/lxc/7/command
000000000000000000000003 00000000 00000000 0001 03 275903 @/var/lib/lxc/8/command
000000000000000000000003 00000000 00000000 0001 03 276043 @/var/lib/lxc/1/command
000000000000000000000003 00000000 00000000 0001 03 273301 @/var/lib/lxc/0/command
000000000000000000000003 00000000 00000000 0001 03 275650 @/var/lib/lxc/4/command

On this system list_active_containers returns 14 containers while only 10 containers are running.

Following patch;

* Introduces array_contains function to do a binary search on given array,
* Starts to sort arrays inside the add_to_clist and add_to_names functions,
* Consumes array_contains in list_active_containers to eliminate duplicates,
* Replaces the linear search code in lxcapi_get_interfaces with the new function.

Changes since v1:
* Do not load containers if a if a container list is not passed in
* Fix possible memory leaks in lxcapi_get_ips and lxcapi_get_interfaces if realloc fails

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-alpine: enable 4 consoles by default
Natanael Copa [Thu, 24 Oct 2013 11:30:15 +0000 (13:30 +0200)]
lxc-alpine: enable 4 consoles by default

We allow 4 consoles in the LXC config file so we can enable 4 in the
inittab as well.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-alpine: run bootmisc and syslog at boot runlevel
Natanael Copa [Thu, 24 Oct 2013 11:30:14 +0000 (13:30 +0200)]
lxc-alpine: run bootmisc and syslog at boot runlevel

The bootmisc script is needed to clean up various temp dirs like /tmp
and migrate /var/run to /run if needed.

The syslog service is started in 'boot' runlevel when running on real
hardware so we do the same for containers.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agocgroup: set memory.use_hierarchy
Serge Hallyn [Fri, 25 Oct 2013 05:16:17 +0000 (00:16 -0500)]
cgroup: set memory.use_hierarchy

But don't fail the container start if that fails.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-ls: Rewrite nesting code to use the attach API
Stéphane Graber [Thu, 24 Oct 2013 18:45:34 +0000 (14:45 -0400)]
lxc-ls: Rewrite nesting code to use the attach API

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>