]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_start: ERROR if container is already running.
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Fri, 12 Sep 2014 13:49:09 +0000 (21:49 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 25 Nov 2014 21:52:05 +0000 (16:52 -0500)
We should exit with a error when starting a running container.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_start.c

index d55746e419d9123ef7966a2ba065b225b4ffb0d2..905fde3ea716fe833f14dc755ca68f92597ee31d 100644 (file)
@@ -276,6 +276,10 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (c->is_running(c)) {
+               ERROR("Container is already running.");
+               goto out;
+       }
        /*
         * We should use set_config_item() over &defines, which would handle
         * unset c->lxc_conf for us and let us not use lxc_config_define_load()