Commit Graph

2392 Commits

Author SHA1 Message Date
Stéphane Graber
a38c2e6f8d tests: Fix startone
- Fix cgroup test to work on multi-core systems
 - Drop user interaction

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 15:56:32 -05:00
Stéphane Graber
52d21d4051 conf: Fix clear_config_item on lxc.network entries
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 15:40:50 -05:00
Stéphane Graber
8cb8e496d0 tests: Fix lxc-user-nic path
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 14:25:15 -05:00
Stéphane Graber
e6c6d62287
tests: Fix python3 API test
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 14:00:02 -05:00
Stéphane Graber
53df623dbd
tests: Don't require user interaction in containertests
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 13:49:47 -05:00
Stéphane Graber
a1258e6dae
Fix previous change to use defined()
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 13:42:37 -05:00
Stéphane Graber
92e23841a2
Support __NR_set_ns as well.
Apparently some older systems didn't have __NR_setns but had __NR_set_ns.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 13:27:26 -05:00
Dwight Engen
e43157b4b2 doc: fix See Also lxc-usernet.conf -> lxc-usernet
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 13:07:50 -05:00
Michael H. Warfield
08754f305b Update CentOS and Fedora templates to support archtectures option.
Added code to the CentOS and Fedora templates so that x86 32 bit containers
may be built on x86_64 platforms.  Like archectectures may also be trivially
used as well.

Option added is "-a {arch}".

