[lxc-devel] [PATCH 3/4] Add lxc_setup_for_attach function

2012-02-03 Thread Christian Seiler
lxc_setup_for_attach changes the context of the current running process in such a way that it matches that of the container it is supposed to attach to (personality, capabilities). --- src/lxc/conf.c | 16 src/lxc/conf.h |2 ++ 2 files changed, 18 insertions(+), 0 deletions(

[lxc-devel] [PATCH 4/4] lxc-attach: Change cgroup, personality and drop capabilities when attaching to container

2012-02-03 Thread Christian Seiler
lxc-attach is reworked so that it adds the newly attached process to the cgroup of the container, changes the personality of the process to that of the container and drops capabilities to those specified in the container configuration file. The latter can be overridden with a new option that allows

[lxc-devel] [PATCH 2/4] Add lxc_cgroup_attach function

2012-02-03 Thread Christian Seiler
This commit adds the lxc_cgroup_attach function that adds a pid to the tasks file of a specific cgroup in all subsystems. This is required for lxc-attach to be able to put newly started processes in the same cgroup as the container. --- src/lxc/cgroup.c | 47 +

[lxc-devel] [PATCH 1/4] Add missing 'extern' keyword to functions defined in cgroup.h

2012-02-03 Thread Christian Seiler
--- src/lxc/cgroup.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h index 188d948..31dd2de 100644 --- a/src/lxc/cgroup.h +++ b/src/lxc/cgroup.h @@ -26,9 +26,9 @@ #define MAXPRIOLEN 24 struct lxc_handler; -int lxc_cgroup_cre

[lxc-devel] [PATCH] lxc-attach: Consider cgroup, personality and capabilities when attaching processes to a container

2012-02-03 Thread Christian Seiler
Hi, As I didn't hear anything on this issue, I looked at it more closely and found found that not only are capabilities currently not dropped from withing lxc, but also the personality is not set correctly and the newly started process is not put in the correct cgroup (circumventing e.g. device re

Re: [lxc-devel] [PATCH 1/4] Add missing 'extern' keyword to functions defined in cgroup.h

2012-02-03 Thread Michael Tokarev
On 03.02.2012 16:54, Christian Seiler wrote: > --- > src/lxc/cgroup.h | 10 +- > 1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h > index 188d948..31dd2de 100644 > --- a/src/lxc/cgroup.h > +++ b/src/lxc/cgroup.h > @@ -26,9 +26,9 @@ >

Re: [lxc-devel] [PATCH 1/4] Add missing 'extern' keyword to functions defined in cgroup.h

2012-02-03 Thread Christian Seiler
Hi, > Note that "extern" keyword on function declarations has no > effect whatsoever. Yes, but I personally think it's good practice to always put it there, since it doesn't cause any harm either, because otherwise one may forget the keyword with variables, where it really matters. Also, lxc uses