Commit Graph

1911 Commits

Author SHA1 Message Date
Sidnei da Silva
055af165ef Assume a default thin pool named 'lxc'.
Will fallback to no thinpool if not present or if thin pool provided on the command line does not exist.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-21 16:12:19 -05:00
Stéphane Graber
07520b2af5
Update maintainers and URLs
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-20 00:48:48 -04:00
Stéphane Graber
36b33520f6
Fix typos identified by lintian
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-20 00:34:07 -04:00
S.Çağlar Onur
bc605ac6dd Fix following compile error on ubuntu 12.10
[...]
make[3]: Entering directory `/home/caglar/Projects/lxc/src/tests'
depbase=`echo attach.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        gcc -DHAVE_CONFIG_H -I. -I../../src    -I../../src -DLXCROOTFSMOUNT=\"/usr/lib/x86_64-linux-gnu/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\"   -g -O2 -Wall -Werror -MT attach.o -MD -MP -MF $depbase.Tpo -c -o attach.o attach.c &&\
        mv -f $depbase.Tpo $depbase.Po
attach.c: In function ‘main’:
attach.c:380:2: error: implicit declaration of function ‘test_lsm_detect’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[3]: *** [attach.o] Error 1
[...]

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-19 09:53:09 -05:00
S.Çağlar Onur
58b61f6d34 use snapshot_destroy in tests/snapshot.c and clean up containers after the test run
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-19 09:50:09 -05:00
S.Çağlar Onur
771d96b380 introduce snapshot_destroy
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-19 09:49:19 -05:00
S.Çağlar Onur
93ea85c71b call lxc_container_put when needed in lxc_destroy.c
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-19 09:49:14 -05:00
Stéphane Graber
8b54fb4de8
change version to 1.0.0.alpha2 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 18:11:53 -04:00
Stéphane Graber
0f8f9c8aa4
lxccontainer.c: Replace rindex by strrchr (bionic)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 18:00:24 -04:00
Stéphane Graber
6c1b2b1db9
lsm.h: Fix inline definition
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 17:59:43 -04:00
Sidnei da Silva
55a204f9f4 Allocate cmd string with alloca instead of malloc, close popen handle if fgets fails. 2013-10-18 14:43:03 -05:00
Sidnei da Silva
62c70ee2c1 Document the new --thinpool option 2013-10-18 14:43:03 -05:00
Sidnei da Silva
f99c386b60 Add a --thinpool argument to lxc-create, to use thin pool backed lvm when creating the container. When cloning a container backed by a thin pool, the clone will default to the same thin pool. 2013-10-18 14:43:03 -05:00
Dwight Engen
e0b6898ab4 use proper config item depending on which lsm is enabled
On a system with AppArmor enabled, if lxc.se_context is configured but
lxc.aa_profile is not (because the user just wants to use the default
AppArmor profile) lxc was passing the lxc.se_context to be set as the
new AppArmor profile. Determine which configuration item to use based
on which lsm is enabled.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-18 13:57:43 -05:00
Dwight Engen
72863294f6 support setting lsm label at exec or immediately
- Add attach test cases

- Moved setting of LSM label later to avoid failure of IPC between parent
  and child during attach

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-18 13:57:37 -05:00
Dwight Engen
41ca89087a add lsm op for getting name of enabled lsm
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-18 13:57:33 -05:00
Natanael Copa
3d460a3856 lxc-alpine: enable loopback interface by default
It was probably disabled by a mistake

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 14:42:46 -04:00
Stéphane Graber
01dae5c455 lxc-start-ephemeral: Fix broken mount logic
This reworks the mount logic for lxc-start-ephemeral to be as follow:
 - Any real (non-bind) entry gets copied to the target fstab
 - Any bind-mount from a virtual fs gets copied to the target fstab
 - Any remaining bind-mount if confirmed to be valid gets setup as an
   overlay.

