]> git.proxmox.com Git - mirror_lxc.git/commitdiff
rename lxc-stop shutdown argument to nokill
authorDwight Engen <dwight.engen@oracle.com>
Fri, 3 Jan 2014 19:36:43 +0000 (14:36 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 6 Jan 2014 15:06:05 +0000 (10:06 -0500)
This makes the arguments between lxc-stop and lxc-autostart more
consistent, so that --shutdown doesn't have two different meanings.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
doc/lxc-stop.sgml.in
src/lxc/arguments.h
src/lxc/lxc_stop.c

index 09ea5d6be022a534dc6a97a3dcfdc9c20c68aa8b..bdb0ef5d832a53dc63e94369990b3c8adc7d4b66 100644 (file)
@@ -54,7 +54,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <arg choice="opt">-r</arg>
       <arg choice="opt">-t <replaceable>timeout</replaceable></arg>
       <arg choice="opt">-k</arg>
-      <arg choice="opt">-s</arg>
+      <arg choice="opt">--nokill</arg>
+      <arg choice="opt">--nolock</arg>
     </cmdsynopsis>
   </refsynopsisdiv>
 
@@ -68,11 +69,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       the container), wait 60 seconds for the container to exit, and
       returns.  If the container fails to cleanly exit, then after 60
       seconds the container will be sent the
-      <command>lxc.stopsignal</command> to force it to shut down.
+      <command>lxc.stopsignal</command> to force it to shut down. If
+      <command>lxc.stopsignal</command> is not specified, the signal sent is
+      SIGKILL.
     </para>
        <para>
-       The <optional>-W</optional>, <optional>-r</optional>, <optional>-s</optional>
-       and <optional>-k</optional> options specify the action to perform.
+       The <optional>-W</optional>, <optional>-r</optional>,
+       <optional>-k</optional> and <optional>--nokill</optional>
+       options specify the action to perform.
        <optional>-W</optional> indicates that after performing the specified
        action, <command>lxc-stop</command> should immediately exit, while
        <optional>-t TIMEOUT</optional> specifies the maximum amount of time
@@ -97,25 +101,25 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
     <varlistentry>
        <term>
-         <option>-s,--shutdown </option>
+         <option>-k,--kill </option>
        </term>
        <listitem>
          <para>
-           Only request a clean shutdown, do not kill the container tasks if the
-               clean shutdown fails.
+        Rather than requesting a clean shutdown of the container, explicitly
+        kill all tasks in the container.  This is the legacy
+        <command>lxc-stop</command> behavior.
          </para>
        </listitem>
        </varlistentry>
 
     <varlistentry>
        <term>
-         <option>-k,--kill </option>
+         <option>--nokill</option>
        </term>
        <listitem>
          <para>
-        Rather than requesting a clean shutdown of the container, explicitly
-        kill all tasks in the container.  This is the legacy
-        <command>lxc-stop</command> behavior.
+           Only request a clean shutdown, do not kill the container tasks if the
+               clean shutdown fails.
          </para>
        </listitem>
        </varlistentry>
index 954ddccfcb125cf2128d3c858055f42be603779a..2fa24c0a3f6cea3abbfe21ca88d34f2f942c1103 100644 (file)
@@ -65,16 +65,19 @@ struct lxc_arguments {
        int ttynum;
        char escape;
 
-       /* for lxc-wait and lxc-shutdown */
+       /* for lxc-wait */
        char *states;
        long timeout;
-       int nowait;
-       int reboot;
-       int hardstop;
+
+       /* for lxc-autostart */
        int shutdown;
 
        /* for lxc-stop */
+       int hardstop;
+       int nokill;
        int nolock;
+       int nowait;
+       int reboot;
 
        /* for lxc-destroy */
        int force;
index d0cf798f246ff367fc4769bba17bda4d7ce178e5..dc4133f5bfd2b3e4b00388baf7a0e50eca13392f 100644 (file)
@@ -34,6 +34,7 @@
 #include "utils.h"
 
 #define OPT_NO_LOCK OPT_USAGE+1
+#define OPT_NO_KILL OPT_USAGE+2
 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)
 {
@@ -42,8 +43,8 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
        case 'W': args->nowait = 1; break;
        case 't': args->timeout = atoi(arg); break;
        case 'k': args->hardstop = 1; break;
-       case 's': args->shutdown = 1; break;
        case OPT_NO_LOCK: args->nolock = 1; break;
+       case OPT_NO_KILL: args->nokill = 1; break;
        }
        return 0;
 }
@@ -53,7 +54,7 @@ static const struct option my_longopts[] = {
        {"nowait", no_argument, 0, 'W'},
        {"timeout", required_argument, 0, 't'},
        {"kill", no_argument, 0, 'k'},
-       {"shutdown", no_argument, 0, 's'},
+       {"no-kill", no_argument, 0, OPT_NO_KILL},
        {"no-lock", no_argument, 0, OPT_NO_LOCK},
        LXC_COMMON_OPTIONS
 };
@@ -72,7 +73,7 @@ Options :\n\
   -t, --timeout=T   wait T seconds before hard-stopping\n\
   -k, --kill        kill container rather than request clean shutdown\n\
       --nolock      Avoid using API locks\n\
-  -s, --shutdown    Only request clean shutdown, don't later force kill\n",
+      --nokill      Only request clean shutdown, don't force kill after timeout\n",
        .options  = my_longopts,
        .parser   = my_parser,
        .checker  = NULL,
@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
                goto out;
        }
 
-       if (my_args.shutdown)
+       if (my_args.nokill)
                my_args.timeout = 0;
 
        s = c->shutdown(c, my_args.timeout);