Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-29 Thread Qiang Huang
On 2013/5/24 20:49, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> Hi, >> >> I found a tricky problem in LXC, once I made a mistake in config, set >> >> lxc.cgroup.cpuset.cpus = -1 >> >> ofcourse start would fail, but then "lxc-ls --active" showed the container >> is active

Re: [lxc-devel] Container autostart proposal V2

2013-05-29 Thread Dwight Engen
On Tue, 28 May 2013 21:50:32 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > On Tue, 28 May 2013 17:03:43 -0400 > > Stéphane Graber wrote: > > > > > On 05/28/2013 04:53 PM, Serge Hallyn wrote: > > > > Quoting Stéphane Graber (stgra...@ubuntu.com): > > > >> Hey ev

Re: [lxc-devel] Container autostart proposal V2

2013-05-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Tue, 28 May 2013 21:50:32 -0500 > Serge Hallyn wrote: > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > On Tue, 28 May 2013 17:03:43 -0400 > > > Stéphane Graber wrote: > > > > > > > On 05/28/2013 04:53 PM, Serge Hallyn wrote: > > >

Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-29 Thread Serge Hallyn
Quoting Qiang Huang (h.huangqi...@huawei.com): > On 2013/5/24 20:49, Serge Hallyn wrote: > > Quoting Qiang Huang (h.huangqi...@huawei.com): > >> Hi, > >> > >> I found a tricky problem in LXC, once I made a mistake in config, set > >> > >> lxc.cgroup.cpuset.cpus = -1 > >> > >> ofcourse start would f

Re: [lxc-devel] [PATCH 1/1] lxccontainer: don't lock around getstate and freeze/unfreeze

2013-05-29 Thread Dwight Engen
On Wed, 29 May 2013 00:01:16 -0500 Serge Hallyn wrote: > > Those go through commands.c and are already mutex'ed that way. > > Also remove a unmatched container_disk_unlock in lxcapi_create. > > Since is_stopped uses getstate which is no longer locked, rename > it to drop the _locked suffix. >

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Make lxc_cmd_console() return the fd from the socket connection to the > caller. This fd keeps the tty slot allocated until the caller closes > it. Returning the fd allows for a long lived process to close the fd > and reuse consoles. > > Add API f

Re: [lxc-devel] [PATCH 1/1] lxccontainer: don't lock around getstate and freeze/unfreeze

2013-05-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Wed, 29 May 2013 00:01:16 -0500 > Serge Hallyn wrote: > > > > > Those go through commands.c and are already mutex'ed that way. > > > > Also remove a unmatched container_disk_unlock in lxcapi_create. > > > > Since is_stopped uses getstate whi

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Dwight Engen
On Wed, 29 May 2013 09:24:40 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > Make lxc_cmd_console() return the fd from the socket connection to > > the caller. This fd keeps the tty slot allocated until the caller > > closes it. Returning the fd allows for a long l

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com): > Quoting Dwight Engen (dwight.en...@oracle.com): > > Make lxc_cmd_console() return the fd from the socket connection to the > > caller. This fd keeps the tty slot allocated until the caller closes > > it. Returning the fd allows for a long lived proc

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Dwight Engen
On Wed, 29 May 2013 10:01:45 -0500 Serge Hallyn wrote: > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > Make lxc_cmd_console() return the fd from the socket connection > > > to the caller. This fd keeps the tty slot allocated until the >

[lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Harald Dunkel
Hi folks, AFAICS I have to list all containers to be started at boot time in /etc/lxc/auto using symlinks pointing to the config files. Problem: /etc is a local file system. For a HA solution you usually have some kind of "network" device/filesystem providing the resources to manage, e.g. a DRBD

[lxc-devel] [PATCH 1/1] lxccontainer: don't lock around getstate and freeze/unfreeze (v2)

2013-05-29 Thread Serge Hallyn
Those go through commands.c and are already mutex'ed that way. Also remove a unmatched container_disk_unlock in lxcapi_create. Since is_stopped uses getstate which is no longer locked, rename it to drop the _locked suffix. And convert save_config to taking the disk lock. This way the save_ and

Re: [lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Serge Hallyn
Please see the long threads from yesterday, subject "Container autostart proposal" and "Container autostart proposal V2" -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into y

Re: [lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Stéphane Graber
On 05/29/2013 12:31 PM, Harald Dunkel wrote: > Hi folks, > > AFAICS I have to list all containers to be started at boot > time in /etc/lxc/auto using symlinks pointing to the > config files. Problem: /etc is a local file system. > > For a HA solution you usually have some kind of "network" > devi

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Wed, 29 May 2013 10:01:45 -0500 > Serge Hallyn wrote: > > > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > > Make lxc_cmd_console() return the fd from the socket connection > > > > to

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Wed, 29 May 2013 09:24:40 -0500 > Serge Hallyn wrote: > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > Make lxc_cmd_console() return the fd from the socket connection to > > > the caller. This fd keeps the tty slot allocated until th

Re: [lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Michael H. Warfield
On Wed, 2013-05-29 at 18:31 +0200, Harald Dunkel wrote: > Hi folks, > AFAICS I have to list all containers to be started at boot > time in /etc/lxc/auto using symlinks pointing to the > config files. Problem: /etc is a local file system. > For a HA solution you usually have some kind of "network

Re: [lxc-devel] [PATCH 1/1] lxccontainer: don't lock around getstate and freeze/unfreeze (v2)

2013-05-29 Thread Dwight Engen
On Wed, 29 May 2013 12:26:25 -0500 Serge Hallyn wrote: > Those go through commands.c and are already mutex'ed that way. > > Also remove a unmatched container_disk_unlock in lxcapi_create. > > Since is_stopped uses getstate which is no longer locked, rename > it to drop the _locked suffix. > >

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Stéphane Graber
On 05/29/2013 01:38 PM, Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): >> On Wed, 29 May 2013 09:24:40 -0500 >> Serge Hallyn wrote: >> >>> Quoting Dwight Engen (dwight.en...@oracle.com): Make lxc_cmd_console() return the fd from the socket connection to the caller.

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Dwight Engen
On Wed, 29 May 2013 13:52:51 -0400 Stéphane Graber wrote: > On 05/29/2013 01:38 PM, Serge Hallyn wrote: > > Quoting Dwight Engen (dwight.en...@oracle.com): > >> On Wed, 29 May 2013 09:24:40 -0500 > >> Serge Hallyn wrote: > >> > >>> Quoting Dwight Engen (dwight.en...@oracle.com): > Make lxc_

Re: [lxc-devel] [PATCH] add console to lxc api

2013-05-29 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@stgraber.org): > On 05/29/2013 01:38 PM, Serge Hallyn wrote: > > Quoting Dwight Engen (dwight.en...@oracle.com): > >> On Wed, 29 May 2013 09:24:40 -0500 > >> Serge Hallyn wrote: > >> > >>> Quoting Dwight Engen (dwight.en...@oracle.com): > Make lxc_cmd_console

Re: [lxc-devel] [PATCH v2] lxc-alpine: download a static package manager if its missing

2013-05-29 Thread Serge Hallyn
Quoting Natanael Copa (nc...@alpinelinux.org): > If the package manager, apk-tools is missing, then: > - download a static binary and public keys > - verify the keys against embedded checksum > - verify the signature of the static binary against the downloaded keys > - use the verified static b

Re: [lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Harald Dunkel
On 05/29/13 19:30, Serge Hallyn wrote: > Please see the long threads from yesterday, subject > "Container autostart proposal" and > "Container autostart proposal V2" > Sorry, I should have checked first. Thanx for the pointer. Harri -

Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-29 Thread Qiang Huang
On 2013/5/29 21:47, Serge Hallyn wrote: > > Right, so other failures later on *could* still cause this. > Shall we do something like > > { > // Wait on any unterminated children > int status, ret; > while ((ret = waitpid(-1, &status, 0)) > 0); >

[lxc-devel] [PATCH 1/1] api locking: take process lock around open/close

2013-05-29 Thread Serge Hallyn
And update the comment explaining the locking. Also take memlock in want_daemonize. Signed-off-by: Serge Hallyn --- src/lxc/lxccontainer.c | 153 + 1 file changed, 115 insertions(+), 38 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/l

Re: [lxc-devel] suggestion for an autostart flag

2013-05-29 Thread Harald Dunkel
Hi Mike, On 05/29/13 19:40, Michael H. Warfield wrote: > > I would strongly disagree with this proposal for several reasons. > I completely agree to your concerns, esp. wrt. to overloading the executable bit and unexpected side effects. Thanx for your comment Harri

Re: [lxc-devel] Container autostart proposal V2

2013-05-29 Thread Harald Dunkel
Hi folks, If its not too late for a suggestion: lxc-stop could provide an option -A to shutdown/stop all containers, independent from their autostart flag. Worst case scenario (almost) is that a disk has an IO error and the config files cannot be read anymore. For my own part, if I want to stop