Commit 3afbcc46 by S.Çağlar Onur Committed by Serge Hallyn

wait 15 seconds instead of forever and produce debug logs for further analyze

parent 7c9a9995
...@@ -91,11 +91,15 @@ static void do_function(void *arguments) ...@@ -91,11 +91,15 @@ static void do_function(void *arguments)
} else if(strcmp(args->mode, "start") == 0) { } else if(strcmp(args->mode, "start") == 0) {
if (c->is_defined(c) && !c->is_running(c)) { if (c->is_defined(c) && !c->is_running(c)) {
c->want_daemonize(c, true); c->want_daemonize(c, true);
if (!quiet) {
c->set_config_item(c, "lxc.loglevel", "DEBUG");
c->set_config_item(c, "lxc.logfile", name);
}
if (!c->start(c, false, NULL)) { if (!c->start(c, false, NULL)) {
fprintf(stderr, "Starting the container (%s) failed...\n", name); fprintf(stderr, "Starting the container (%s) failed...\n", name);
goto out; goto out;
} }
if (!c->wait(c, "RUNNING", -1)) { if (!c->wait(c, "RUNNING", 15)) {
fprintf(stderr, "Waiting the container (%s) to start failed...\n", name); fprintf(stderr, "Waiting the container (%s) to start failed...\n", name);
goto out; goto out;
} }
...@@ -107,7 +111,7 @@ static void do_function(void *arguments) ...@@ -107,7 +111,7 @@ static void do_function(void *arguments)
fprintf(stderr, "Stopping the container (%s) failed...\n", name); fprintf(stderr, "Stopping the container (%s) failed...\n", name);
goto out; goto out;
} }
if (!c->wait(c, "STOPPED", -1)) { if (!c->wait(c, "STOPPED", 15)) {
fprintf(stderr, "Waiting the container (%s) to stop failed...\n", name); fprintf(stderr, "Waiting the container (%s) to stop failed...\n", name);
goto out; goto out;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment