- 24 Sep, 2014 2 commits
-
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Andre Nathan authored
Signed-off-by:
Andre Nathan <andre@digirati.com.br> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 23 Sep, 2014 3 commits
-
-
Stéphane Graber authored
Reported-by:
NeilGreenwood <neil.greenwood@gmail.com> Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
To cover all the cases we have around, we need to: - Attempt to use cgm if present (preferred) - Attempt to use cgmanager directly over dbus otherwise - Fallback to cgroupfs Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
KATOH Yasufumi authored
Signed-off-by:
KATOH Yasufumi <karma@jazz.email.ne.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 22 Sep, 2014 7 commits
-
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Bill Kolokithas authored
Signed-off-by:
Bill Kolokithas <kolokithas.b@gmail.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Jean-Tiare LE BIGOT authored
Signed-off-by:
Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Jean-Tiare LE BIGOT authored
When "lxc.autodev = 1", LXC creates automatically a "/dev/.lxc/<name>.<hash>" folder to put container's devices in so that they are visible from both the host and the container itself. On container exit (ne it normal or not), this folder was not cleaned which made "/dev" folder grow continuously. We fix this by adding a new `int lxc_delete_autodev(struct lxc_handler *handler)` called from `static void lxc_fini(const char *name, struct lxc_handler *handler)`. Signed-off-by:
Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
Explain why we insist that root use newuidmap if it is available. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
If we didn't find newuidmap, then simply require the caller to be root and write to /proc/self/uidmap manually. Checking for newgidmap to exist is bogus. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Masami Ichikawa authored
This patch fixes following build errors. running build_ext building '_lxc' extension creating build/temp.linux-x86_64-3.4 gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -I../../src -I../../src -I/usr/include/python3.4m -c lxc.c -o ./build/temp.linux-x86_64-3.4/lxc.o lxc.c: In function ‘convert_tuple_to_char_pointer_array’: lxc.c:49:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char **result = (char**) calloc(argc + 1, sizeof(char*)); ^ lxc.c:60:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char *str = NULL; ^ lxc.c: In function ‘Container_get_cgroup_item’: lxc.c:822:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char* value = (char*) malloc(sizeof(char)*len + 1); ^ lxc.c: In function ‘Container_get_config_item’: lxc.c:861:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char* value = (char*) malloc(sizeof(char)*len + 1); ^ lxc.c: In function ‘Container_get_keys’: lxc.c:903:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char* value = (char*) malloc(sizeof(char)*len + 1); ^ cc1: some warnings being treated as errors error: command 'gcc' failed with exit status 1 Makefile:472: recipe for target 'all' failed make[3]: *** [all] Error 1 make[3]: Leaving directory '/home/masami/codes/lxc/src/python-lxc' Makefile:394: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/home/masami/codes/lxc/src' Makefile:338: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/home/masami/codes/lxc/src' Makefile:484: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 build env: distribution: Arch Linux gcc version 4.9.1 20140903 (prerelease) (GCC) Signed-off-by:Masami Ichikawa <masami256@gmail.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 20 Sep, 2014 12 commits
-
-
William Dauchy authored
quiet mode was overriden by the double call of lxc_log_init see lxc_container_new use lxc_log_options_no_override in order to fix this Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by:
William Dauchy <william@gandi.net>
-
Serge Hallyn authored
Introduce a new list of controllers just containing "all". Make the lists of controllers null-terminated. If the cgmanager api version is high enough, use the 'all' controller rather than walking all controllers, which should greatly reduce the amount of dbus overhead. This will be especially important for those going through a cgproxy. Also remove the call to cleanup cgroups when a cgroup existed. That usually fails (and failure is ignored) since the to-be-cleaned-up cgroup is busy, but we shouldn't even be trying. Note this can create for extra un-cleanedup cgroups, however it's better than us accidentally removing a cgroup that someone else had created and was about to use. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
TAMUKI Shoichi authored
Call tar with --numeric-owner option to use numbers for user/group names because the whole uid/gid in rootfs should be consistently unchanged as in original stage3 tarball and private portage. Signed-off-by:
TAMUKI Shoichi <tamuki@linet.gr.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
TAMUKI Shoichi authored
Regardless of whether "installpkg" command exists or not, install the command temporarily with static linked tar command into the lxc cache directory to keep the original uid/gid of files/directories. Also, use sed command instead of ed command for simplicity. Signed-off-by:
TAMUKI Shoichi <tamuki@linet.gr.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Jean-Tiare LE BIGOT authored
When managing containers, I need to take action based on container exit status. For instance, if it exited abnormally (status!=0), I sometime want to respawn it automatically. Or, when invoking `lxc-stop` I want to know if it terminated gracefully (ie on `SIGTERM`) or on `SIGKILL` after a timeout. This patch adds a new message type `lxc_msg_exit_code,` to preserve ABI. It sends the raw status code as returned by `waitpid` so that listening application may want to apply `WEXITSTATUS` before. This is what `lxc-monitor` does. Signed-off-by:Jean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net>
-
Serge Hallyn authored
To ask cgmanager to chown files as an unpriv user, we must send the request from the container's namespace (with our own userid also mapped in). However when we create a new namespace then we must open a new dbus connection, so that our credential and the credential on the dbus socket match. Otherwise the proxy will refuse the request. Because we were warning about this failure but not exiting, the failure was not noticed until the unprivileged container went on to try to administer its cgroups, i.e. creating a container inside itself. Fix this by having the do_chown_cgroup create a new cgmanager connection. In order to reduce the number of connections, since the list of subsystems is global anyway, don't call do_chown_cgroup once for each controller, just call it once and have it run over all controllers. (This patch does not change the fact that we don't fail if the chown failed. I think we should change that, but let's do it in a later patch) Reported-by:
Stéphane Graber <stgraber@ubuntu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
S.Çağlar Onur authored
With the new hashed command socket names (e8589841), it's possible to have something like below; [caglar@qop:~/go/src/github.com/lxc/go-lxc(master)] cat /proc/net/unix | grep lxc 0000000000000000: 00000002 00000000 00010000 0001 01 53465 @lxc/d086e835c86f4b8d/command [...] list_active_containers reads /proc/net/unix to find all running containers but this new format no longer includes the container name or its lxcpath. This patch introduces two new commands (LXC_CMD_GET_NAME and LXC_CMD_GET_LXCPATH) and starts to use those in list_active_containers call. changes since v1: - added sanity check proposed by Serge Signed-off-by:
S.Çağlar Onur <caglar@10ur.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Daniel Miranda authored
distutils can't handle paths to source files containing '..'. It will try to navigate away from the build directory and fail. To fix that, before building the python module, transform all the path variables then cd to the srcdir, and set the build directory manually. This is hopefully the last needed fix to use separate build and source diretories. Signed-off-by:
Daniel Miranda <danielkza2@gmail.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Daniel Miranda authored
Now that default.conf is generated/linked during the configuration phase, it should not longer be removed in the 'clean' stage, or subsequent builds will fail. Only remove it during 'dist-clean'. Signed-off-by:
Daniel Miranda <danielkza2@gmail.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Stéphane Graber authored
Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Denis Pynkin authored
Added check of services in container before start or stop. Added check of syslog config existence prior changing. Signed-off-by:
Denis Pynkin <dans@altlinux.org> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 19 Sep, 2014 12 commits
-
-
Serge Hallyn authored
If statvfs does not exist, then don't recalculate mount flags at remount. If someone does need this, they could replace the code (only if !HAVE_STATVFS) with code parsing /proc/self/mountinfo (which exists in the recent git history) Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
Same problem as we had with mount_entry(). lxc_mount_auto_mounts() sometimes does bind mount followed by remount to change options. With recent kernels it must pass any preexisting NODEV/NOSUID/etc flags. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
Use statvfs instead of parsing /proc/self/mountinfo to check for the flags we need to and into the msbind mount flags. This will be faster and the code is cleaner. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Daniel Miranda authored
Building LXC in a separate target directory, by running configure from outside the source tree, failed with multiple errors, mostly in the Python and Lua extensions, due to assuming the source dir and build dir are the same in a few places. To fix that: - Pre-process setup.py with the appropriate directories at configure time - Introduce the build dir as an include path in the Lua Makefile - Link the default container configuration file from the alternatives in the configure stage, instead of setting a variable and using it in the Makefile Signed-off-by:
Daniel Miranda <danielkza2@gmail.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
This prevents u2 from going into /home/u1/.local/share/lxc/u1/rootfs and running setuid-root applications to get write access to u1's container rootfs. v2: set umask to 002 for the mkdir. Otherwise if umask happens to be, say, 022, then user does not have write permissions under the container dir and creation of $containerdir/partial file will fail. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
S.Çağlar Onur authored
Signed-off-by:
S.Çağlar Onur <caglar@10ur.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
S.Çağlar Onur authored
Unprivileged users require "-o user_subvol_rm_allowed" mount option for btrfs. Make the INFO level message to ERROR to make it clear, which now says following; [caglar@qop:~] lxc-destroy -n rubik lxc_container: Is the rootfs mounted with -o user_subvol_rm_allowed? lxc_container: Error destroying rootfs for rubik Destroying rubik failed Signed-off-by:
S.Çağlar Onur <caglar@10ur.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
TAMUKI Shoichi authored
- If "installpkg" command does not exist, lxc-plamo temporarily install the command with static linked tar command into the lxc cache directory. The tar command does not refer to passwd/group files, which means that only a few files/directories are extracted with wrong user/group ownership. To avoid this, the installpkg command now uses the standard tar command in the system. - Change mode to 666 for $rootfs/dev/null to allow write access for all users. - Small fix in usage message. Signed-off-by:
TAMUKI Shoichi <tamuki@linet.gr.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
KATOH Yasufumi <karma@jazz.email.ne.jp>
-
Serge Hallyn authored
A long enough lxcpath (and small PATH_MAX through crappy defines) can cause the creation of the string to be hashed to fail. So just use alloca to get the size string we need. More importantly, while I can't explain it, if lxcpath is too long, setting sockname[sizeof(addr->sun_path)-2] to \0 simply doesn't seem to work. So set sockname[sizeof(addr->sun_path)-3] to \0, which does work. With this, and with lxc.lxcpath = /opt/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789/lxc0123456789 in /etc/lxc/lxc.conf, I can run lxc-wait just fine. Without it, it fails (as does lxc-start -d, which uses lxc_wait to verify the container started) Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
The container command socket is an abstract unix socket containing the lxcpath and container name. Those can be too long. In that case, use the hash of the lxcpath and lxcname. Continue to use the path and name if possible to avoid any back compat issues. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
KATOH Yasufumi authored
This commit is the same as the commit 18aa217b and 99e616a6 on master branch, except "ALL" keyword. Signed-off-by:
KATOH Yasufumi <karma@jazz.email.ne.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
Those aren't supported, it's just a lucky coincidence that they weren't causing problems. Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
- 18 Aug, 2014 3 commits
-
-
Stéphane Graber authored
This should avoid tests failure when the machine running the tests has either very slow disks or a lot of data waiting to be flushed. Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
See http://lkml.org/lkml/2014/8/13/746 and its history. The kernel now refuses mounts if we don't add ro,nosuid,nodev,noexec flags if they were already there. Also use the newly found info to skip remount if unneeded. For background, if you want to create a read-only bind mount, then you must first mount(2) with MS_BIND to create the bind mount, then re-mount(2) again to get the new mount options to apply. So if this wasn't a bind mount, or no new mount options were introduced, then we don't do the second mount(2). null_endofword() and get_field() were not changed, only moved up in the file. (Note, while I can start containers inside a privileged container with this patch, most of the lxc tests still fail with the kernel in question; Andy's patch seems to still be needed - a kernel with which is available at https://launchpad.net/~serge-hallyn/+archive/ubuntu/userns-natty ppa:serge-hallyn/userns-natty) Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
KATOH Yasufumi authored
Signed-off-by:
KATOH Yasufumi <karma@jazz.email.ne.jp> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 16 Aug, 2014 1 commit
-
-
Stéphane Graber authored
This commit broke the testsuite for unprivileged containers as the container directory is now 0750 with the owner being the container root and the group being the user's group, meaning that the parent user can only enter the directory, not create entries in there. This reverts commit c86da6a3.
-