Re: [lxc-devel] segfault with insufficient network config

2010-07-22 Thread Ferenc Wagner
Daniel Lezcano writes: > On 07/22/2010 09:44 PM, Ferenc Wagner wrote: > >> # lxc-execute --name net -s lxc.network.type=phys -s lxc.network.link=eth0 >> bash >> lxc-execute: failed to move 'eth0' to the container : Message too long >> >> It might a

[lxc-devel] segfault with insufficient network config

2010-07-22 Thread Ferenc Wagner
Hi, $ lxc-execute --name net -s lxc.network.type=phys bash Segmentation fault (core dumped) The problem is that the netdev structure is mostly uninitialized (only its type is set to LXC_NET_PHYS), so if_nametoindex() is invoked with a NULL argument: static int instanciate_phys(struct lxc_netdev

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-07-19 Thread Ferenc Wagner
Daniel Lezcano writes: > On 07/15/2010 10:07 PM, Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> On 06/09/2010 07:56 PM, Ferenc Wagner wrote: >>> >>>> here are basically the same patches, with some obvious errors corrected

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-07-15 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/09/2010 07:56 PM, Ferenc Wagner wrote: > >> here are basically the same patches, with some obvious errors corrected >> and some unrelated documentation added. It actually survived some >> targeted testing in the past days and seems t

Re: [lxc-devel] security considerations when running lxc as non-root

2010-07-02 Thread Ferenc Wagner
Daniel Lezcano writes: > The lxc tools can be run as non-root with all the needed capabilities > set by lxc-setcap via the file capabilities. The command run by lxc > won't have these privileges of course. I've always regarded such setups as a root shell by design, as it lets any user mount a fi

Re: [lxc-devel] security considerations when running lxc as non-root

2010-07-01 Thread Ferenc Wagner
Daniel Lezcano writes: > "... If you can't permanently give up the privilege, then you can at > least temporarily drop the privilege as often as possible. [...] > Many attacks only work if they trick the privileged program into doing > something unintended while its privileges are enabled (for e

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-16 Thread Ferenc Wagner
atp writes: >>> Interestingly, it stays in S state until >>> I kill the container. I'm afraid the console functionality (is there >>> any documentation for it?) may make lxc-start unsuitable for pushing >>> into the background. After all, it is an interactive foreground process >>> in that case,

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-15 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/15/2010 02:13 PM, Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> On 06/10/2010 11:47 PM, Ferenc Wagner wrote: >>> >>>> If you provide me with an example (and some description of >>>>

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-15 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/10/2010 11:47 PM, Ferenc Wagner wrote: > >> If you provide me with an example (and some description of >> lxc.console), I can give it some testing and concretize this pure >> guesswork. > > lxc-create -n ubuntu -f ~/mynetwork.conf -t u

[lxc-devel] [PATCH 2/2] correct template directory documentation

2010-06-15 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- doc/lxc-create.sgml.in | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/lxc-create.sgml.in b/doc/lxc-create.sgml.in index 5505eea..f3e8524 100644 --- a/doc/lxc-create.sgml.in +++ b/doc/lxc-create.sgml.in @@ -65,7 +65,8

[lxc-devel] [PATCH 0/2] some cleanup around lxc-create

2010-06-15 Thread Ferenc Wagner
Hi, I had a go against lxc-create trying to debug the console issue. There is still a serious issue: the template scripts use some 'arch' binary, which isn't present on my system. What is that? Why not use 'uname -m' instead? Thanks, Feri. Ferenc Wagner (2): rem

[lxc-devel] [PATCH 1/2] remove misleading copy&paste comment

2010-06-15 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/lxc-create.in |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index ee5173e..16011ab 100644 --- a/src/lxc/lxc-create.in +++ b/src/lxc/lxc-create.in @@ -20,11 +20,6 @@ # License

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-10 Thread Ferenc Wagner
Ferenc Wagner writes: > I admittedly didn't test running lxc-start in the background, but it > blocks SIGTTOU, so it should be unaffected... Thinking again, maybe we could turn the table and change the process group ID of lxc-start instead, thereby putting it into the backgroun

Re: [lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-10 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/09/2010 07:56 PM, Ferenc Wagner wrote: > >> here are basically the same patches, with some obvious errors corrected >> and some unrelated documentation added. It actually survived some >> targeted testing in the past days and seems t

Re: [lxc-devel] [PATCH 1/5] start child in its own process group, and put it into the foreground

2010-06-10 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/09/2010 07:56 PM, Ferenc Wagner wrote: > >> @@ -509,6 +510,22 @@ int lxc_spawn(struct lxc_handler *handler) >> } >> } >> >> +if (setpgid(handler->pid, 0)) { >> +SYSERROR("failed t

[lxc-devel] [PATCH 2/2] fix comment

2010-06-10 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/conf.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 5968882..66c60a8 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -547,7 +547,7 @@ static int setup_rootfs_pivot_root(const char

[lxc-devel] [PATCH 0/2] change pivotdir and its documentation

2010-06-10 Thread Ferenc Wagner
Hi, The documentation part of this depends on my previous rootfs documentation patch. Cheers, Feri. Ferenc Wagner (2): change pivotdir default to mnt fix comment doc/lxc.conf.sgml.in |2 +- src/lxc/conf.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions

[lxc-devel] [PATCH 1/2] change pivotdir default to mnt

2010-06-10 Thread Ferenc Wagner
The mnt directory has a good chance to already exist in the new root filesystem, so creation and removal can be avoided. This also eases use of read only root filesystems (no configuration necessary). Signed-off-by: Ferenc Wagner --- doc/lxc.conf.sgml.in |2 +- src/lxc/conf.c |2

Re: [lxc-devel] [PATCH 1/5] start child in its own process group, and put it into the foreground

2010-06-09 Thread Ferenc Wagner
Matt Helsley writes: > On Wed, Jun 09, 2010 at 07:56:03PM +0200, Ferenc Wagner wrote: > >> Signed-off-by: Ferenc Wagner >> --- >> src/lxc/start.c | 17 + >> 1 files changed, 17 insertions(+), 0 deletions(-) >> >> diff --git a/

[lxc-devel] [PATCH 5/5] document rootfs options

2010-06-09 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- doc/lxc.conf.sgml.in | 39 +++ 1 files changed, 35 insertions(+), 4 deletions(-) diff --git a/doc/lxc.conf.sgml.in b/doc/lxc.conf.sgml.in index 1305849..6c98714 100644 --- a/doc/lxc.conf.sgml.in +++ b/doc/lxc.conf.sgml.in

[lxc-devel] [PATCH 2/5] lxc-start isn't in the foreground anymore, so TTY signals don't reach it

2010-06-09 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c |9 - src/lxc/utils.h | 29 ++--- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 7bbcf5a..ccd8bcd 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c

[lxc-devel] [PATCH 4/5] generalize the name of the signal handler

2010-06-09 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 8a3e4c4..eac2f85 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -187,7 +187,7 @@ int lxc_check_inherited(int

[lxc-devel] [PATCH 3/5] forward signals to the container init

2010-06-09 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 22 ++ 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index ccd8bcd..8a3e4c4 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -192,13 +192,13 @@ static int

[lxc-devel] [PATCH 1/5] start child in its own process group, and put it into the foreground

2010-06-09 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index b69ac88..7bbcf5a 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -463,6 +463,7 @@ int lxc_spawn(struct

[lxc-devel] [PATCH 0/5] Signal stuff v2 and some documentation

2010-06-09 Thread Ferenc Wagner
forwarding mechanism makes it possible to plug lxc into our batch queueing system. Thanks, Feri. Ferenc Wagner (5): start child in its own process group, and put it into the foreground lxc-start isn't in the foreground anymore, so TTY signals don't reach it forward signals to the c

[lxc-devel] devpts instances

2010-06-07 Thread Ferenc Wagner
Hi, Reading the kernel documentation of devpts, I got the impression that if the host uses the "legacy" devpts mode, root in a container can always mount its devpts instance. Is this really so? If yes, it might be worth noting somewhere near the lxc.pts option. And a kernel option to disable le

Re: [lxc-devel] [PATCH 0/7] Last minute signal stuff (now in separate mails)

2010-06-07 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/07/2010 12:37 PM, Ferenc Wagner wrote: > >> there's another failure I get on my work machine (with my original >> patchset with the above errors corrected): >> >> gcc -I../../src -g -O2 -g -Wall -O2 -Wall -Wl,-E -Wl,-rpath

Re: [lxc-devel] [PATCH 0/7] Last minute signal stuff (now in separate mails)

2010-06-07 Thread Ferenc Wagner
Daniel Lezcano writes: > On 06/06/2010 11:07 PM, Ferenc Wagner wrote: > >> The first part is some tinkering to make lxc compile under Debian Lenny. >> >> The "dangerous" part is the signal forwarding and the process group >> business I was playing with

[lxc-devel] [PATCH 5/7] lxc-start isn't in the foreground anymore, so TTY signals don't reach it

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c |9 - src/lxc/utils.h | 27 --- 2 files changed, 0 insertions(+), 36 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 851d383..ee79892 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c

[lxc-devel] [PATCH 7/7] generalize the name of the signal handler

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index b8ccd31..23f148e 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -187,7 +187,7 @@ int lxc_check_inherited(int

[lxc-devel] [PATCH 3/7] .gitignore new components

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- .gitignore |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 83979f9..ce56094 100644 --- a/.gitignore +++ b/.gitignore @@ -25,10 +25,12 @@ lxc.spec lxc.pc scripts/lxc-debian +scripts/lxc-ubuntu scripts

[lxc-devel] [PATCH 1/7] conditional use of new capabilities

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/conf.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 3d550a7..9565d91 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -170,8 +170,12 @@ static struct caps_opt caps_opt

[lxc-devel] [PATCH 4/7] start child in its own process group, and put it into the foreground

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index b69ac88..851d383 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -463,6 +463,7 @@ int lxc_spawn(struct

[lxc-devel] [PATCH 2/7] uint32_t is defined in stdint.h

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 2d45396..b69ac88 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -49,6 +49,7 @@ # include #else /* assume kernel headers

[lxc-devel] [PATCH 6/7] forward signals to the container init

2010-06-06 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/start.c | 22 ++ 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index ee79892..b8ccd31 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -192,13 +192,13 @@ static int

[lxc-devel] [PATCH 0/7] Last minute signal stuff (now in separate mails)

2010-06-06 Thread Ferenc Wagner
selection logic. Which means it's only slightly tested in its present form, but I wanted to get this out of the door ASAP, so you can get an idea what I'm up to. I'll continue testing it tomorrow and will followup with the results. Regards, Feri. Ferenc Wagner (7): condi

[lxc-devel] [PATCH 0/7] Last minute signal stuff

2010-06-06 Thread Ferenc Wagner
selection logic. Which means it's only slightly tested in its present form, but I wanted to get this out of the door ASAP, so you can get an idea what I'm up to. I'll continue testing it tomorrow and will followup with the results. Regards, Feri. Ferenc Wagner (7): condi

Re: [lxc-devel] releasing 0.6.6 soon

2010-05-28 Thread Ferenc Wagner
Daniel Lezcano writes: > I will release a 0.6.6 version. > > If someone noticed a bug or has a patch to send, please let me know > before I put a tag. I'd really like to see some sort of signal forwarding in lxc-start, and waiting for feedback whether it's OK to reverse the logic (ie. don't cat

Re: [lxc-devel] lxc-unshare woes and signal forwarding in lxc-start

2010-05-26 Thread Ferenc Wagner
Daniel Lezcano writes: > On 05/13/2010 02:22 PM, Ferenc Wagner wrote: > >> I attached a proof-of-concept patch which seems to work good enough for >> me. The function names are somewhat off now, but I leave that for later > > do you have definitive version for this ? >

Re: [lxc-devel] "use defined rootfs mount point" regression?

2010-05-26 Thread Ferenc Wagner
Daniel Lezcano writes: > On 05/21/2010 02:20 PM, Nathan Lynch wrote: > >> On Fri, 2010-05-21 at 09:56 +0200, Daniel Lezcano wrote: >> >>> On 05/20/2010 10:40 PM, Nathan Lynch wrote: >>> lxc-execute: No such file or directory - failed to access to '/usr/lib64/lxc', check it is

Re: [lxc-devel] "use defined rootfs mount point" regression?

2010-05-21 Thread Ferenc Wagner
Daniel Lezcano writes: > On 05/21/2010 11:14 AM, Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> On 05/20/2010 10:40 PM, Nathan Lynch wrote: >>> >>>> lxc-execute: No such file or directory - failed to access to >>>

Re: [lxc-devel] "use defined rootfs mount point" regression?

2010-05-21 Thread Ferenc Wagner
Daniel Lezcano writes: > On 05/20/2010 10:40 PM, Nathan Lynch wrote: > >> lxc-execute: No such file or directory - failed to access to >> '/usr/lib64/lxc', check it is present >> lxc-execute: failed to set rootfs for 'truetest-19794' >> lxc-execute: failed to setup the container >> >> /usr/lib64

Re: [lxc-devel] lxc-unshare woes and signal forwarding in lxc-start

2010-05-13 Thread Ferenc Wagner
Daniel Lezcano writes: > Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> Ferenc Wagner wrote: >>> >>>> Daniel Lezcano writes: >>>> >>>>> Ferenc Wagner wrote: >>>>>

Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-13 Thread Ferenc Wagner
"Michael H. Warfield" writes: > On Wed, 2010-05-12 at 23:18 +0200, Daniel Lezcano wrote: > >> Ferenc Wagner wrote: >> >>> Daniel Lezcano writes: >>> >>>> Ferenc Wagner wrote: >>>> >>>>> Daniel Lezcano w

Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-13 Thread Ferenc Wagner
Daniel Lezcano writes: > Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> Ferenc Wagner wrote: >>> >>>> Daniel Lezcano writes: >>>> >>>>> Ferenc Wagner wrote: >>>>> &g

Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-12 Thread Ferenc Wagner
Daniel Lezcano writes: > Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> Ferenc Wagner wrote: >>> >>>> Actually, I'm not sure you can fully solve this. If rootfs is a >>>> separate file system, this is only mu

[lxc-devel] [PATCH 2/2] fix typos in error messages

2010-05-12 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner --- src/lxc/conf.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 6d9b6b0..4d0223e 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -468,7 +468,7 @@ static int setup_rootfs_pivot_root(const char

[lxc-devel] [PATCH 1/2] remove pivotdir only if it was created by us

2010-05-12 Thread Ferenc Wagner
The removal does not account for possible leading path components that were also created during creation of pivotdir. Signed-off-by: Ferenc Wagner --- src/lxc/conf.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 2b8ddf4

Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-11 Thread Ferenc Wagner
Daniel Lezcano writes: > Ferenc Wagner wrote: > >> Daniel Lezcano writes: >> >>> We can't simply remove it because of the pivot_root which returns >>> EBUSY. I suppose it's coming from: "new_root and put_old must not >>> be o

Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-10 Thread Ferenc Wagner
Daniel Lezcano writes: > Ferenc Wagner wrote: > >> Ferenc Wagner writes: >> >>> Daniel Lezcano writes: >>> >>>> Ferenc Wagner wrote: >>>> >>>>> Daniel Lezcano writes: >>>>> >>>>&