[lxc-devel] [PATCH 3/9] lxc_start: ERROR if container is already running.

Dwight Engen dwight.engen at oracle.com
Tue Oct 21 16:05:40 UTC 2014


On Tue, 21 Oct 2014 09:58:29 -0500
Tycho Andersen <tycho.andersen at canonical.com> wrote:

> On Tue, Oct 21, 2014 at 02:54:34PM +0000, Serge Hallyn wrote:
> > Quoting Tycho Andersen (tycho.andersen at canonical.com):
> > > On Tue, Oct 21, 2014 at 02:29:28PM +0000, Serge Hallyn wrote:
> > > > Quoting Tycho Andersen (tycho.andersen at canonical.com):
> > > > > On Fri, Oct 10, 2014 at 11:16:54AM +0800, Dongsheng Yang
> > > > > wrote:
> > > > > > We should exit with a error when starting a running
> > > > > > container.
> > > > > 
> > > > > Is this intentional? I just noticed it when pulling from
> > > > > master that it breaks some of my scripts. Are we sure it
> > > > > doesn't break anything else?
> > > > 
> > > > Which scripts does it break?
> > > 
> > > No public ones, just some that I wrote myself. Just curious if the
> > > behavior change was intentional or not (I prefer the previous
> > > behavior :)
> > 
> > What exactly is the change?  Did it used to return true instead of
> > false?  The intent was simply to shortcut a bunch of extra work in
> > the case where the container was already running.
> 
> Yes, sorry. It used to exit 0 instead of 1 when the container was
> already running (and didn't print any ERROR or anything).

I also find this a bit inconsistent, we purposefully don't report an
error when doing stop on an already stopped container (see the early
return 0 in lxc_cmd_stop()). I think it can be argued that its not an
error since the command did what the caller wanted (ensure the
container is started/stopped).

> Tycho
> 
> > -serge
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel



More information about the lxc-devel mailing list