Re: [lxc-devel] [RFC] Systemd, lxc-console, and ttys!

2013-05-20 Thread Michael H. Warfield
On Sun, 2013-05-19 at 15:59 -0400, Michael H. Warfield wrote: > This may not be necessary after all. Looks like there's a way to modify > the getty@.service configuration and override the default to get systemd > to fire up agetty on the containers ttys that could be implemented in > the lxc-fedor

Re: [lxc-devel] [PATCH 1/3] lxc-shutdown: switch from script to program using api.

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi there, > > > So my suggestion is basically to: > > - Kill lxc-shutdown > > - Change lxc-stop so that: > >* Default behaviour is to call shutdown(), wait 15s for STOPPED, if > > not STOPPED, print a message to the user and call stop() > >

Re: [lxc-devel] [PATCH] return lxc generated name for veth pair

2013-05-20 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > 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 Acked-by: Serge E. Hallyn

Re: [lxc-devel] [PATCH 1/3] lxc-shutdown: switch from script to program using api.

2013-05-20 Thread Christian Seiler
Hello Serge, > Ok, I've got no objection to this, but if I decide to do this before > resending the patch I won't get around to it for quite some time. I'll > push a github tree with a simpler consolidated patch, and if you have > time to implement the above in a branch based on what I push, plea

[lxc-devel] [PATCH 3/5] Move declarations of some constants to where they are needed.

2013-05-20 Thread Christian Seiler
Signed-off-by: Christian Seiler --- src/lxc/bdev.h | 26 ++ src/lxc/conf.c | 24 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/lxc/bdev.h b/src/lxc/bdev.h index cc03592..d69efd8 100644 --- a/src/lxc/bdev.h +++ b/src/lxc/b

[lxc-devel] [PATCH 1/5] wait_for_pid: Fix EINTR check

2013-05-20 Thread Christian Seiler
Signed-off-by: Christian Seiler --- src/lxc/utils.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index be1ce88..cf42c38 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -255,7 +255,7 @@ int wait_for_pid(pid_t pid) again:

[lxc-devel] [PATCH 4/5] Implement simple utility functions for reading and writing to fds

2013-05-20 Thread Christian Seiler
Signed-off-by: Christian Seiler --- src/lxc/utils.c | 35 +++ src/lxc/utils.h |5 + 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 66bd19d..cd35e00 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c

[lxc-devel] [PATCH] [RFC] Complete rewrite of lxc-attach functionality

2013-05-20 Thread Christian Seiler
Hi, as discussed previously on this list, I've reimplemented the lxc-attach functionality as an API function. The patchset consists of two parts: 1. Four minor patches that just fix some bugs, shuffle definitions around and implement some small utility functions that I need for the attac

[lxc-devel] [PATCH 2/5] utils.c: Add lxc_wait_for_pid_status routine that returns exit code

2013-05-20 Thread Christian Seiler
Signed-off-by: Christian Seiler --- src/lxc/utils.c | 16 src/lxc/utils.h |3 +++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index cf42c38..66bd19d 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -265,3 +265,19 @@

[lxc-devel] [PATCH 5/5] lxc-attach: Completely rework lxc-attach and move to API function

