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>--host=</option></term>
79 <listitem><para>Execute the operation
80 remotely. Specify a hostname, or
81 username and hostname separated by <literal>@</literal>,
82 to connect to. This will use SSH to
83 talk to the remote machine manager
84 instance.</para></listitem>
88 <term><option>-M</option></term>
89 <term><option>--machine=</option></term>
91 <listitem><para>Execute the operation on a
92 local container. Specify a container
93 name to connect to.</para></listitem>
97 <term><option>-p</option></term>
98 <term><option>--property=</option></term>
100 <listitem><para>When showing
101 machine properties, limit the
102 output to certain properties as
103 specified by the argument. If not
104 specified, all set properties are
105 shown. The argument should be a
106 property name, such as
107 <literal>Name</literal>. If
108 specified more than once, all
109 properties with the specified names
110 are shown.</para></listitem>
114 <term><option>-a</option></term>
115 <term><option>--all</option></term>
117 <listitem><para>When showing
118 machine properties, show all
119 properties regardless of whether they are
120 set or not.</para></listitem>
124 <term><option>-l</option></term>
125 <term><option>--full</option></term>
127 <listitem><para>Do not ellipsize
128 process tree entries.</para>
133 <term><option>--kill-who=</option></term>
135 <listitem><para>When used with
136 <command>kill</command>,
137 choose which processes to kill. Must
138 be one of <option>leader</option>, or
139 <option>all</option> to select whether
140 to kill only the leader process of the
141 machine or all processes of the
142 machine. If omitted, defaults to
143 <option>all</option>.</para></listitem>
147 <term><option>-s</option></term>
148 <term><option>--signal=</option></term>
150 <listitem><para>When used with
151 <command>kill</command>, choose
152 which signal to send to selected
153 processes. Must be one of the
154 well-known signal specifiers, such as
155 <constant>SIGTERM</constant>,
156 <constant>SIGINT</constant> or
157 <constant>SIGSTOP</constant>. If
159 <constant>SIGTERM</constant>.</para></listitem>
163 <term><option>--no-legend</option></term>
165 <listitem><para>Do not print the legend,
166 i.e. the column headers and the
167 footer.</para></listitem>
170 <xi:include href="standard-options.xml" xpointer="help" />
171 <xi:include href="standard-options.xml" xpointer="version" />
172 <xi:include href="standard-options.xml" xpointer="no-pager" />
175 <para>The following commands are understood:</para>
179 <term><command>list</command></term>
181 <listitem><para>List currently running
182 virtual machines and containers.
187 <term><command>status</command> <replaceable>ID</replaceable>...</term>
189 <listitem><para>Show terse runtime
190 status information about one or more
191 virtual machines and containers. This
192 function is intended to generate
193 human-readable output. If you are
194 looking for computer-parsable output,
195 use <command>show</command> instead.
200 <term><command>show</command> <replaceable>ID</replaceable>...</term>
202 <listitem><para>Show properties of one
203 or more registered virtual machines or
204 containers or the manager itself. If
205 no argument is specified, properties
206 of the manager will be shown. If an
207 ID is specified, properties of this
208 virtual machine or container are
209 shown. By default, empty properties
211 <option>--all</option> to show those
212 too. To select specific properties to
214 <option>--property=</option>. This
215 command is intended to be used
216 whenever computer-parsable output is
218 <command>status</command> if you are
219 looking for formatted human-readable
220 output.</para></listitem>
224 <term><command>terminate</command> <replaceable>ID</replaceable>...</term>
226 <listitem><para>Terminates a virtual
227 machine or container. This kills all
228 processes of the virtual machine or
229 container and deallocates all
230 resources attached to that
231 instance.</para></listitem>
235 <term><command>kill</command> <replaceable>ID</replaceable>...</term>
237 <listitem><para>Send a signal to one
238 or more processes of the virtual
239 machine or container. This means
240 processes as seen by the host, not the
241 processes inside the virtual machine
243 Use <option>--kill-who=</option> to
244 select which process to kill. Use
245 <option>--signal=</option> to select
246 the signal to send.</para></listitem>
250 <term><command>reboot</command> <replaceable>ID</replaceable>...</term>
252 <listitem><para>Reboot one or more
253 containers. This will trigger a reboot
254 by sending SIGINT to the container's
255 init process, which is roughly
256 equivalent to pressing Ctrl+Alt+Del on
258 system.</para></listitem>
262 <term><command>login</command> <replaceable>ID</replaceable></term>
264 <listitem><para>Open a terminal login
265 session to a container. This will
266 create a TTY connection to a specific
267 container and asks for the execution of a
268 getty on it. Note that this is only
269 supported for containers running
270 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
271 as init system.</para></listitem>
278 <title>Exit status</title>
280 <para>On success, 0 is returned, a non-zero failure
281 code otherwise.</para>
284 <xi:include href="less-variables.xml" />
287 <title>See Also</title>
289 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
290 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
291 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>