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>-p</option></term>
77 <term><option>--property=</option></term>
79 <listitem><para>When showing
80 machine properties, limit the
81 output to certain properties as
82 specified by the argument. If not
83 specified, all set properties are
84 shown. The argument should be a
85 property name, such as
86 <literal>Name</literal>. If
87 specified more than once, all
88 properties with the specified names
89 are shown.</para></listitem>
93 <term><option>-a</option></term>
94 <term><option>--all</option></term>
96 <listitem><para>When showing
97 machine properties, show all
98 properties regardless of whether they are
99 set or not.</para></listitem>
103 <term><option>-l</option></term>
104 <term><option>--full</option></term>
106 <listitem><para>Do not ellipsize
107 process tree entries.</para>
112 <term><option>--kill-who=</option></term>
114 <listitem><para>When used with
115 <command>kill</command>,
116 choose which processes to kill. Must
117 be one of <option>leader</option>, or
118 <option>all</option> to select whether
119 to kill only the leader process of the
120 machine or all processes of the
121 machine. If omitted, defaults to
122 <option>all</option>.</para></listitem>
126 <term><option>-s</option></term>
127 <term><option>--signal=</option></term>
129 <listitem><para>When used with
130 <command>kill</command>, choose
131 which signal to send to selected
132 processes. Must be one of the
133 well-known signal specifiers, such as
134 <constant>SIGTERM</constant>,
135 <constant>SIGINT</constant> or
136 <constant>SIGSTOP</constant>. If
138 <constant>SIGTERM</constant>.</para></listitem>
142 <term><option>--no-legend</option></term>
144 <listitem><para>Do not print the legend,
145 i.e. the column headers and the
146 footer.</para></listitem>
149 <xi:include href="user-system-options.xml" xpointer="host" />
150 <xi:include href="user-system-options.xml" xpointer="machine" />
152 <xi:include href="standard-options.xml" xpointer="help" />
153 <xi:include href="standard-options.xml" xpointer="version" />
154 <xi:include href="standard-options.xml" xpointer="no-pager" />
157 <para>The following commands are understood:</para>
161 <term><command>list</command></term>
163 <listitem><para>List currently running
164 virtual machines and containers.
169 <term><command>status</command> <replaceable>ID</replaceable>...</term>
171 <listitem><para>Show terse runtime
172 status information about one or more
173 virtual machines and containers. This
174 function is intended to generate
175 human-readable output. If you are
176 looking for computer-parsable output,
177 use <command>show</command> instead.
182 <term><command>show</command> <replaceable>ID</replaceable>...</term>
184 <listitem><para>Show properties of one
185 or more registered virtual machines or
186 containers or the manager itself. If
187 no argument is specified, properties
188 of the manager will be shown. If an
189 ID is specified, properties of this
190 virtual machine or container are
191 shown. By default, empty properties
193 <option>--all</option> to show those
194 too. To select specific properties to
196 <option>--property=</option>. This
197 command is intended to be used
198 whenever computer-parsable output is
200 <command>status</command> if you are
201 looking for formatted human-readable
202 output.</para></listitem>
206 <term><command>login</command> <replaceable>ID</replaceable></term>
208 <listitem><para>Open a terminal login
209 session to a container. This will
210 create a TTY connection to a specific
211 container and asks for the execution of a
212 getty on it. Note that this is only
213 supported for containers running
214 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
215 as init system.</para></listitem>
219 <term><command>reboot</command> <replaceable>ID</replaceable>...</term>
221 <listitem><para>Reboot one or more
222 containers. This will trigger a reboot
223 by sending SIGINT to the container's
224 init process, which is roughly
225 equivalent to pressing Ctrl+Alt+Del on
226 a non-containerized system, and is
227 compatible with containers running any
228 init system.</para></listitem>
232 <term><command>poweroff</command> <replaceable>ID</replaceable>...</term>
234 <listitem><para>Power off one or more
235 containers. This will trigger a reboot
236 by sending SIGRTMIN+4 to the
237 container's init process, which causes
238 systemd-compatible init systems to
239 shut down cleanly. This operation does
240 not work on containers that do not run
242 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>-compatible
244 sysvinit.</para></listitem>
248 <term><command>kill</command> <replaceable>ID</replaceable>...</term>
250 <listitem><para>Send a signal to one
251 or more processes of the virtual
252 machine or container. This means
253 processes as seen by the host, not the
254 processes inside the virtual machine
256 Use <option>--kill-who=</option> to
257 select which process to kill. Use
258 <option>--signal=</option> to select
259 the signal to send.</para></listitem>
263 <term><command>terminate</command> <replaceable>ID</replaceable>...</term>
265 <listitem><para>Terminates a virtual
266 machine or container. This kills all
267 processes of the virtual machine or
268 container and deallocates all
269 resources attached to that
270 instance.</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>