Additionally cleaned up some bash specific logic.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 12:36:40 -05:00
Serge Hallyn
3ec1648d8e idmap_add_id: fix broken behavior
The geteuid() addition is being made the first element of the lxc_list,
but the first element is just a head whose entry is ignored.  Therefore
userns_exec_1() was starting its tasks without the caller's uid mapped
into the namespace.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 11:52:42 -05:00
Dwight Engen
9f2fd74c7b add lua-alt-getopt dependency
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 11:52:39 -05:00
KATOH Yasufumi
3220ecebfc doc: Add Japanese lxc-config(1)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 11:52:35 -05:00
Stéphane Graber
80a873c223 tests: Fix createtest
Drop 60s delay and clear config before loading it.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:45 -05:00
Stéphane Graber
0898897a3a tests: Remove containers after running clonetest
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:40 -05:00
Stéphane Graber
2ed29824dc tests: Drop 60s delay in shutdowntest
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:35 -05:00
Stéphane Graber
e8ff96bbf8 Fix destroy() crash when no config is loaded
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:31 -05:00
Stéphane Graber
068b3d0431 tests: Fix lxc-test-saveconfig cleanup
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:26 -05:00
Stéphane Graber
cc3afb1ef5 tests: Fix shutdown test
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:22 -05:00
Stéphane Graber
c85a40bc4d tests: Speed up lxc-test-usernic
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:18 -05:00
Stéphane Graber
8ced4fd4f7 tests: Tweak lxc-test-ubuntu to be faster
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:13 -05:00
Stéphane Graber
0e17b9c69b tests: Rework lxc-test-usernic
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:07 -05:00
Stéphane Graber
7059802cf0 tests: Fix cleanup in lxc-test-unpriv
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:33:01 -05:00
Stéphane Graber
73d3e0903c tests: Update lxc-test-unpriv
Update lxc-test-unpriv to be a bit simpler and more reliable.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-24 11:32:55 -05:00
Serge Hallyn
0b3a6504e5 get_mapped_rootid: fix description
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 14:51:42 -06:00
Serge Hallyn
2a9a80cb1c get_mapped_rootid: avoid using (uid_t) -1
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 14:50:18 -06:00
Serge Hallyn
1354955b02 lxc-clone: support unprivileged use
This also fixes unprivileged use of lxc-snapshot and lxc-rename.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-23 15:09:17 -05:00
Serge Hallyn
f6639e3bee cgm_get: support NULL value
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 13:35:50 -06:00
Stéphane Graber
bfb1bb94c8 Drop runapitests.sh
This script is outdated and unused.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 14:08:44 -05:00
Serge Hallyn
da10a5c6a2 Revert "cgroupfs: support older kernels without cgroup.clone_children"
This reverts commit 0a4d93787d.
2014-01-23 13:03:11 -06:00
Serge Hallyn
3e45c94884 Revert "bionic: Replace rindex by strrchr"
This reverts commit 86f0eb65a0.
2014-01-23 13:03:05 -06:00
Serge Hallyn
2edb53c7c8 Revert "cgroup.c: clean up for handle_cgroup_settings"
This reverts commit 032e28b767.
2014-01-23 13:02:25 -06:00
Serge Hallyn
f6ac3b9eca Revert "cgroupfs: get rid of the redundant error info"
This reverts commit a8117b3361.
2014-01-23 13:02:15 -06:00
Serge Hallyn
fec822c4a0 Revert "cgroupfs: need the full path to setup cpuset"
This reverts commit 47f5ede0ec.
2014-01-23 13:02:08 -06:00
Stéphane Graber
ff5e275105 doc: Add manpage for lxc-config
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 12:51:47 -05:00
Qiang Huang
47f5ede0ec cgroupfs: need the full path to setup cpuset
Function file_exists() needs a absolute full path, but we are using
current_entire_path which is not. It will get the wrong result from
file_exists() and case Segmentation fault when we fopen a non-exist
file and try to fscanf from it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 11:21:34 -06:00
Qiang Huang
a8117b3361 cgroupfs: get rid of the redundant error info
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-23 11:18:07 -06:00
KATOH Yasufumi
fb261f53fc doc: Add Japanese lxc.container.conf(5), lxc.system.conf(5) and update lxc.conf(5)
* update for commit 55fc19a104
* fix typo in English lxc.system.conf(5)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.coM>
2014-01-23 10:53:06 -05:00
Qiang Huang
032e28b767 cgroup.c: clean up for handle_cgroup_settings
Clean up the nesting if, make the logic similar for memory
and cpuset, and the error message should sent from inside,
for better extendibility.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 21:25:35 -06:00
Stéphane Graber
55fc19a104 doc: Try to clear some confusion about lxc.conf
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 22:16:20 -05:00
Stéphane Graber
ffa0e610dc lxc-start-ephemeral: require root
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 22:15:20 -05:00
Serge Hallyn
bba1fbe695 lxc_init: don't fail on bad signals
Changelog: Jan 22: as Michael Warfield pointed out, we should only
ignore EINVAL, since EFAULT points to a more serious problem.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 21:55:09 -05:00
Stéphane Graber
86f0eb65a0 bionic: Replace rindex by strrchr
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 21:25:29 -05:00
Serge Hallyn
0a4d93787d cgroupfs: support older kernels without cgroup.clone_children
When creating a cgroup, detect whether cgroup.clone_children
exists.  If not, then manually copy the parent's cpuset.cpus
and cpuset.mems values.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 20:01:36 -05:00
KATOH Yasufumi
8c3a756ed4 plamo: Improve template
allow not to specify a variable that is related installed packages

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 19:57:53 -05:00
Qiang Huang
6eaac3034e daemon: fix the wrong pid in daemon model
When you start a container in daemon model, you have at least
3 processes:
 1. The command the user start (lxc-start -d)
 2. The backgrounded fork of that command after start() is done
 3. The container init process

In PID file, we need (2), but currently we are writing (1),
this is wrong because (1) exits as soon as the container is
started, it's complately useless.

So we write pid after daemonize, so that we'll always write
the right pid to PID file.

Reported-by: Stephane Graber <stgraber@ubuntu.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 19:53:22 -05:00
Qiang Huang
72cf75fa33 lxc-start: store PID file to lxc_container
So we can remove PID file untill lxc_container_free.

This also fix bug: https://github.com/lxc/lxc/issues/89

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 19:51:45 -05:00
Serge Hallyn
844f7a3874 api_start: don't get a container reference for the daemonized case
In the daemonized case we will fork, so the anonymous container memlock
will not be shared between parent and child.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 18:28:13 -06:00
Stéphane Graber
2eee1b96c6 Fix handling of empty config keys
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 19:24:47 -05:00
Serge Hallyn
87b86add6c cgmanager: cgm_set: return the length we found
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 15:19:59 -05:00
Dwight Engen
e0f2f5c764 lxc.spec: package bash completion, lxc-monitord move
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 15:19:59 -05:00