Commit 84fbfcb4 by Dwight Engen Committed by Stéphane Graber

rename lxc-stop shutdown argument to nokill

This makes the arguments between lxc-stop and lxc-autostart more consistent, so that --shutdown doesn't have two different meanings. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent a600d021
...@@ -54,7 +54,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -54,7 +54,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<arg choice="opt">-r</arg> <arg choice="opt">-r</arg>
<arg choice="opt">-t <replaceable>timeout</replaceable></arg> <arg choice="opt">-t <replaceable>timeout</replaceable></arg>
<arg choice="opt">-k</arg> <arg choice="opt">-k</arg>
<arg choice="opt">-s</arg> <arg choice="opt">--nokill</arg>
<arg choice="opt">--nolock</arg>
</cmdsynopsis> </cmdsynopsis>
</refsynopsisdiv> </refsynopsisdiv>
...@@ -68,11 +69,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -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 the container), wait 60 seconds for the container to exit, and
returns. If the container fails to cleanly exit, then after 60 returns. If the container fails to cleanly exit, then after 60
seconds the container will be sent the 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>
<para> <para>
The <optional>-W</optional>, <optional>-r</optional>, <optional>-s</optional> The <optional>-W</optional>, <optional>-r</optional>,
and <optional>-k</optional> options specify the action to perform. <optional>-k</optional> and <optional>--nokill</optional>
options specify the action to perform.
<optional>-W</optional> indicates that after performing the specified <optional>-W</optional> indicates that after performing the specified
action, <command>lxc-stop</command> should immediately exit, while action, <command>lxc-stop</command> should immediately exit, while
<optional>-t TIMEOUT</optional> specifies the maximum amount of time <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 ...@@ -97,25 +101,25 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<varlistentry> <varlistentry>
<term> <term>
<option>-s,--shutdown </option> <option>-k,--kill </option>
</term> </term>
<listitem> <listitem>
<para> <para>
Only request a clean shutdown, do not kill the container tasks if the Rather than requesting a clean shutdown of the container, explicitly
clean shutdown fails. kill all tasks in the container. This is the legacy
<command>lxc-stop</command> behavior.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>-k,--kill </option> <option>--nokill</option>
</term> </term>
<listitem> <listitem>
<para> <para>
Rather than requesting a clean shutdown of the container, explicitly Only request a clean shutdown, do not kill the container tasks if the
kill all tasks in the container. This is the legacy clean shutdown fails.
<command>lxc-stop</command> behavior.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -65,16 +65,19 @@ struct lxc_arguments { ...@@ -65,16 +65,19 @@ struct lxc_arguments {
int ttynum; int ttynum;
char escape; char escape;
/* for lxc-wait and lxc-shutdown */ /* for lxc-wait */
char *states; char *states;
long timeout; long timeout;
int nowait;
int reboot; /* for lxc-autostart */
int hardstop;
int shutdown; int shutdown;
/* for lxc-stop */ /* for lxc-stop */
int hardstop;
int nokill;
int nolock; int nolock;
int nowait;
int reboot;
/* for lxc-destroy */ /* for lxc-destroy */
int force; int force;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "utils.h" #include "utils.h"
#define OPT_NO_LOCK OPT_USAGE+1 #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) 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) ...@@ -42,8 +43,8 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
case 'W': args->nowait = 1; break; case 'W': args->nowait = 1; break;
case 't': args->timeout = atoi(arg); break; case 't': args->timeout = atoi(arg); break;
case 'k': args->hardstop = 1; break; case 'k': args->hardstop = 1; break;
case 's': args->shutdown = 1; break;
case OPT_NO_LOCK: args->nolock = 1; break; case OPT_NO_LOCK: args->nolock = 1; break;
case OPT_NO_KILL: args->nokill = 1; break;
} }
return 0; return 0;
} }
...@@ -53,7 +54,7 @@ static const struct option my_longopts[] = { ...@@ -53,7 +54,7 @@ static const struct option my_longopts[] = {
{"nowait", no_argument, 0, 'W'}, {"nowait", no_argument, 0, 'W'},
{"timeout", required_argument, 0, 't'}, {"timeout", required_argument, 0, 't'},
{"kill", no_argument, 0, 'k'}, {"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}, {"no-lock", no_argument, 0, OPT_NO_LOCK},
LXC_COMMON_OPTIONS LXC_COMMON_OPTIONS
}; };
...@@ -72,7 +73,7 @@ Options :\n\ ...@@ -72,7 +73,7 @@ Options :\n\
-t, --timeout=T wait T seconds before hard-stopping\n\ -t, --timeout=T wait T seconds before hard-stopping\n\
-k, --kill kill container rather than request clean shutdown\n\ -k, --kill kill container rather than request clean shutdown\n\
--nolock Avoid using API locks\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, .options = my_longopts,
.parser = my_parser, .parser = my_parser,
.checker = NULL, .checker = NULL,
...@@ -175,7 +176,7 @@ int main(int argc, char *argv[]) ...@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
goto out; goto out;
} }
if (my_args.shutdown) if (my_args.nokill)
my_args.timeout = 0; my_args.timeout = 0;
s = c->shutdown(c, my_args.timeout); s = c->shutdown(c, my_args.timeout);
......
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