Re: [lxc-devel] [PATCH] templates: abort if name is not specified

2013-03-31 Thread Ryota Ozaki
Hi Serge, On Mon, Apr 1, 2013 at 12:32 PM, Serge Hallyn wrote: > Quoting Ryota Ozaki (ozaki.ry...@gmail.com): >> Most scripts don't check if required parameter 'name' is >> specified and proceed without it, which results in using an >> unexpected directory /var/lib/lxc/ while we expect >> to use

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
OK here it is https://github.com/caglar10ur/lxc-upstream sorry about the malformed text... On Mon, Apr 1, 2013 at 12:13 AM, S.Çağlar Onur wrote: > Yeah I realized that, I'll send the github url in a moment > > > On Mon, Apr 1, 2013 at 12:12 AM, Serge Hallyn wrote: > >> Quoting S.Çağlar Onur (

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
Yeah I realized that, I'll send the github url in a moment On Mon, Apr 1, 2013 at 12:12 AM, Serge Hallyn wrote: > Quoting S.Çağlar Onur (cag...@10ur.org): > > Seems like I sent the wrong path, this one works for me. > > note your emails are coming through as html and malformed txt, which > will

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
Please use this version instead, this fixes the destroy for a container with only config, tested with following script; caglar@qgq:~/Project$ sudo python3 test.py set True save True create True create False destroy True destroy False set True save True destroy True caglar@qgq:~/Project$ cat test.

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread Serge Hallyn
Quoting S.Çağlar Onur (cag...@10ur.org): > Seems like I sent the wrong path, this one works for me. note your emails are coming through as html and malformed txt, which will be harder to apply. Would you mind posting a github url? The lxc-destroy modifications make me a bit uneasy, but they shou

Re: [lxc-devel] [PATCH] Make lxc.functions return the default lxcpath if /etc/lxc/lxc.conf doesn't provide one

2013-03-31 Thread Serge Hallyn
Quoting S.Çağlar Onur (cag...@10ur.org): > From: "S.Çağlar Onur" > > Currently it returns the default path only if /etc/lxc/lxc.conf missing. > Since default lxc.conf doesn't contain lxcpath variable (this is at least the > case in ubuntu) all tools fails if one doesn't give -P > > caglar@qgq:~

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread Serge Hallyn
Quoting S.Çağlar Onur (cag...@10ur.org): > What about something like following? This looks good to me. Acked-by: Serge E. Hallyn > diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c > index 480c4f5..eb99e5a 100644 > --- a/src/lxc/lxccontainer.c > +++ b/src/lxc/lxccontainer.c > @@ -508

[lxc-devel] [PATCH] Make lxc.functions return the default lxcpath if /etc/lxc/lxc.conf doesn't provide one

2013-03-31 Thread S . Çağlar Onur
From: "S.Çağlar Onur" Currently it returns the default path only if /etc/lxc/lxc.conf missing. Since default lxc.conf doesn't contain lxcpath variable (this is at least the case in ubuntu) all tools fails if one doesn't give -P caglar@qgq:~/Project/lxc/examples$ sudo /usr/bin/lxc-create -n test

Re: [lxc-devel] [PATCH 2/2] lxc-attach: Implement --clear-env and --keep-env

2013-03-31 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > This patch introduces the --clear-env and --keep-env options for > lxc-attach, that allows the user to specify whether the environment > should be passed on inside the container or not. > > This is to be expanded upon in later versions, this patch o

Re: [lxc-devel] [PATCH 1/2] lxc-shutdown: Make all processes exit before timeout if shutdown works

2013-03-31 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > The following rationale is for using the -t option: > > Currently, lxc-shutdown uses a subprocess for the timeout handling, > where a 'sleep $TIMEOUT' is executed, which will kill the main process > after the timeout has occurred, thus causing the m

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
Seems like I sent the wrong path, this one works for me. diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 480c4f5..9ed3443 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -523,14 +523,15 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *cons

Re: [lxc-devel] [PATCH] templates: abort if name is not specified

2013-03-31 Thread Serge Hallyn
Quoting Ryota Ozaki (ozaki.ry...@gmail.com): > Most scripts don't check if required parameter 'name' is > specified and proceed without it, which results in using an > unexpected directory /var/lib/lxc/ while we expect > to use /var/lib/lxc/NAME/. ISTM that check is present in lxc-create, so it sh

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
What about something like following? diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 480c4f5..eb99e5a 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -508,7 +508,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[]) int len, n

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
Hi Stéphane, Hmm, then I believe there is another bug somewhere cause here is what happens with your ordering; caglar@qgq:~/Project/lxc$ sudo python3 Python 3.2.3 (default, Oct 19 2012, 19:53:16) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> impo

[lxc-devel] [PATCH 1/1] lxc-create: require absolute path for non-standard templates

2013-03-31 Thread Serge Hallyn
Otherwise, as an example, if doing 'lxc-create -t debian' while there is a 'debian' directory, lxc-create will fail to do the right thing. Signed-off-by: Serge Hallyn --- src/lxc/lxc-create.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc

Re: [lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread Stéphane Graber
On 03/31/2013 04:22 PM, S.Çağlar Onur wrote: > From: "S.Çağlar Onur" > > Currently it behaves like following which might be confusing for the code > that checks the return value of those calls to determine whether operation > completed successfully or not. > >>> c = lxc.Container("r") c.c

[lxc-devel] [PATCH] API shouldn't be calling create for already defined containers or destroy for non defined ones.

2013-03-31 Thread S . Çağlar Onur
From: "S.Çağlar Onur" Currently it behaves like following which might be confusing for the code that checks the return value of those calls to determine whether operation completed successfully or not. >> c = lxc.Container("r") >>> c.create("ubuntu") True >>> c.create("ubuntu") True >>> c.crea

[lxc-devel] [PATCH] templates: abort if name is not specified

2013-03-31 Thread Ryota Ozaki
Most scripts don't check if required parameter 'name' is specified and proceed without it, which results in using an unexpected directory /var/lib/lxc/ while we expect to use /var/lib/lxc/NAME/. Signed-off-by: Ryota Ozaki --- templates/lxc-altlinux.in | 5 + templates/lxc-busybox.in