]> 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)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 15 Oct 2014 09:54:44 +0000 (11:54 +0200)
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 e836325fef4c838dece0c5d4edcbe513da5b7f44..9a053567dada23aa24cfebdfdd480ab7a6069cae 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()