]>
Commit | Line | Data |
---|---|---|
f79d43bb | 1 | <!-- |
d823d5b9 | 2 | |
3 | lxc: linux Container library | |
4 | ||
5 | (C) Copyright IBM Corp. 2007, 2008 | |
6 | ||
7 | Authors: | |
9afe19d6 | 8 | Daniel Lezcano <daniel.lezcano at free.fr> |
d823d5b9 | 9 | |
10 | This library is free software; you can redistribute it and/or | |
11 | modify it under the terms of the GNU Lesser General Public | |
12 | License as published by the Free Software Foundation; either | |
13 | version 2.1 of the License, or (at your option) any later version. | |
14 | ||
15 | This library is distributed in the hope that it will be useful, | |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public | |
21 | License along with this library; if not, write to the Free Software | |
250b1eec | 22 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
d823d5b9 | 23 | |
24 | --> | |
25 | ||
7f951458 | 26 | <!DOCTYPE refentry PUBLIC @docdtd@ [ |
99e4008c | 27 | |
10fba81b | 28 | <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml"> |
99e4008c MN |
29 | <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml"> |
30 | ]> | |
d823d5b9 | 31 | |
32 | <refentry> | |
33 | ||
34 | <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo> | |
35 | ||
36 | <refmeta> | |
37 | <refentrytitle>lxc-stop</refentrytitle> | |
38 | <manvolnum>1</manvolnum> | |
39 | </refmeta> | |
40 | ||
41 | <refnamediv> | |
42 | <refname>lxc-stop</refname> | |
43 | ||
44 | <refpurpose> | |
45 | stop the application running inside a container | |
46 | </refpurpose> | |
47 | </refnamediv> | |
48 | ||
49 | <refsynopsisdiv> | |
50 | <cmdsynopsis> | |
b4578c5b DE |
51 | <command>lxc-stop</command> |
52 | <arg choice="req">-n <replaceable>name</replaceable></arg> | |
3e625e2d SH |
53 | <arg choice="opt">-W</arg> |
54 | <arg choice="opt">-r</arg> | |
55 | <arg choice="opt">-t <replaceable>timeout</replaceable></arg> | |
56 | <arg choice="opt">-k</arg> | |
84fbfcb4 DE |
57 | <arg choice="opt">--nokill</arg> |
58 | <arg choice="opt">--nolock</arg> | |
d823d5b9 | 59 | </cmdsynopsis> |
60 | </refsynopsisdiv> | |
61 | ||
62 | <refsect1> | |
63 | <title>Description</title> | |
64 | ||
65 | <para> | |
3e625e2d SH |
66 | <command>lxc-stop</command> reboots, cleanly shuts down, or kills |
67 | all the processes inside the container. By default, it will | |
f0f1d8c0 | 68 | request a clean shutdown of the container by sending |
55c84efc | 69 | <command>lxc.signal.halt</command> (defaults to SIGPWR) to |
f0f1d8c0 DE |
70 | the container's init process, waiting up to 60 seconds for the container |
71 | to exit, and then returning. If the container fails to cleanly exit in | |
55c84efc | 72 | 60 seconds, it will be sent the <command>lxc.signal.stop</command> |
936762f3 | 73 | (defaults to SIGKILL) to force it to shut down. A request to reboot will |
55c84efc | 74 | send the <command>lxc.signal.reboot</command> (defaults to SIGINT) to the |
936762f3 | 75 | container's init process. |
d823d5b9 | 76 | </para> |
3e625e2d | 77 | <para> |
84fbfcb4 DE |
78 | The <optional>-W</optional>, <optional>-r</optional>, |
79 | <optional>-k</optional> and <optional>--nokill</optional> | |
80 | options specify the action to perform. | |
3e625e2d SH |
81 | <optional>-W</optional> indicates that after performing the specified |
82 | action, <command>lxc-stop</command> should immediately exit, while | |
83 | <optional>-t TIMEOUT</optional> specifies the maximum amount of time | |
84 | to wait for the container to complete the shutdown or reboot. | |
85 | </para> | |
d823d5b9 | 86 | </refsect1> |
87 | ||
3e625e2d SH |
88 | <refsect1> |
89 | <title>Options</title> | |
90 | <variablelist> | |
91 | ||
92 | <varlistentry> | |
93 | <term> | |
94 | <option>-r,--reboot </option> | |
95 | </term> | |
96 | <listitem> | |
97 | <para> | |
98 | Request a reboot of the container. | |
99 | </para> | |
100 | </listitem> | |
101 | </varlistentry> | |
102 | ||
103 | <varlistentry> | |
104 | <term> | |
84fbfcb4 | 105 | <option>-k,--kill </option> |
3e625e2d SH |
106 | </term> |
107 | <listitem> | |
108 | <para> | |
84fbfcb4 DE |
109 | Rather than requesting a clean shutdown of the container, explicitly |
110 | kill all tasks in the container. This is the legacy | |
111 | <command>lxc-stop</command> behavior. | |
3e625e2d SH |
112 | </para> |
113 | </listitem> | |
114 | </varlistentry> | |
115 | ||
116 | <varlistentry> | |
117 | <term> | |
84fbfcb4 | 118 | <option>--nokill</option> |
3e625e2d SH |
119 | </term> |
120 | <listitem> | |
121 | <para> | |
84fbfcb4 DE |
122 | Only request a clean shutdown, do not kill the container tasks if the |
123 | clean shutdown fails. | |
3e625e2d SH |
124 | </para> |
125 | </listitem> | |
126 | </varlistentry> | |
127 | ||
8face1de SH |
128 | <varlistentry> |
129 | <term> | |
130 | <option>--nolock </option> | |
131 | </term> | |
132 | <listitem> | |
133 | <para> | |
134 | This option avoids the use of any of the API lxc locking, and should | |
135 | only be used if <command>lxc-stop</command> is hanging due to a bad | |
136 | system state. | |
137 | </para> | |
138 | </listitem> | |
139 | </varlistentry> | |
140 | ||
3e625e2d SH |
141 | <varlistentry> |
142 | <term> | |
143 | <option>-W,--nowait </option> | |
144 | </term> | |
145 | <listitem> | |
146 | <para> | |
147 | Simply perform the requestion action (reboot, shutdown, or hard | |
148 | kill) and exit. | |
149 | </para> | |
150 | </listitem> | |
151 | </varlistentry> | |
152 | ||
153 | <varlistentry> | |
154 | <term> | |
155 | <option>-t,--timeout <replaceable>TIMEOUT</replaceable></option> | |
156 | </term> | |
157 | <listitem> | |
158 | <para> | |
25070b66 | 159 | Wait TIMEOUT seconds before hard-stopping the container. |
3e625e2d SH |
160 | </para> |
161 | </listitem> | |
162 | </varlistentry> | |
163 | ||
164 | </variablelist> | |
165 | </refsect1> | |
d823d5b9 | 166 | |
13bc2fd2 SH |
167 | <refsect1> |
168 | <title>Exit value</title> | |
169 | ||
170 | <variablelist> | |
171 | ||
172 | <varlistentry> | |
173 | <term>0</term> | |
174 | <listitem> | |
175 | <para> | |
176 | The container was successfully stopped. | |
177 | </para> | |
178 | </listitem> | |
179 | </varlistentry> | |
180 | ||
181 | <varlistentry> | |
182 | <term>1</term> | |
183 | <listitem> | |
184 | <para> | |
185 | An error occurred while stopping the container. | |
186 | </para> | |
187 | </listitem> | |
188 | </varlistentry> | |
189 | ||
190 | <varlistentry> | |
191 | <term>2</term> | |
192 | <listitem> | |
193 | <para> | |
194 | The specified container exists but was not running. | |
195 | </para> | |
196 | </listitem> | |
197 | </varlistentry> | |
198 | ||
199 | </variablelist> | |
200 | ||
201 | </refsect1> | |
d823d5b9 | 202 | <refsect1> |
203 | <title>Diagnostic</title> | |
204 | ||
205 | <variablelist> | |
206 | ||
d823d5b9 | 207 | <varlistentry> |
208 | <term>The container was not found</term> | |
209 | <listitem> | |
210 | <para> | |
211 | The specified container was not created before with | |
212 | the <command>lxc-create</command> command. | |
213 | </para> | |
214 | </listitem> | |
f79d43bb | 215 | </varlistentry> |
d823d5b9 | 216 | |
d823d5b9 | 217 | </variablelist> |
218 | ||
219 | </refsect1> | |
220 | ||
99e4008c | 221 | &seealso; |
d823d5b9 | 222 | |
223 | <refsect1> | |
224 | <title>Author</title> | |
225 | <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para> | |
226 | </refsect1> | |
227 | ||
228 | </refentry> | |
229 | ||
230 | <!-- Keep this comment at the end of the file | |
231 | Local variables: | |
232 | mode: sgml | |
233 | sgml-omittag:t | |
234 | sgml-shorttag:t | |
235 | sgml-minimize-attributes:nil | |
236 | sgml-always-quote-attributes:t | |
237 | sgml-indent-step:2 | |
238 | sgml-indent-data:t | |
239 | sgml-parent-document:nil | |
240 | sgml-default-dtd-file:nil | |
241 | sgml-exposed-tags:nil | |
242 | sgml-local-catalogs:nil | |
243 | sgml-local-ecat-files:nil | |
244 | End: | |
245 | --> |