Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 8:07 PM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> On Mon, Sep 29, 2014 at 4:36 PM, Eric W. Biederman >> wrote: >> > Andy Lutomirski writes: >> > >> >> On Mon, Sep 29, 2014 at 4:22 PM, Eric W. Biederman >> >> wrote: >> >>> Andy Lutomirski w

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Serge Hallyn
Quoting Andy Lutomirski (l...@amacapital.net): > On Mon, Sep 29, 2014 at 4:36 PM, Eric W. Biederman > wrote: > > Andy Lutomirski writes: > > > >> On Mon, Sep 29, 2014 at 4:22 PM, Eric W. Biederman > >> wrote: > >>> Andy Lutomirski writes: > >>> > To me, this smells like MNT_DETACH does som

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 4:36 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> On Mon, Sep 29, 2014 at 4:22 PM, Eric W. Biederman >> wrote: >>> Andy Lutomirski writes: >>> To me, this smells like MNT_DETACH does something awful when there are mounts under the detached mount.

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Eric W. Biederman
Andy Lutomirski writes: > On Mon, Sep 29, 2014 at 4:22 PM, Eric W. Biederman > wrote: >> Andy Lutomirski writes: >> >>> To me, this smells like MNT_DETACH does something awful when there are >>> mounts under the detached mount. >>> >>> For example: >>> >>> mount --rbind / /mnt >>> umount -l /mn

Re: [lxc-devel] [PATCH] pivot_root: umount ., not /

2014-09-29 Thread Michael H. Warfield
On Mon, 2014-09-29 at 18:56 -0400, Stéphane Graber wrote: > On Mon, Sep 29, 2014 at 10:51:35PM +, Serge Hallyn wrote: > > This fixes pivot_root on 3.11 and older kernels. > > > > Signed-off-by: Serge Hallyn > Got to love one char bugfixes :) +1 > Acked-by: Stéphane Graber > > > --- > >

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 4:22 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> To me, this smells like MNT_DETACH does something awful when there are >> mounts under the detached mount. >> >> For example: >> >> mount --rbind / /mnt >> umount -l /mnt >> >> does *not* end well on my syste

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Eric W. Biederman
Andy Lutomirski writes: > To me, this smells like MNT_DETACH does something awful when there are > mounts under the detached mount. > > For example: > > mount --rbind / /mnt > umount -l /mnt > > does *not* end well on my system. I find it hard to believe that this > behavior is intentional. Hmm

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 4:13 PM, Andy Lutomirski wrote: > On Mon, Sep 29, 2014 at 4:07 PM, Eric W. Biederman > wrote: >> Andy Lutomirski writes: >> >>> On Mon, Sep 29, 2014 at 3:46 PM, Serge Hallyn >>> wrote: Quoting Andy Lutomirski (l...@amacapital.net): > On Mon, Sep 29, 2014 at 2:4

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 4:07 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> On Mon, Sep 29, 2014 at 3:46 PM, Serge Hallyn >> wrote: >>> Quoting Andy Lutomirski (l...@amacapital.net): On Mon, Sep 29, 2014 at 2:46 PM, Serge Hallyn wrote: I'm not sure that "/" is well

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Eric W. Biederman
Andy Lutomirski writes: > On Mon, Sep 29, 2014 at 3:46 PM, Serge Hallyn wrote: >> Quoting Andy Lutomirski (l...@amacapital.net): >>> On Mon, Sep 29, 2014 at 2:46 PM, Serge Hallyn >>> wrote: >>> I'm not sure that "/" is well-defined. You have oldroot mounted on >> >> Whoa. Seems you're right.

[lxc-devel] [lxc/lxc] 7981ea: pivot_root: umount ., not /

2014-09-29 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 7981ea4684c878fe433d34743073c43bfadb870a https://github.com/lxc/lxc/commit/7981ea4684c878fe433d34743073c43bfadb870a Author: Serge Hallyn Date: 2014-09-29 (Mon, 29 Sep 2014) Changed paths: M src/lxc/conf.c

Re: [lxc-devel] [PATCH] pivot_root: umount ., not /

2014-09-29 Thread Stéphane Graber
On Mon, Sep 29, 2014 at 10:51:35PM +, Serge Hallyn wrote: > This fixes pivot_root on 3.11 and older kernels. > > Signed-off-by: Serge Hallyn Got to love one char bugfixes :) Acked-by: Stéphane Graber > --- > src/lxc/conf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

[lxc-devel] [PATCH] pivot_root: umount ., not /

2014-09-29 Thread Serge Hallyn
This fixes pivot_root on 3.11 and older kernels. Signed-off-by: Serge Hallyn --- src/lxc/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 31673d5..e8979c9 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1062,7 +1062,7 @@ static

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 3:46 PM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> On Mon, Sep 29, 2014 at 2:46 PM, Serge Hallyn >> wrote: >> I'm not sure that "/" is well-defined. You have oldroot mounted on > > Whoa. Seems you're right. I would have expected it to mean

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Serge Hallyn
Quoting Andy Lutomirski (l...@amacapital.net): > On Mon, Sep 29, 2014 at 2:46 PM, Serge Hallyn wrote: > I'm not sure that "/" is well-defined. You have oldroot mounted on Whoa. Seems you're right. I would have expected it to mean precisely the dentry+vfsmount which I pivot-rooted to. Which ha

[lxc-devel] [lxc/lxc] 888cf0: sysconfig/lxc: Reverse sourcing logic

2014-09-29 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 888cf064dd0f10ec834ce7c95d9269653cf8dd2c https://github.com/lxc/lxc/commit/888cf064dd0f10ec834ce7c95d9269653cf8dd2c Author: Stéphane Graber Date: 2014-09-29 (Mon, 29 Sep 2014) Changed paths: M config/sysc

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 2:46 PM, Serge Hallyn wrote: > Quoting Andy Lutomirski (l...@amacapital.net): >> On Mon, Sep 29, 2014 at 1:55 PM, Serge Hallyn >> wrote: >> > Quoting Dwight Engen (dwight.en...@oracle.com): >> >> On Sat, 20 Sep 2014 03:15:44 + >> >> Serge Hallyn wrote: >> >> >> >> >

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Serge Hallyn
Quoting Andy Lutomirski (l...@amacapital.net): > On Mon, Sep 29, 2014 at 1:55 PM, Serge Hallyn wrote: > > Quoting Dwight Engen (dwight.en...@oracle.com): > >> On Sat, 20 Sep 2014 03:15:44 + > >> Serge Hallyn wrote: > >> > >> > This idea came from Andy Lutomirski. Instead of using a > >> > te

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Serge Hallyn
Quoting Andy Lutomirski (l...@amacapital.net): > My previous attachment works on 3.2, and I didn't even fix the umount2 call. Are you sure? It fails for me. That is, the program works, but then doing 'mount --bind /mnt /mnt' fails. ___ lxc-devel mailin

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 2:06 PM, Andy Lutomirski wrote: > On Mon, Sep 29, 2014 at 1:55 PM, Serge Hallyn wrote: >> Quoting Dwight Engen (dwight.en...@oracle.com): >>> On Sat, 20 Sep 2014 03:15:44 + >>> Serge Hallyn wrote: >>> >>> > This idea came from Andy Lutomirski. Instead of using a >>>

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Andy Lutomirski
On Mon, Sep 29, 2014 at 1:55 PM, Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): >> On Sat, 20 Sep 2014 03:15:44 + >> Serge Hallyn wrote: >> >> > This idea came from Andy Lutomirski. Instead of using a >> > temporary directory for the pivot_root put-old, use "." both >>

Re: [lxc-devel] [PATCH 1/1] pivot_root: switch to a new mechanism (v2)

2014-09-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Sat, 20 Sep 2014 03:15:44 + > Serge Hallyn wrote: > > > This idea came from Andy Lutomirski. Instead of using a > > temporary directory for the pivot_root put-old, use "." both > > for new-root and old-root. Then fchdir into the old root

Re: [lxc-devel] [PATCH] add file/func/line to debug info

2014-09-29 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Mon, Sep 29, 2014 at 04:14:28PM +, Serge Hallyn wrote: > > > > Signed-off-by: Serge Hallyn > > I wonder if we should have some kind of way to prevent this information > from showing up for some cases, possibly adding a new log level called

[lxc-devel] [lxc/lxc] 15bc51: add file/func/line to debug info

2014-09-29 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 15bc516ea987be2fa3c085010d2e77a32820769c https://github.com/lxc/lxc/commit/15bc516ea987be2fa3c085010d2e77a32820769c Author: Serge Hallyn Date: 2014-09-29 (Mon, 29 Sep 2014) Changed paths: M src/lxc/log.c

Re: [lxc-devel] Haskell LXC API bindings

2014-09-29 Thread Stéphane Graber
On Sun, Sep 28, 2014 at 11:38:37AM +0400, Nickolay Kudasov wrote: > Hello, list! > > I am pleased to announce Haskell LXC API bindings. > Bindings are represented by 2 cabal packages: lxc > and bindings-lxc >

Re: [lxc-devel] [PATCH] add file/func/line to debug info

