Commit Graph

2140 Commits

Author SHA1 Message Date
Stéphane Graber
f91d5e4e3f configure.ac: Make our configure more consistent
This commit does the following changes:
 - Disable rpath by default
 - Switch all of our options to --enable-FEATURE in the help
 - Add auto-detection of libcap availability
 - Add auto-detection of python3 availability
 - Always specify the default value in --help
 - Add a configuration overview at the end

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-16 08:14:23 -06:00
Stéphane Graber
e8eab8b6d4
ubuntu: Fix initial container creation
The list of packages must be comma separated, not space separated.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-13 17:56:13 -05:00
Serge Hallyn
af415076b6 coverity: remove logically dead code
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-13 16:15:10 -06:00
hallyn
a611bce104 Merge pull request #101 from ahippo/master
run_buffer(): unblock all signals for spawned scripts.
2013-12-13 13:13:19 -08:00
Serge Hallyn
26b797f3d2 make 'empty network' the default
Currently if no lxc.network.type section is in the container
configuration, the container ends up sharing the host's network.
This is a dangerous default.

Instead, add 'lxc.network.type = none' as a valid type, and make
en empty network the default.

If none as well as another network type are specified, then the
none type will be ignored.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-13 14:16:45 -05:00
Libo Chen
5d127727fb lxc-user-nic: fix the wrong use of realloc
fix the wrong use of realloc

Signed-off-by: Libo Chen <clbchenlibo.chen@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 22:24:33 -06:00
Serge Hallyn
a3b47c094b coverity: drop gratuitous null check
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 14:02:00 -06:00
Serge Hallyn
915614c78f coverity: don't deref null c
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 13:58:50 -06:00
Serge Hallyn
cbaed76dda coverity: an int is not 1 byte
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 13:56:35 -06:00
Serge Hallyn
fef48dc942 coverity: fix mix of bool and int
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 13:47:24 -06:00
Serge Hallyn
908fde6aad coverity: avoid deref of explicitly NULL variable on error path
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:57:21 -06:00
Serge Hallyn
32571606a1 coverity: fix use before null check
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:51:35 -06:00
Serge Hallyn
ce42ba2c79 coverity: change flow to safely free in all exit paths
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:47:14 -06:00
Serge Hallyn
88dd66fc36 coverity: fix memleak in userns_exec_1
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:30:13 -06:00
Serge Hallyn
c30ac545a3 coverity : fix memleak on error path
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:23:34 -06:00
Serge Hallyn
b8f475c017 don't run lxc-user-nic for empty netns
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:12:06 -06:00
Serge Hallyn
2b142295af typo fix: create $rootfs/dev/pts
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-12 12:07:36 -06:00
Stéphane Graber
3eb967f096 python3: Support unpriv containers
This removes any existing uid check in the python3 binding and tools,
replacing those by .controllable where appropriate.

Extra checks are also added to make lxc-ls work as a user, returning as
much information as can possibly be retrieved.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-11 17:06:41 -05:00
Serge Hallyn
0ecf64b554 initialize stopped at top of lxc_cmd
and don't do it at all the callers

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-11 15:15:31 -06:00
Stéphane Graber
814928c87a Fix uninitialized value in lxc_try_cmd
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-11 16:01:35 -05:00
Stéphane Graber
9c073d6b76 lxc-ls: Detect missing setns support
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-11 14:58:12 -05:00
KATOH Yasufumi
0dc2961457 plamo: Update because rc script of plamo was updated
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>
2013-12-11 10:20:40 -05:00
Stéphane Graber
d2305c4cde
ubuntu: Make vim part of base template
This moves vim back to the default list of packages, drops the duplicate
ssh entry which means that unless extra packages are passed through
--packages, container creation won't invoke apt-get anymore.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-10 18:26:58 -05:00
James Hunt
f0ca27269a Make public API string method parameters const where possible.
Signed-off-by: James Hunt <james.hunt@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-10 10:41:38 -05:00
Qiang Huang
448e272de5 lxc-test-concurrent: initialize saveptr before use
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-10 09:06:50 -05:00
Stéphane Graber
6472dcc2c9
ubuntu: Add comment about the mounting profile
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 17:05:26 -05:00
S.Çağlar Onur
d392844188 ubuntu: add comments about running unconfined or nested containers
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 15:06:59 -05:00
S.Çağlar Onur
802f869f40 use $LOCALSTATEDIR/lock/subsys/lxc-ubuntu$release as lock filename
Otherwise one cannot create two containers with different releases
(let's say saucy [cached] and raring [not caced]) if both are not
cached on the local filesystem already. The lock blocks cached
one to move forward until not cached one finishes it's downloads.

Fix that by seperating locks using release names

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 15:04:46 -05:00
S.Çağlar Onur
826eb79882 use /var/lock/subsys/lxc-centos instead of /var/lock/subsys/lxc as a lock name
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 15:04:42 -05:00
S.Çağlar Onur
ccef566eb0 call fclose() for pid_fp on failure
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 15:04:40 -05:00
Bogdan Purcareata
7f1dea04a4 lxc-busybox: make securityfs bind-mount optional
Prevent container start from failing when running Busybox containers on hosts without securityfs support.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 14:59:08 -05:00
Bogdan Purcareata
d2bf794591 lxc-clone: proper type for getopt_long result
While char is a signed type and should have no trouble
storing a "-1" value, getopt_long() will return a value of 255
instead of -1. This has been noticed on powerpc; there's also
some upstream talk about it at [1].

Change variable type from char to int, since it's also the
documented use.

[1] http://stackoverflow.com/questions/17070958/c-why-does-getopt-return-255-on-linux

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 14:59:05 -05:00
KATOH Yasufumi
359c71b65f doc: Update Japanese lxc-monitor(1)
Update for commit 2afd1dc05b

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 14:58:51 -05:00
Serge Logvinov
44b430e2c5 altlinux: Use relative paths and fix rootfs variable.
Change paths in fstab to be relative to the root and fix a wrong
rootfs_path value.

Signed-off-by: Serge Logvinov <serge.logvinov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-09 14:55:58 -05:00
Stéphane Graber
4ed0b62273
Update mailing-list addresses
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-08 17:51:28 -05:00
Stéphane Graber
fd580e6deb
lxc_monitor: Add missing include (errno.h)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 18:24:41 -05:00
Stéphane Graber
8e63ce3004 lxc_monitor: Check return value of write
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-06 17:31:51 -05:00
Dwight Engen
fbbc15397a busybox template: set mode when creating device nodes
Ensure mode 666 is set for tty1 and tty5

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 16:58:47 -05:00
Dwight Engen
2afd1dc05b let lxc-monitor command ask a lxc-monitord instance to quit
Once lxc-monitord receives a quit request from lxc-monitor, it will then
return from the mainloop every time an event occurs on any of its fds and
check if it has any clients left. When there are no more it exits. This
allows lxc-monitord to quit immediately instead of waiting the normal 30
seconds for more clients, potentially freeing up lxcpath for unmounting.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 16:03:23 -05:00
Dwight Engen
84c92abdd1 add epoll events to mainloop callback handlers
Adding the epoll events allows the handler to determine what events
happened on the fd.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 16:03:20 -05:00
Dwight Engen
341c971806 oracle: fix chcon warning when selinux disabled
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 15:36:19 -05:00
Stéphane Graber
64994c030c
confile: Fix invalid lxc.network.ipv6 address
The writer code was using AF_INET instead of AF_INET6 when converting
the address to ascii.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 15:28:55 -05:00
Stéphane Graber
f2a95ee1bf Move some common Ubuntu config
This introduces a new /usr/share/lxc/config directory containing common
configuration snippets.

The two Ubuntu templates are then simplified to just include the
relevant entries avoiding a whole lot of hardcoded cgroup, capabilities
and mount points configuration.

An extra comment is also added at the top of all generated configuration
files telling the user to look at lxc.conf(5) for more information.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-06 11:21:46 -05:00
Stéphane Graber
34cfffb385 Add support for new create=(dir,file) mount option
Just like we already had "optional", this adds two new LXC-specific
mount flags:
 - create=dir (will do a mkdir_p on the path)
 - create=file (will do a mkdir_p on the dirname + a fopen on the path)

This was motivated by some of the needed bind-mounts for the
unprivileged containers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-06 11:21:38 -05:00
Stéphane Graber
d6eca24027 conffile.c: Also clear text entries with no value
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-06 11:21:13 -05:00
KATOH Yasufumi
53251299b8 doc: Update Japanese lxc.conf(5)
translate the untranslated paragraph

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-06 09:43:55 -05:00
Stéphane Graber
a026568526 Make lxc-user-nic use mkifname
NetworkManager at least expects all veth devices to be called veth*
otherwise it'll consider them as physical interface and try to do DHCP
on them.

This change makes lxc-user-nic use the same function that we use for LXC
itself which will give us standard vethXXXXX kind of interfaces.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-12-05 14:56:25 -05:00
S.Çağlar Onur
00194067f1 add destroy option to lxc-snapshot
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-12-04 12:16:15 -06:00
Stéphane Graber
2b25068a3d Fix Makefile.am to produce usable dist tarball
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-03 17:08:16 -05:00
Stéphane Graber
af7d9cc56c python3: Drop duplicate add_device_node function
It is now natively implemented in C, the new function takes the same
arguments (same order, different names) and has been confirmed to work
with lxc-device.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-03 16:47:55 -05:00