Extra bind-mounts passed through the -b option are mounted by the
pre-mount script and don't need processing by the fstab generator.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-18 13:33:26 -05:00
Serge Hallyn
3ca91fb6f4 lxc-test-ubuntu: also allow the standard non-nested apparmor policy
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 11:27:48 -05:00
Serge Hallyn
8daccdb4d0 parse.c: don't print error message on callback rv > 0
A callback return value < 0 means there was an error, so print
out an error message.  But a rv > 0 is used by the mount_unknown_fs
functions to say "we found the one we want, stop here."

Document this, and only print an error message if rv < 0.  Otherwise,

	lxc-create -B lvm --fstype ext3 -t ubuntu -n u1

will print an (innocuous) error message about being unable to parse
the config value 'ext3'.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 11:27:42 -05:00
Alexander Khryukin
6e7e54d902 Change configure, replacing mandriva by openmandriva
The latest Mandriva distro release was in 2011 and nowadays distro named
OpenMandriva Lx.

Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-18 12:25:45 -04:00
Laurent Vallar
09da66e667 lxc-debian: Remove perl, use sed instead
Signed-off-by: Laurent Vallar <val@zbla.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-17 16:44:33 -04:00
Laurent Vallar
90ccc878de lxc-debian: Force locales generation
Signed-off-by: Laurent Vallar <val@zbla.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-17 16:44:20 -04:00
Dmitry Yu Okunev
157aa271b5 lxc-attach: fixed typo: privleges -> privileges
Signed-off-by: Dmitry Yu Okunev <dyokunev@ut.mephi.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-17 16:40:54 -04:00
Dwight Engen
9e4bf8b12a add lsm op for checking if an lsm is present/enabled
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-17 10:18:52 -05:00
Dwight Engen
fefddf9f9f fix busybox template for use with AppArmor
Ensure /proc and /sys are mounted in the container, otherwise
apparmor_enabled() will fail to find
/sys/module/apparmor/parameters/enabled

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-17 10:18:51 -05:00
Dwight Engen
c944b920f4 oracle template: fix selinux context on symlinks in /dev
This fixes sshd getting an avc on traversing the /dev/ptmx symlink
(was default_t)

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-17 10:18:06 -05:00
Stéphane Graber
67e5a20ad1 Improper pty permissions - missing mode=0620, gid=5
This fix is coming from Debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720122

The reason for the hardcoded gid= and mode= is because of the fix for
CVE-2013-2207 which removes pt_chown from glibc and so requires proper
write access to devpts.

It looks like the "tty" group is guaranteed to be gid=5 on at least all
RedHat based and Debian based systems. So this hardcode gid shouldn't be
a big problem. If we however support any distro where that's not the
case, we'll need to implement an extra lxc.conf option and matching
template changes.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-16 11:47:14 -05:00
Dwight Engen
c414be2526 add more detail in automount error message
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-16 11:45:40 -05:00
Stéphane Graber
f10e04e361 Make 'make dist' match git content
This fixes a few obvious issues when comparing the make dist output with
the git tree.

 - Make all templates non-executable in git
 - Remove unused files:
   - src/lxc/list.c (empty, only includes the list.h header)
   - src/lxc/lxc-destroy.in (replace by lxc_destroy.c)
 - Add missing files to dist tarball:
   - src/python-lxc/examples/pyconsole.py
   - src/python-lxc/examples/pyconsole-vte.py
 - Mark all the python API tests executable
 - Mark lxc-test-ubuntu executable

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-16 11:41:24 -05:00
Laurent Vallar
1927a6be97 lxc-debian: Add --arch option
Signed-off-by: Laurent Vallar <val@zbla.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-15 10:47:33 -04:00
Laurent Vallar
b269b8ad75 lxc-debian: Add support for --release
Signed-off-by: Laurent Vallar <val@zbla.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-15 10:47:25 -04:00
KATOH Yasufumi
f57a029f39 doc: Improve Japanese lxc.conf(5) to be easy to read
Change the location of linefeed for improving to be read lxc.conf(5) in
Japanese environment.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-15 10:45:45 -04:00
Serge Hallyn
a41f104bfb define list container api (v2)
Two new commands are defined: list_defined_containers() and
list_active_containers().  Both take an lxcpath (NULL means
use the default lxcpath) and return the number of containers
found.  If a lxc_container ** is passed in, then an array of
lxc_container's is returned, one for each container found.
The caller must then lxc_container_put() each container and
free the array, as shown in the new list testcase.
If a char ** is passed in, then an array of container names
is returned, after which the caller must free all the names
and the name array, as showsn in the testcase.