2014-09-29 Thread Stéphane Graber
On Mon, Sep 29, 2014 at 04:14:28PM +, Serge Hallyn wrote: > > Signed-off-by: Serge Hallyn I wonder if we should have some kind of way to prevent this information from showing up for some cases, possibly adding a new log level called "HELP" which when used won't log the timestamp or anything

[lxc-devel] [lxc/lxc] 0af993: Rework init scripts

2014-09-29 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 0af993195cbd57cff700c7c90ee8f95c2a1ef8aa https://github.com/lxc/lxc/commit/0af993195cbd57cff700c7c90ee8f95c2a1ef8aa Author: Michael H. Warfield Date: 2014-09-26 (Fri, 26 Sep 2014) Changed paths: M config/

Re: [lxc-devel] [PATCH v2 on top of Rework init scripts] fixups to init script rework

2014-09-29 Thread Stéphane Graber
On Fri, Sep 26, 2014 at 03:21:51PM -0400, Dwight Engen wrote: > - move action() from common to sysvinit wrapper since its only really > applicable for sysvinit and not the other init systems > > - fix bug in action() fallback, need to shift away msg before executing action > > - make lxc-net 98

[lxc-devel] [PATCH] add file/func/line to debug info

2014-09-29 Thread Serge Hallyn
Signed-off-by: Serge Hallyn --- src/lxc/log.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lxc/log.c b/src/lxc/log.c index e3c64ee..0fe376c 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -72,6 +72,7 @@ static int log_append_stderr(const struct lxc_log_appe

Re: [lxc-devel] Nested namespaces

2014-09-29 Thread Jean-Tiare LE BIGOT
Cgroups and Namespaces are two completely different mechanism of the Linux kernel. Cgroups is for resource isolation while Namespaces are for kernel datastructure isolation. In other words, unsharing a namespace will have no impact on cgroups: all child processes are added to current cgroup

[lxc-devel] [PATCH 9/9] lxc-device: rewrite lxc-device.

2014-09-29 Thread Dongsheng Yang
As there is a function named attach_interface to pass a interface to container now, we do not need to relay on python impolementation for lxc-device any more. Signed-off-by: Dongsheng Yang --- src/lxc/Makefile.am | 4 +- src/lxc/lxc-device | 97 - src/lxc/lxc_de

[lxc-devel] [PATCH 6/9] utils: move useful helper functions from lxccontainer to utils.

2014-09-29 Thread Dongsheng Yang
Function of enter_to_ns() is useful but currently is static for lxccontainer.c. This patch split it into two parts named as switch_to_newuser() and switch_to_newnet() into utils.c. Signed-off-by: Dongsheng Yang --- src/lxc/lxccontainer.c | 54 +++---

Re: [lxc-devel] [PATCH 6/9] utils: move useful helper functions from lxccontainer to utils.

2014-09-29 Thread Dongsheng Yang
oops, forgot --in-reply-on . Please ignore this one. On 09/29/2014 03:08 PM, Dongsheng Yang wrote: Function of enter_to_ns() is useful but currently is static for lxccontainer.c. This patch split it into two parts named as switch_to_newuser() and switch_to_newnet() into utils.c. Signed-off-by:

[lxc-devel] [PATCH 7/9] container: introduce two functions named as {at/de}tach_interface().

2014-09-29 Thread Dongsheng Yang
Currently, we depends on ip command to attach interface to container. It means we only implemented it by python. This patch implement adding and removing interface by c and added them in struct container. Signed-off-by: Dongsheng Yang --- src/lxc/lxccontainer.c | 88

[lxc-devel] [PATCH 7/9] container: introduce two functions named as {at/de}tach_interface().

2014-09-29 Thread Dongsheng Yang
Currently, we depends on ip command to attach interface to container. It means we only implemented it by python. This patch implement adding and removing interface by c and added them in struct container. Signed-off-by: Dongsheng Yang --- src/lxc/lxccontainer.c | 88

[lxc-devel] [PATCH 6/9] utils: move useful helper functions from lxccontainer to utils.

2014-09-29 Thread Dongsheng Yang
Function of enter_to_ns() is useful but currently is static for lxccontainer.c. This patch split it into two parts named as switch_to_newuser() and switch_to_newnet() into utils.c. Signed-off-by: Dongsheng Yang --- src/lxc/lxccontainer.c | 54 +++---

[lxc-devel] [PATCH 5/9] network: introduce a interface named lxc_netdev_isup().

2014-09-29 Thread Dongsheng Yang
When we need to know some info about a netdev, such as is_up or not, we need to read the flag for the netdev. This patch introduce a interface function named lxc_netdev_isup() to check is a netdev up or down. And introduce a network private function named netdev_get_flag() to get flag for netdev