2013-05-20 Thread Christian Seiler
- Move attach functionality to a completely new API function for attaching to containers. The API functions accepts the name of the container, the lxcpath, a structure indicating options for attaching and returns the pid of the attached process. The calling thread may then use waitpid(

Re: [lxc-devel] [PATCH] [RFC] Complete rewrite of lxc-attach functionality

2013-05-20 Thread Christian Seiler
Hi again, Oh, I forgot, I've also added the patches to my github tree, you can find them in the branch: https://github.com/chris-se/lxc/tree/attach-rewrite -- Christian -- AlienVault Unified Security Management (USM) pl

[lxc-devel] [PATCH] lxc-fedora template - systemd console gettys

2013-05-20 Thread Michael H. Warfield
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

Re: [lxc-devel] [PATCH 4/5] Implement simple utility functions for reading and writing to fds

2013-05-20 Thread Dwight Engen
Hi Christian, These routines will be good to have. I think your names are fine, but thought I'd point that out that there seems to be some sort of convention in other projects I've seen to name them safe_read(), safe_write(). They are usually accompanied by full_read() and full_write() which handl

[lxc-devel] [PATCH 1/3] lxc-stop: use api, remove lxc_shutdown, extend lxc-stop functionality

2013-05-20 Thread Serge Hallyn
[ Christian: this should be a good starting point for adding the lxc.signal.{halt,reboot,kill}, etc. If you don't have time, I'll get back to looking at that later. Thanks! ] implement c->reboot(c) in the api. Also if the container is not running, return -2. Currently lxc-stop will return 0, s

[lxc-devel] [PATCH 2/3] destroy: implement in the api

2013-05-20 Thread Serge Hallyn
This requires implementing bdev->ops->destroy() for each of the backing store types. Then implementing lxcapi_clone(), writing lxc_destroy.c using the api, and removing the lxc-destroy.in script. (this also has a few other cleanups, like marking some functions static) Changelog: fold int

Re: [lxc-devel] [PATCH 1/3] lxc-stop: use api, remove lxc_shutdown, extend lxc-stop functionality

2013-05-20 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com): > [ Christian: this should be a good starting point for adding the > lxc.signal.{halt,reboot,kill}, etc. If you don't have time, I'll > get back to looking at that later. Thanks! ] Oh, this patchset is at git://github.com/hallyn/lxc branch s.f.api6

Re: [lxc-devel] [PATCH 1/3] lxc-stop: use api, remove lxc_shutdown, extend lxc-stop functionality

2013-05-20 Thread Christian Seiler
Hi, > [ Christian: this should be a good starting point for adding the > lxc.signal.{halt,reboot,kill}, etc. If you don't have time, I'll > get back to looking at that later. Thanks! ] Will do that in the next few days. > Also if the container is not running, return -2. Currently > lxc-stop w

[lxc-devel] [PATCH 4/5 v2] Implement simple utility functions for reading and writing to fds

2013-05-20 Thread Christian Seiler
Hi, > These routines will be good to have. I think your names are fine, but > thought I'd point that out that there seems to be some sort of > convention in other projects I've seen to name them safe_read(), > safe_write(). They are usually accompanied by full_read() and > full_write() which handl

Re: [lxc-devel] [PATCH 1/5] wait_for_pid: Fix EINTR check

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Signed-off-by: Christian Seiler Acked-by: Serge E. Hallyn > --- > src/lxc/utils.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/lxc/utils.c b/src/lxc/utils.c > index be1ce88..cf42c38 100644 > --- a/src/lxc/u

Re: [lxc-devel] [PATCH 2/5] utils.c: Add lxc_wait_for_pid_status routine that returns exit code

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Signed-off-by: Christian Seiler Acked-by: Serge E. Hallyn > --- > src/lxc/utils.c | 16 > src/lxc/utils.h |3 +++ > 2 files changed, 19 insertions(+), 0 deletions(-) > > diff --git a/src/lxc/utils.c b/src/lxc/utils.c > in

Re: [lxc-devel] [PATCH 3/5] Move declarations of some constants to where they are needed.

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Signed-off-by: Christian Seiler Acked-by: Serge E. Hallyn > --- > src/lxc/bdev.h | 26 ++ > src/lxc/conf.c | 24 > 2 files changed, 26 insertions(+), 24 deletions(-) > > diff --git a/src/lxc/

Re: [lxc-devel] process number limit

2013-05-20 Thread Robert Gierzinger
Hi, >> Is there anything planned to restrict exhaustive process generation in a >> guest or any other means to defend against fork bombs? > In recent kernels (such as 3.9.x) you have > `memory.kmem.limit_in_bytes` which could be use for that purpose. > see > https://git.kernel.org/cgit/linux/kerne

