- 25 May, 2013 2 commits
-
-
Dwight Engen authored
There were several memory leaks in the cgroup functions, notably in the success cases. The cgpath test program was refactored and additional tests added to it. It was used in various modes under valgrind to test that the leaks were fixed. Simplify lxc_cgroup_path_get() and cgroup_path_get by having them return a char * instead of an int and an output char * argument. The only return values ever used were -1 and 0, which are now handled with NULL and non-NULL returns respectively. Use consistent variable names of cgabspath when refering to an absolute path to a cgroup subsystem or file, and cgrelpath when refering to a container "group/name" within the cgroup heirarchy. Remove unused subsystem argument to lxc_cmd_get_cgroup_path(). Remove unused #define MAXPRIOLEN Make template arg to lxcapi_create() const Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
This fixes the build of lxccontainer.c on systems that have __NR_setns but not HAVE_SETNS. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 23 May, 2013 1 commit
-
-
Stéphane Graber authored
The recent port of get_ips() from pure python to the C API came with a couple of API changes for that function call (as were highlighted in the commit message). I somehow didn't notice that lxc-ls was still calling with the old API and so was crashing whenever it was asked to show the ipv4 or ipv6 address. Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
- 22 May, 2013 5 commits
-
-
Michael H. Warfield authored
This is just some minor changes in the way the Fedora template is synthesizing the target rootfs_path. Currently, the template uses a path with the container in it twice like this: /var/lib/lxc/rasputin/rasputin/rootfs This happens because the container name is already contained in the "path" and the template appends it a second time. This changes the logic to be congruent with other templates such as lxc-arch. The new behavior will be to create the rootfs like this: /var/lib/lxc/rasputin/rootfs Attached below the jump. 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
sem_open(3) checks that /dev/shm is SHMFS_SUPER_MAGIC. Normally /dev/shm is mounted in the initramfs created by dracut, but that won't be run for a container so make sure that rc.sysinit mounts /dev/shm. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Realistically (as Dwight points out) it doesn't seem possible that getline won't return at least one line in this functions, however just to make absolutely sure we don't get a segv on free(NULL), check line != NULL before freeing it on exit. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 21 May, 2013 3 commits
-
-
Dwight Engen authored
lxccontainer.c:874:4: error: ‘for’ loop initial declarations are only allowed in C99 mode Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Dwight Engen authored
Motivation for this change is to have the ability to get the run-time configuration items from a container, which may differ from its current on disk configuration, or might not be available any other way (for example lxc.network.0.veth.pair). In adding this ability it seemed there was room for refactoring improvements. Genericize the command infrastructure so that both command requests and responses can have arbitrary data. Consolidate all commands into command.c and name them consistently. This allows all the callback routines to be made static, reducing exposure. Return the actual allocated tty for the console command. Don't print the init pid in lxc_info if the container isn't actually running. Command processing was made more thread safe by removing the static buffer from receive_answer(). Refactored command response code to a common routine. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Stéphane Graber authored
This adds a new get_ips call which takes a family (inet, inet6 or NULL), a network interface (or NULL for all) and a scope (0 for global) and returns a char** of all the IPs in the container. This also adds a matching python3 binding (function result is a tuple) and deprecates the previous pure-python get_ips() implementation. WARNING: The python get_ips() call is quite different from the previous implementation. The timeout argument has been removed, the family names are slightly different (inet/inet6 vs ipv4/ipv6) and an extra scope parameter has been added. Signed-off-by:
Stéphane Graber <stgraber@ubuntu.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
- 20 May, 2013 7 commits
-
-
Christian Seiler authored
Signed-off-by:
Christian Seiler <christian@iwakd.de> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Christian Seiler authored
Signed-off-by:
Christian Seiler <christian@iwakd.de> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Christian Seiler authored
Signed-off-by:
Christian Seiler <christian@iwakd.de> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Christian Seiler authored
Signed-off-by:
Christian Seiler <christian@iwakd.de> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Michael H. Warfield authored
Hey all... Patch to the lxc-fedora template to setup gettys on the ttys that are enabled in the configuration. The area of the code already had some modifications to that service that didn't seem to do anything and would get wiped out by an update. I commented that out but subsumed the change it was attempting into my command in case it does something on another rev somewhere. This is very similar to the logic in the OpenSuse template but doesn't seem to appear in other templates, such as arch, which have to deal with systemd. This isn't unique to Fedora. The templates for Fedora, ArchLinux, and OpenSuse are the only three that seem to have any reference to systemd at all. Attached below the jump. 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
Doing a get_config_item for lxc.network.0.veth.pair only returns the pair name if explicitly given, but it can be useful to know the name even if it is the one that lxc autogenerated. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 17 May, 2013 1 commit
-
-
Serge Hallyn authored
Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
- 16 May, 2013 5 commits
-
-
Serge Hallyn authored
Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Add a clone hook called from api_clone. Pass arguments to it from lxc_clone.c. The clone update hook is called while the container's bdev is mounted. Information about the container is passed in through environment variables LXC_ROOTFS_PATH, LXC_NAME, The LXC_ROOTFS_MOUNT, and LXC_CONFIG_FILE. LXC_ROOTFS_MOUNT=/usr/lib/x86_64-linux-gnu/lxc LXC_CONFIG_FILE=/var/lib/lxc/demo3/config LXC_ROOTFS_PATH=/var/lib/lxc/demo3/rootfs LXC_NAME=demo3 So from the hook, updates to the container should be made under $LXC_ROOTFS_MOUNT/ . The hook also receives command line arguments as follows: First argument is container name, second is always 'lxc', third is the hook name (always clone), then come the arguments which were passed to lxc-clone. I.e. when I did: sudo lxc-clone demo2 demo3 -- hey there dude the arguments passed in were "demo3 lxc clone hey there dude" I personally would like to drop the first two arguments. The name is available as $LXC_NAME, and the section argument ('lxc') is meaningless. However, doing so risks invalidating existing hooks. Soon analogous create and destroy hooks will be added as well. Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
-
Serge Hallyn authored
When starting a container, we walk through all cgroup mounts looking for a unique directory name we can use for this container. If the name we are trying is in use, we try another name. If it is not in use in the first mount we check, we need to check other hierarchies as it may exist there. But we weren't checking whether we have already checked a subsystem - so that if freezer was mounted twice, we would create it in the first mount, see it exists in the second, so start over trying in the second mount. To fix this, keep track of which subsystems we have already checked, and do not re-check. (See http://pad.lv/1176287 for a bug report) Note we still need to add, at the next: label, the removal of the directories we've already created. I'm keeping that for later as it's far lower priority than this fix, and I don't want to risk introducing a regression for that. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
This allows some special cgroup items such as memory.kmem.limit_in_bytes to be successfully set, since they must be set before any task is put into the cgroup. The devices cgroup is setup later giving the container a chance to mount file systems before the device it might want to mount from becomes unavailable. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 15 May, 2013 2 commits
-
-
Michael H. Warfield authored
This took a lot longer for me to get around to it... Sorry. Patch to the lxc-fedora template. I didn't get any further comments from my earlier proposal, weeks ago, and did get one addition based on comments about properly setting the hostname in /etc/hostname, which I've added. I could have broken them into separate patches but most are pretty small and minor. Changes: * Map armv6l and armv7l architectures to "arm" for yum and repos to function properly. * Detect Fedora Remix distros with no "/etc/fedora-release" file (Raspberry Pi) and find proper release versions when "remix" part of the file context. * Change default Fedora container on non-Fedora hosts to Fedora 17. * Added code for autodev for Fedora systemd containers. * Added code to set /etc/hostname for Fedora > 14 (systemd). * Fix a few typos. 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>
-
Bogdan Purcareata authored
The patch removes the behavior of automatically mounting /lib and /usr/lib, since this is duplicated a few lines below. It will also remove the risk of failing when one of these entries are not present on the host - e.g. on a 64bit machine. Signed-off-by:
Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 14 May, 2013 2 commits
-
-
Serge Hallyn authored
fix userdata consumption patch for console issue Signed-off-by:
Scott Moser <scott.moser@canonical.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
Add a template to create a cirros container. One great thing about cirros is that the image you download is 3.5M. Thanks smoser! Note by default /etc/inittab doesn't have a /dev/console entry, so you don't get a login on the lxc-start console. Adding console::respawn:/sbin/getty 115200 console makes that work, but ctrl-c still gets forwarded to init which then reboots. So I didn't bother adding console as part of the template (yet). Instead I simply lxc-start -d, then lxc-console. Signed-off-by:
Scott Moser <scott.moser@canonical.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 13 May, 2013 1 commit
-
-
Dwight Engen authored
The problem is that the fd table is shared between threads and if a thread forks() while another thread has an open fd to the monitor, the duped fd in the fork()ed child will not get closed, thus causing monitord to stay around since it thinks it still has a client. This only happened when calling lxcapi_start() in the daemonized case since that is the only time we try to get the status from the monitor. Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 09 May, 2013 1 commit
-
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 08 May, 2013 2 commits
-
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Serge Hallyn authored
A few months ago cgroup handling in lxc was updated so that if /sys/fs/cgroup/$cgroup/lxc/$container already exists (most often due to another container by the same name under a different lxcpath), then /sys/fs/cgroup/$cgroup/lxc/${container}-N would be used. lxc-ps was never updated to handle this. Fix that. (Note, the ns cgroup is being special cased there, but I don't really believe ns cgroup works any more.) It would be preferable to rewrite lxc-ps in python or in C, but this at least makes the basic lxc-ps work in the case of multiple containers with the same name. Changelog: fix missing fi. replace 'z1' with '$container' as pointed out by Christian Signed-off-by:Serge Hallyn <serge.hallyn@ubuntu.com>
-
- 07 May, 2013 8 commits
-
-
Serge Hallyn authored
commit ab81cef0 meant to remove the added break, but apparently i had not done 'git add' before commit --amend. Remove the added break. Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
-
Dwight Engen authored
also break once we have found root, no need to search the rest of the mounts Changelog: May 6: Serge: don't add the break. (see m-l) Signed-off-by:
Dwight Engen <dwight.engen@oracle.com> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
-