Commit Graph

3097 Commits

Author SHA1 Message Date
Stéphane Graber
d2928eafbb
change version to 1.1.0.alpha3 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 14:59:15 -05:00
Shuai Zhang
c8a600ea29 fixed typo in comment
Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 11:04:19 -05:00
Stéphane Graber
2e2d6a7be9
Improve veth error cases logging
The previous error message made it look like the host interface name was
the concatenation of both the host and guest interface names.

Closes #374

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 11:01:45 -05:00
Cameron Norman
4de03d375b lxc-debian: mask both Wheezy and Jessie udev services
Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:21 -05:00
Cameron Norman
2b75b644f8 lxc-debian: adjust init system configurations
Do as much as possible to allow containers switching from non-systemd to
systemd to work as intended (but nothing that will cause side effects).
Use update-rc.d disable instead of remove so the init scripts are not
re-enabled when the package is updated

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:16 -05:00
KATOH Yasufumi
be54cb1c55 doc: Always include the Japanese lxc-top manpage
Update for commit e71549f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:56:03 -05:00
KATOH Yasufumi
c881c406ac Add the Japanese translation for the lxc.init_cmd config option
Update for commit 67c660d

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:55:56 -05:00
Stéphane Graber
a4318300b4 Revert "audit: added capacity and reserve() to nlmsg"
This reverts commit 55ae7edb18.

This change caused hangs in the testsuite, specifically with lxc-user-nic.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 15:37:42 -05:00
Casey Marshall
26f1b3902c Allow lxc_clear_config_item to clear idmaps.
Ran into this when trying to automate stgraber's "GUI in containers"
post.

Signed-off-by: Casey Marshall <casey.marshall@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 15:15:32 -05:00
overlay fs
40d811614c Issue #278: lxc-start-ephemeral: add --cdir option for cow-mounts
This is a copy of patch version 3 for issue #278 on the issue-tracker:

 - Allow multiple bind-mounts (--bdir) and multiple cow-mounts (--cdir).

 - Further fixes to permissions throughout lxc-start-ephemeral (annotated
   in the code).

Signed-off by: Oleg Freedholm <overlayfs@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 14:01:56 -05:00
Johannes Kastl
de548c6055 lxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:47:10 -05:00
Stéphane Graber
e71549fc7e doc: Always include the lxc-top manpage
Since it's no longer written in lua.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:46:37 -05:00
Stéphane Graber
67c660d0aa Define a new lxc.init_cmd config option
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-12-01 13:46:11 -05:00
Stéphane Graber
c464fd7e01 tabs/spaces consistency
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:44:11 -05:00
Stéphane Graber
358f18beab Add missing files to ignore list
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-12-01 13:43:25 -05:00
Shuai Zhang
55ae7edb18 audit: added capacity and reserve() to nlmsg
There are now two (permitted) ways to add data to netlink message:

1. put_xxx()
2. call nlmsg_reserve() to get a pointer to newly reserved room within the
   original netlink message, then write or memcpy data to that area.

Both of them guarantee adding requested length data do not overflow the
pre-allocated message buffer by checking against its cap field first.

And there may be no need to access nlmsg_len outside nl module, because both
put_xxx() and nlmsg_reserve() have alread did that for us.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:42:41 -05:00
Johannes Kastl
f38788b405 lxc-opensuse: Disable on 13.2
Disabled building openSUSE containers on openSUSE 13.2 and  openSUSE
Tumbleweed due to faulty behaviour with newer versions of
init_buildsystem.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:52:22 -05:00
Natanael Copa
646b1ef753 lxc-alpine: create a default tty for console
Create a tty so we get login prompt on console by default

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:50:31 -05:00
Natanael Copa
b55a662242 lxc-alpine: make sure /dev/shm is world writeable
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:50:28 -05:00
Shuai Zhang
b588716468 fix wrong nlmsg_len
nlmsg_len is the length of message including header.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:48:25 -05:00
Stéphane Graber
a6ee12772a
Fix nbd partition id test
Reported-by: David Binderman
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-26 16:40:04 -05:00
Abin Shahab
7c5b6e7c35 Remounts bind mounts if read-only flag is provided
Bind mounts do not honor filesystem mount options. This change will
remount filesystems that are bind mounted if there are changes to
filesystem mount options, specifically if the mount is readonly.

Signed-off-by: Abin Shahab <ashahab@altiscale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-26 10:33:54 -05:00
KATOH Yasufumi
fb26e957f1 doc: change "-t" option of lxc-create(1) to being required
* fix "reg" to "req" in English (fix for commit b8683fe)
* change "opt" to "req" in Japanese

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-26 10:33:25 -05:00
Johannes Kastl
3e892287ba lxc-opensuse: Check if given argument is a valid release
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-25 14:32:14 -05:00
Johannes Kastl
0ce7569856 lxc-opensuse: Added explanation on how to use the template
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:31:59 -05:00
Johannes Kastl
2e7a16a5a5 lxc-opensuse: template now understands release arguments
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:31:48 -05:00
KATOH Yasufumi
3726cda21a doc: Update kernel and cgroup info in Japanese lxc(7)
Update for commit 0dcbd62

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:05:14 -05:00
Silvio Fricke
b8683fefa9 lxc-create -t option is not optional
Closes: #355

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 22:46:50 -05:00
謝致邦
6bfb727c4b Fix lxc-centos.in typo.
Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:41:38 -05:00
謝致邦
cd2738c457 Fix lxc-openmandriva.in typo.
Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:40:23 -05:00
Petar Koretic
c33bdec826 openwrt: add common configuration file
This adds OpenWrt common config file.

Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
CC: Luka Perkov <luka.perkov@sartura.hr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:36:17 -05:00
Serge Hallyn
6b41056280 lxc-cirros: support creating+running unprivileged
Support creation and use of lxc-cirros by unprivileged users.