Re: [lxc-devel] [PATCH 4/5] Implement simple utility functions for reading and writing to fds

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Signed-off-by: Christian Seiler Acked-by: Serge E. Hallyn > --- > src/lxc/utils.c | 35 +++ > src/lxc/utils.h |5 + > 2 files changed, 40 insertions(+), 0 deletions(-) > > diff --git a/src/lxc/utils.c b

Re: [lxc-devel] [PATCH] lxc-fedora template - systemd console gettys

2013-05-20 Thread Serge Hallyn
Quoting Michael H. Warfield (m...@wittsend.com): > 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 b

Re: [lxc-devel] [PATCH] lxc-fedora template - systemd console gettys

2013-05-20 Thread Michael H. Warfield
On Mon, 2013-05-20 at 13:43 -0500, Serge Hallyn wrote: > Quoting Michael H. Warfield (m...@wittsend.com): > > 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

[lxc-devel] Question about a "real" LXC library

2013-05-20 Thread Jon Taylor
Hi, I was initially working with libvirt, but all I was doing was calling out to lxc so I decided to ditch libvirt and work directly with LXC since the current libvirt is a bit buggy for me. To that end, I have been playing with and studying LXC, and I have a question. I was wondering why liblxc

Re: [lxc-devel] [PATCH 5/5] lxc-attach: Completely rework lxc-attach and move to API function

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > - Move attach functionality to a completely new API function for >attaching to containers. The API functions accepts the name of the >container, the lxcpath, a structure indicating options for attaching >and returns the pid of the attach

Re: [lxc-devel] [PATCH 5/5] lxc-attach: Completely rework lxc-attach and move to API function

2013-05-20 Thread Christian Seiler
Hi Serge, > Note though when I was talking about putting attach "into the API", > I meant by that adding a lxcapi_attach() function to struct > lxc_container in src/lxc/lxccontainer.{c,h} that python/go/lua can > then call into. That should be trivial to do on top of what you have > here. Were y

Re: [lxc-devel] [PATCH 5/5] lxc-attach: Completely rework lxc-attach and move to API function

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi Serge, > > > Note though when I was talking about putting attach "into the API", > > I meant by that adding a lxcapi_attach() function to struct > > lxc_container in src/lxc/lxccontainer.{c,h} that python/go/lua can > > then call into. That shou

[lxc-devel] [PATCH] lxcapi: Add new get_ips() call

2013-05-20 Thread Stéphane Graber
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-py

Re: [lxc-devel] [PATCH] [RFC] Complete rewrite of lxc-attach functionality

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi, > > as discussed previously on this list, I've reimplemented the lxc-attach > functionality as an API function. The patchset consists of two parts: > > 1. Four minor patches that just fix some bugs, shuffle definitions > around and impleme

Re: [lxc-devel] [PATCH] lxc-fedora template - systemd console gettys

2013-05-20 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com): > Quoting Michael H. Warfield (m...@wittsend.com): > > 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

Re: [lxc-devel] [PATCH] [RFC] Complete rewrite of lxc-attach functionality

2013-05-20 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi, > > as discussed previously on this list, I've reimplemented the lxc-attach > functionality as an API function. The patchset consists of two parts: > > 1. Four minor patches that just fix some bugs, shuffle definitions > around and impleme

Re: [lxc-devel] [PATCH] extend command processor to handle generic data

2013-05-20 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > 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).

Re: [lxc-devel] [PATCH] [RFC] Complete rewrite of lxc-attach functionality

2013-05-20 Thread Christian Seiler
Hi Serge, >>This is due to user namespaces. The patch introduces a flat > > And pid ns right? Otherwise the task which did setns would look > funky inside the container. iiuc. Yes, of course. > I think d). Create a new attach_struct.h which you #include from both > lxccontainer.h and att

Re: [lxc-devel] [PATCH] lxcapi: Add new get_ips() call

2013-05-20 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > 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 (functi