1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 This file is part of systemd.
8 Copyright 2013 Zbigniew Jędrzejewski-Szmek
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 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.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="machinectl" conditional='ENABLE_MACHINED'
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>machinectl</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>machinectl</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>machinectl</refname>
48 <refpurpose>Control the systemd machine manager</refpurpose>
53 <command>machinectl</command>
54 <arg choice="opt" rep="repeat">OPTIONS</arg>
55 <arg choice="req">COMMAND</arg>
56 <arg choice="opt" rep="repeat">NAME</arg>
61 <title>Description</title>
63 <para><command>machinectl</command> may be used to
64 introspect and control the state of the
65 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
66 virtual machine and container registration manager <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
70 <title>Options</title>
72 <para>The following options are understood:</para>
76 <term><option>-h</option></term>
77 <term><option>--help</option></term>
79 <listitem><para>Prints a short help
80 text and exits.</para></listitem>
84 <term><option>--version</option></term>
86 <listitem><para>Prints a short version
87 string and exits.</para></listitem>
91 <term><option>--no-pager</option></term>
93 <listitem><para>Do not pipe output into a
94 pager.</para></listitem>
98 <term><option>--no-legend</option></term>
100 <listitem><para>Do not print the legend,
101 i.e. the column headers and the
102 footer.</para></listitem>
106 <term><option>--no-ask-password</option></term>
108 <listitem><para>Do not query the user
109 for authentication for privileged
110 operations.</para></listitem>
114 <term><option>-H</option></term>
115 <term><option>--host=</option></term>
117 <listitem><para>Execute the operation
118 remotely. Specify a hostname, or
119 username and hostname separated by <literal>@</literal>,
120 to connect to. This will use SSH to
121 talk to the remote machine manager
122 instance.</para></listitem>
126 <term><option>-M</option></term>
127 <term><option>--machine=</option></term>
129 <listitem><para>Execute the operation on a
130 local container. Specify a container
131 name to connect to.</para></listitem>
135 <term><option>-p</option></term>
136 <term><option>--property=</option></term>
138 <listitem><para>When showing
139 machine properties, limit the
140 output to certain properties as
141 specified by the argument. If not
142 specified, all set properties are
143 shown. The argument should be a
144 property name, such as
145 <literal>Name</literal>. If
146 specified more than once, all
147 properties with the specified names
148 are shown.</para></listitem>
152 <term><option>-a</option></term>
153 <term><option>--all</option></term>
155 <listitem><para>When showing
156 machine properties, show all
157 properties regardless of whether they are
158 set or not.</para></listitem>
162 <term><option>-l</option></term>
163 <term><option>--full</option></term>
165 <listitem><para>Do not ellipsize
166 process tree entries.</para>
171 <term><option>--kill-who=</option></term>
173 <listitem><para>When used with
174 <command>kill</command>,
175 choose which processes to kill. Must
176 be one of <option>leader</option>, or
177 <option>all</option> to select whether
178 to kill only the leader process of the
179 machine or all processes of the
180 machine. If omitted, defaults to
181 <option>all</option>.</para></listitem>
185 <term><option>-s</option></term>
186 <term><option>--signal=</option></term>
188 <listitem><para>When used with
189 <command>kill</command>, choose
190 which signal to send to selected
191 processes. Must be one of the
192 well-known signal specifiers, such as
193 <constant>SIGTERM</constant>,
194 <constant>SIGINT</constant> or
195 <constant>SIGSTOP</constant>. If
197 <constant>SIGTERM</constant>.</para></listitem>
202 <para>The following commands are understood:</para>
206 <term><command>list</command></term>
208 <listitem><para>List currently running
209 virtual machines and containers.
214 <term><command>status</command> <replaceable>ID</replaceable>...</term>
216 <listitem><para>Show terse runtime
217 status information about one or more
218 virtual machines and containers. This
219 function is intended to generate
220 human-readable output. If you are
221 looking for computer-parsable output,
222 use <command>show</command> instead.
227 <term><command>show</command> <replaceable>ID</replaceable>...</term>
229 <listitem><para>Show properties of one
230 or more registered virtual machines or
231 containers or the manager itself. If
232 no argument is specified, properties
233 of the manager will be shown. If an
234 ID is specified, properties of this
235 virtual machine or container are
236 shown. By default, empty properties
238 <option>--all</option> to show those
239 too. To select specific properties to
241 <option>--property=</option>. This
242 command is intended to be used
243 whenever computer-parsable output is
245 <command>status</command> if you are
246 looking for formatted human-readable
247 output.</para></listitem>
251 <term><command>terminate</command> <replaceable>ID</replaceable>...</term>
253 <listitem><para>Terminates a virtual
254 machine or container. This kills all
255 processes of the virtual machine or
256 container and deallocates all
257 resources attached to that
258 instance.</para></listitem>
262 <term><command>kill</command> <replaceable>ID</replaceable>...</term>
264 <listitem><para>Send a signal to one
265 or more processes of the virtual
266 machine or container. This means
267 processes as seen by the host, not the
268 processes inside the virtual machine
270 Use <option>--kill-who=</option> to
271 select which process to kill. Use
272 <option>--signal=</option> to select
273 the signal to send.</para></listitem>
277 <term><command>reboot</command> <replaceable>ID</replaceable>...</term>
279 <listitem><para>Reboot one or more
280 containers. This will trigger a reboot
281 by sending SIGINT to the container's
282 init process, which is roughly
283 equivalent to pressing Ctrl+Alt+Del on
285 system.</para></listitem>
289 <term><command>login</command> <replaceable>ID</replaceable></term>
291 <listitem><para>Open a terminal login
292 session to a container. This will
293 create a TTY connection to a specific
294 container and asks for the execution of a
295 getty on it. Note that this is only
296 supported for containers running
297 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
298 as init system.</para></listitem>
305 <title>Exit status</title>
307 <para>On success, 0 is returned, a non-zero failure
308 code otherwise.</para>
311 <xi:include href="less-variables.xml" />
314 <title>See Also</title>
316 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
317 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
318 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>