If we detect we are an unprivileged user, then insist that we
be in a userns with a id mapping.

If we are in a userns, then don't extract /dev when extracting
the rootfs.

If we are not root, then save the tarball to ~/.cache/lxc/cirros
instead of /var/cache/lxc/cirros.

If we are not roo, then include entries to auto-mount proc and sys,
as well as bind-mount devices.

Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:32:00 -05:00
Joel Nider
a589434ecf conf.c: change 'instanciate' to 'instantiate'
This is a multipart message in MIME format.

Fixes a small (but consistent) spelling mistake in conf.c

Signed-off-by: Joel Nider <joeln@il.ibm.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:20:56 -05:00
Serge Hallyn
d52f2fd374 lxc_info: flush stdout before calling routines which may fork
Otherwise both resulting takss will print what they had flushed when they
exit.

This fixes https://bugs.launchpad.net/bugs/1389244

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:14:55 -05:00
Dwight Engen
4086cea56d lua: fix return value of attach() method
Add simple test case for attach() method. Add assert for return value
from create() method which also returns a boolean.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:13:58 -05:00
Stéphane Graber
0dcbd62472 Fix the lxc manpage a bit
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:10:01 -05:00
TAMUKI Shoichi
6df4f94574 lxc-plamo: mount tmpfs on /dev/shm
Do mkdir $rootfs/dev/shm and then mount tmpfs on /dev/shm.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:07:08 -05:00
Antonio Terceiro
a9bf60bab5 lxc-debian: support systemd as PID 1
Containers with systemd need a somewhat special setup, which I borrowed
and adapted from lxc-fedora. These changes are required so that Debian 8
(jessie) containers work properly, and are a no-op for previous Debian
versions.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:06:52 -05:00
hallyn
80cf8077b3 Merge pull request #358 from silvio/sfr/bugfix-freed-return-value
lxc/utils: bugfix freed pointer return value
2014-11-20 17:37:51 -06:00
Silvio Fricke
a1c9a9c978 lxc/utils: bugfix freed pointer return value
We allocate a pointer and save this address in a static variable. After
this we freed this pointer and return.

Here a cuttout of a valgrind report:

	[...]
	==11568== Invalid read of size 1
	==11568==    at 0x4C2D524: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==11568==    by 0x5961C9B: puts (in /usr/lib/libc-2.20.so)
	==11568==    by 0x400890: main (lxc_config.c:73)
	==11568==  Address 0x6933e21 is 1 bytes inside a block of size 32 free'd
	==11568==    at 0x4C2B200: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==11568==    by 0x4E654F2: lxc_global_config_value (utils.c:415)
	==11568==    by 0x4E92177: lxc_get_global_config_item (lxccontainer.c:2287)
	==11568==    by 0x400883: main (lxc_config.c:71)
	[...]

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2014-11-19 18:14:27 +01:00
hallyn
40580b4624 Merge pull request #356 from silvio/sfr/utils-choose-init
lxc/utils: improve choose_init code readability
2014-11-18 09:07:45 -06:00
Dwight Engen
845cbe1e78 Merge pull request #353 from ashtoreth/master
added container:attach() into the Lua API
2014-11-17 11:48:36 -05:00
Silvio Fricke
370ec268c2 lxc/utils: improve choose_init code readability
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2014-11-12 09:17:25 +01:00
ashtoreth
2f64d63144 Update core.c
fixed indent and vars
2014-11-08 16:04:32 +02:00
PiXy
ed70d07839 added container:attach() into the Lua API 2014-11-07 11:04:42 +02:00
Gu1
5d20559cff lxc-debian: Fix default mirrors
Fix a typo in the lines inserted in the default sources.list.
Change the default mirror to http.debian.net which is (supposedly) more
accurate and better than cdn.debian.net for a generic configuration.
Use security.debian.org directly for the {release}/updates repository.

Signed-off-by: Gu1 <gu1@aeroxteam.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-06 13:41:02 -05:00
KATOH Yasufumi
ac00e8f254 Fix clone issues
This commit fixes two issues at the time of clone:
* unnecessary directory is created when clone between overlayfs/aufs
* clone failed when the end of rootfs path is not "/rootfs"

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-05 15:37:17 +01:00
Serge Hallyn
5d9dd3d8f7 cgmanager: fix 'attach' with "all" controller support
"all" is not a supported keyword for cgmanager's get_pid_cgroup.
Pass the first mounted cgroup subsystem instead of passing "all" when
getting the container's cgorup to attach to.

Also, make sure that the target cgroup is in fact in all identical
cgroups before attaching with 'all".  If not, then we must attach to
each cgroup separately, or else we will not be in all the same cgroups
as the target container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-02 16:59:26 -05:00
KATOH Yasufumi
7fb1bef22a overlayfs: overlayfs.v22 or higher needs workdir option
This patch creates workdir as "olwork", and retry mount with workdir
option when mount is failed.
It is used to prepare files before atomically swithing with
destination, and needs to be on the same filesystem as upperdir. It's
OK for it to be empty.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-10-30 20:33:17 -05:00
Serge Hallyn
62183f1af7 attach: don't ignore sigint/sigkill if stdin is redirected
If attach is being done over passed-in fds, then we shouldn't
mess with the caller's signal table to ignore ctrl-c over the
fd.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-10-29 11:23:02 -04:00