- 16 Jul, 2013 4 commits
-
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
John McFarlane authored
This commit increases the default timeout used by lxc-start-ephemeral from 5 to 10, and adds support for an LXC_IP_TIMEOUT override. Patchset 2: - Previous patch used a command line arg. Signed-off-by:
John McFarlane <john@rockfloat.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Otherwise (a) there is a memory leak when using user namespaces and clearing a config, and (b) saving a container configuration file doesn't maintain the userns mapping. For instance, if container c1 has lxc.id_map configuration entries, then python3 import lxc c=lxc.Container("c1") c.save_config("/tmp/config1") should show 'lxc.id_map =' entries in /tmp/config1. Changelog for v2: 1. fix incorrect saving of group types (s/'c'/'g') 2. fix typo -> idmap->type should be idmap->idtype Reported-by:Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Dwight Engen <dwight.engen@oracle.com> Tested-by:
Dwight Engen <dwight.engen@oracle.com>
-
- 15 Jul, 2013 1 commit
-
-
Serge Hallyn authored
Define a sha1sum_file() function in utils.c. Use that in lxcapi_create to write out the sha1sum of the template being used. If libgnutls is not found, then the template sha1sum simply won't be printed into the container config. This patch also trivially fixes some cases where SYSERROR is used after a fclose (masking errno) and missing consts in mkdir_p. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 12 Jul, 2013 4 commits
-
-
Serge Hallyn authored
Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
If set, then fds 0,1,2 will be redirected while the creation template is executed. Note, as Dwight has pointed out, if fd 0 is redirected, then if templates ask for input there will be a problem. We could simply not redirect fd 0, or we could require that templates work without interaction. I'm assuming here that we want to do the latter, but I'm open to changing that. Reported-by:
"S.Çağlar Onur" <caglar@10ur.org> Acked-by:
Stéphane Graber <stgraber@ubuntu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
zoolook authored
lxc-clone ignores size subfixes (K, M, G) when using -L parameter. The following is a quick patch to allow, for example, lxc-clone -L 10G. Signed-off-by:
Norberto Bensa <nbensa@gmail.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 11 Jul, 2013 3 commits
-
-
Serge Hallyn authored
3.10 kernel comes with proper hierarchical enforcement of devices cgroup. To keep that code somewhat sane, certain things are not allowed. Switching from default-allow to default-deny and vice versa are not allowed when there are children cgroups. (This *could* be simplified in the kernel by checking that all child cgroups are unpopulated, but that has not yet been done and may be rejected) The mountcgroup hook causes lxc-start to break with 3.10 kernels, because you cannot write 'a' to devices.deny once you have a child cgroup. With this patch, (a) lxcpath is passed to hooks, (b) the cgroup mount hook sets the container's devices cgroup, and (c) setup_cgroup() during lxc startup ignores failures to write to devices subsystem if we are already in a child of the container's new cgroup. ((a) is not really related to this bug, but is definately needed. The followup work of making the other hooks use the passed-in lxcpath is still to be done) Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
1. If no template is passed in, then do not try to execute it. The user just wanted to write the configuration. 2. If template is passed in as a full path, then use that instead of constructing '$templatedir/lxc-$template'. Reported-by:
Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Make it its own function to make both more readable. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 10 Jul, 2013 4 commits
-
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
This hook script updates the hostname in various files under /etc in the cloned container. In order to do so, the old container name is passed in the LXC_SRC_NAME environment variable. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Michael H. Warfield authored
Hey all! Patch for the Fedora template. Several things... 1) A month or so ago, I floated an idea of adding an option for utsname which Serge seemed to like but we let it float for more feedback (none came). 2) In private mail to Serge and Stéphane I mentioned the idea of using the CPE (Common Platform Enumeration) for host distro and version identification. I heard back from Serge but not Stéphane. CPE is a standard promoted by NIST and Mitre (along with CVE and CVSS) as part of the security community as a common identification mechanism. It's supported by RedHat based distros and many others (notable exception Ubuntu). I've patched the Fedora template to parse first the /etc/os-release file or, alternatively, the /etc/system-release-cpe file for the distro ID and version instead of the human readable /etc/redhat-release. There's more that can be done with that in the realm of cross distro container builds, I suspect. 3) At the time of working on 1&2 I noticed that the retry logic in the Fedora template just didn't seem right. I believe I posted a message asking for clarification on that behavior. A recently post in the -users list indicating that someone could not create a Fedora 19 container (because the release ver string was 19-2 and the template was only looking for -1) prompted me to rework the retry logic for handling the mirror list and servers as well as revamp the download logic to properly identify the correct release package. The patch for all of the above is attached below the jump. It's been tested on Fedora 17 through Fedora 19 hosts and has created containers for F11, F12, F13, F14, F16, F17, F18, and F19. F15 failed for rpm dependency issues that are not worth fixing (IMHO). Regards, Mike -- Michael H. Warfield (AI4NB) | (770) 985-6132 | mhw@WittsEnd.com /\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/ NIC whois: MHW9 | An optimist believes we live in the best of all PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it! -- Signed-off-by:
Michael H. Warfield <mhw@WittsEnd.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
I noticed that if find_first_wholeword() is called with word at the very beginning of p, we will deref *(p - 1) to see if it is a word boundary. Fix by considering p = p0 to be a word boundary. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 09 Jul, 2013 1 commit
-
-
Stéphane Graber authored
Just add an extra white line to both templates. Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
- 08 Jul, 2013 5 commits
-
-
Stéphane Graber authored
The new openssh uses a different mechanism to start/stop the daemon which in turn requires a few tweaks in our template to deal with both the new and old ways of doing that. Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Stéphane Graber authored
The introduction of the new console() python API broke lxc-start-ephemeral's console(tty=1) call, I now changed that to console() which does the right thing with both API versions. This also adds a new storage-type option, letting the user choose to use a standard directory instead of tmpfs for the container (but still have it ephemeral). Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Stéphane Graber authored
It turns out that most API users want some kind of timeout option for get_ips, so instead of re-implementing it in every single client software, let's just have it as a python overlay upstream. Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Dwight Engen authored
Commit a0a2066d introduced an lxc subdir into the lxc-init path, but this was never reflected in the sshd template. Add it there. Don't have ssh-keygen ask for passphrase since host keys are not supposed to use them. Don't try to symlink kmsg since /dev is bind mounted readonly. Read-only bind mount some extra /etc directories, and sysfs which are needed by dhclient on Fedora and Oracle Linux. Fix mounting of /proc. Find sshd in more places by adding some common paths to $PATH, and use the found path to it instead of hardcoded /usr/sbin. Check for ifconfig command, and print out container's IP address. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 03 Jul, 2013 1 commit
-
-
Bogdan Purcareata authored
Signed-off-by:
Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 01 Jul, 2013 3 commits
-
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
commit 829dd918 added parsing of a -c argument to both the common options handling and to lxc-start. It is not a common option, and should have only been added to lxc-start. Because the common code is processing it, no other command can use -c. Remove -c from being processed by the common code. Tested that -c still works with lxc-start. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
unlikely as a failure may be... Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 28 Jun, 2013 1 commit
-
-
Natanael Copa authored
Use sed to set the specified alpine release in the copied /etc/apk/repositories Signed-off-by:
Natanael Copa <ncopa@alpinelinux.org> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 27 Jun, 2013 4 commits
-
-
Kaarle Ritvanen authored
Signed-off-by:
Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Kaarle Ritvanen authored
pick random server from mirror list use the latest stable release Signed-off-by:
Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Andrew Gilbert authored
lxc-netstat now only processes an -n argument if it has not previously received a value for $name from --name or -n. If it _has_ received such a value, it stops processing arguments and leaves the -n for netstat. This does not apply to the use of --name after a name has been provided by --name or -n; the current behaviour continues. The new behaviour makes netstat -n <container> -n -a behave like netstat -n <container> -a -n which already will act as though there is '--' between '<container>' and '-a' (see line 91 of lxc-netstat.in). Signed-off-by:
Andrew Gilbert <andrewg800@gmail.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Andrew Gilbert authored
When lxc-netstat was called by lxc-unshare, it would be given the arguments intended for netstat from the first invocation, but without anything to separate them from the arguments intended for lxc-netstat. This meant that netstat arguments like -n would result in lxc-netstat trying to process them. Signed-off-by:
Andrew Gilbert <andrewg800@gmail.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 24 Jun, 2013 2 commits
-
-
Serge Hallyn authored
In the best case we'll get errors about failing to remove it. In the worst case we'll be trying to delete the original container's rootfs. Reported-by:
zoolook <nbensa+lxcusers@gmail.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
When updating container names in hook files during a container clone, we substitute the new container name for the old any time the old name shows up as a separate word. This patch adds the four characters '.,_-' as additional delimiters. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 19 Jun, 2013 1 commit
-
-
Stéphane Graber authored
The timeout option in get_ips has been deprecated, so work around it. Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
- 18 Jun, 2013 1 commit
-
-
Serge Hallyn authored
The reason is that the generic code which handles reading lxc.rootfs.mount always frees the old value if not NULL. So without this setting lxc.rootfs.mount = /mnt causes segfault. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 13 Jun, 2013 1 commit
-
-
Serge Hallyn authored
Currently due to some safety checks for !rootfs.path, lxc-execute works ok if you do not set lxc.rootfs at all in your lxc.conf. But if you set lxc.rootfs = '/', then it sets up console, and when you do an lxc-execute, the console appears hung. However the lxc.rootfs NULL check was just incidental to not dereference a NULL pointer. In fact we should not be setting up a console if the container isn't running a full-fledged distro with a getty/login running on the container's /dev/console. Have lxc_execute() mark in lxc_conf that this is a lxc-execute and not an lxc-start, and don't set up the console. The issue is documented at https://sourceforge.net/p/lxc/bugs/67/ . Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Dwight Engen <dwight.engen@oracle.com>
-
- 12 Jun, 2013 2 commits
-
-
Dwight Engen authored
Add a higher level console API that opens a tty/console and runs the mainloop as well. Rename existing API to console_getfd(). Use these in the python binding. Allow attaching a console peer after container bootup, including if the container was launched with -d. This is made possible by allocation of a "proxy" pty as the peer when the console is attached to. Improve handling of SIGWINCH, the pty size will be correctly set at the beginning of a session and future changes when using the lxc_console() API will be propagated to it as well. Refactor some common code between lxc_console.c and console.c. The variable wait4q (renamed to saw_escape) was static, making the mainloop callback not safe across threads. This wasn't a problem when the callback was in the non-threaded lxc-console, but now that it is internal to console.c, we have to take care of it. This is now contained in a per-tty state structure. Don't attempt to open /dev/null as the console peer since /dev/null cannot be added to the mainloop (epoll_ctl() fails with EPERM). This isn't needed to get the console setup (and the log to work) since the case of not having a peer at console init time has to be handled to allow for attaching to it later. Move signalfd libc wrapper/replacement to utils.h. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Natanael Copa authored
The 'lxc-init' (a lightweight init process used by lxc-execute in place of upstart etc) tries to mount /dev/mqueue during startup. If that fails (for instance due to missing support for mqueue in kernel) then it aborts execution and returns -1. This is unreasonable as very few applications actually need /dev/mqueue. This similar to what we do with /dev/shm. Signed-off-by:
Natanael Copa <ncopa@alpinelinux.org> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 11 Jun, 2013 1 commit
-
-
Serge Hallyn authored
Currently the lxc API mutexes configuration file read/writes with a lock called $lxcpath/locks/$lxcname. This fails if the container is on a rofs. This patch moves those locks under /run/lock/lxc. The $lxcpath/$lxcname/partial file is not moved - if you can't create it, you probably can't create the container either. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 10 Jun, 2013 1 commit
-
-
Serge Hallyn authored
I originally forgot to set ret = 0 if it succeeded, meaning that a simple 'lxc-stop -n container1' returns failure even though the stop succeeded. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-