]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-stop: don't set timeout if user requested -s
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 23 Dec 2013 16:23:38 +0000 (10:23 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 23 Dec 2013 16:25:43 +0000 (10:25 -0600)
A timeout means wait this long before killing the container.
-s means don't kill the container.  timeout defaults to 60
seconds.  So if a shutdown is requested, then set timeout to
0.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
doc/lxc-stop.sgml.in
src/lxc/lxc_stop.c

index d4ec36a177719133bcb34b798b02e41535d9da97..09ea5d6be022a534dc6a97a3dcfdc9c20c68aa8b 100644 (file)
@@ -151,8 +151,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
        </term>
        <listitem>
          <para>
-           Wait TIMEOUT seconds before hard-stopping the container of (in
-               the reboot case) returning failure.
+           Wait TIMEOUT seconds before hard-stopping the container.
          </para>
        </listitem>
        </varlistentry>
index a4ead815b9dd78fa39a82f02d10ad1f859158751..7940053f25db9b5fa336f2e05c0db382aaaff21f 100644 (file)
@@ -175,6 +175,9 @@ int main(int argc, char *argv[])
                goto out;
        }
 
+       if (my_args.shutdown)
+               my_args.timeout = 0;
+
        s = c->shutdown(c, my_args.timeout);
        if (!s) {
                if (!my_args.shutdown)