Changelog:
	Check for the container config file before trying to
	create an lxc_container *, to save some work. [ per
	stgraber comments]
	Add names ** argument to return only container names.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-14 12:42:39 -05:00
Dwight Engen
f3cef1cbe2 fix clone prototype
gcc was complaining with:
reboot.c:33: error: conflicting types for ‘clone’
/usr/include/bits/sched.h:83: note: previous declaration of ‘clone’ was here

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-10 12:41:31 -05:00
Alexander Khryukin
7d35d3a7e1 add $arch to cache path
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:34:14 -04:00
Alexander Khryukin
aa1c458caa fix typo and minor cleanup
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:34:06 -04:00
Alexander Khryukin
edcf9b5979 minor cleanup in template and add systemd_configure function with openmandriva-related tricks
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:33:46 -04:00
Alexander Khryukin
f1d8e7ed86 fix .gitignore file and add a little improvements to openmandriva template
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:32:31 -04:00
Alexander Khryukin
9aad9d12c9 Add an OpenMandriva distro lxc-openmandriva template
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:32:02 -04:00
KATOH Yasufumi
92cbfdaf68 template: Improved lxc-plamo template
lxc-plamo now work with any distribution other than Plamo Linux.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:30:44 -04:00
KATOH Yasufumi
cab7912308 template: Add Plamo Linux template
This template allows to create Plamo Linux container on Plamo
Linux. Plamo Linux is Japanese distribution, which is originally based
on Slackware Linux.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-09 22:51:49 -04:00
Stéphane Graber
e63b2dbc34
Add lxc-test-ubuntu to the dist tarball
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-09 18:09:56 -04:00
Serge Hallyn
1e0f62acaa ubuntu-cloud-prep hook: fix debug helper to not inappropriately fail
Bug found by Vincent Ladeuil <vila+ci@canonical.com>
Fix suggested by Scott Moser <smoser@ubuntu.com>

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-09 13:03:56 -05:00
Dwight Engen
41246cee3b ensure gnutls is initialized before use
Section 7.1.2 of the gnutls info manual states that it must be
initialized with a call to gnutls_global_init before use. This
fixes the syslog warning I was seeing:

  lxc-create: Libgcrypt warning: missing initialization -
              please fix the application

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:47:58 -04:00
KATOH Yasufumi
f220889fd2 doc: Fix Japanese lxc.conf(5) man page
Same as the commit 3157e67395

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:08:45 -04:00
KATOH Yasufumi
ebe0aeb19c doc: Generate Japanese lxc-snapshot(1) man page
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:08:43 -04:00
Stéphane Graber
9c3bc32c57
lxc-ubuntu-cloud: Cope with spaces in paths
Reported-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 10:51:53 -04:00
Scott Moser
494fd6b390
lxc-ubuntu-cloud: pass --numeric-owner and -p to untar
Just following up here, Serge raised the question of whether or not the
other two invocations of 'tar' in this script need '--numeric-owner'.
They probably should have it, although its of little concern because the
'build_root_tgz' path is only taken if there is no '-root.tar.gz' file for
download, and the only supported ubuntu release without the -root.tar.gz
download is 10.04 at this point.

Anyway, below is a more complete diff, also including a fix as
'--numeric-uid' is not a valid option to tar.  The name is
'--numeric-owner'.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 10:25:30 -04:00
Serge Hallyn
034ef75d49 coverity: free dent_buf on error path (cgroup.c)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-07 14:10:29 -05:00