Index · Directives · Python · libudev · gudev systemd 217

Name

machinectl — Control the systemd machine manager

Synopsis

machinectl [OPTIONS...] {COMMAND} [NAME...]

Description

machinectl may be used to introspect and control the state of the systemd(1) virtual machine and container registration manager systemd-machined.service(8).

Options

The following options are understood:

-p, --property=

When showing machine properties, limit the output to certain properties as specified by the argument. If not specified, all set properties are shown. The argument should be a property name, such as "Name". If specified more than once, all properties with the specified names are shown.

-a, --all

When showing machine properties, show all properties regardless of whether they are set or not.

-l, --full

Do not ellipsize process tree entries.

--kill-who=

When used with kill, choose which processes to kill. Must be one of leader, or all to select whether to kill only the leader process of the machine or all processes of the machine. If omitted, defaults to all.

-s, --signal=

When used with kill, choose which signal to send to selected processes. Must be one of the well-known signal specifiers, such as SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.

--no-legend

Do not print the legend, i.e. the column headers and the footer.

-H, --host=

Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST.

-M, --machine=

Execute operation on a local container. Specify a container name to connect to.

-h, --help

Print a short help text and exit.

--version

Print a short version string and exit.

--no-pager

Do not pipe output into a pager.

The following commands are understood:

list

List currently running virtual machines and containers.

status ID...

Show terse runtime status information about one or more virtual machines and containers. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show instead.

show ID...

Show properties of one or more registered virtual machines or containers or the manager itself. If no argument is specified, properties of the manager will be shown. If an ID is specified, properties of this virtual machine or container are shown. By default, empty properties are suppressed. Use --all to show those too. To select specific properties to show, use --property=. This command is intended to be used whenever computer-parsable output is required. Use status if you are looking for formatted human-readable output.

login ID

Open a terminal login session to a container. This will create a TTY connection to a specific container and asks for the execution of a getty on it. Note that this is only supported for containers running systemd(1) as init system.

reboot ID...

Reboot one or more containers. This will trigger a reboot by sending SIGINT to the container's init process, which is roughly equivalent to pressing Ctrl+Alt+Del on a non-containerized system, and is compatible with containers running any init system.

poweroff ID...

Power off one or more containers. This will trigger a reboot by sending SIGRTMIN+4 to the container's init process, which causes systemd-compatible init systems to shut down cleanly. This operation does not work on containers that do not run a systemd(1)-compatible init system, such as sysvinit.

kill ID...

Send a signal to one or more processes of the virtual machine or container. This means processes as seen by the host, not the processes inside the virtual machine or container. Use --kill-who= to select which process to kill. Use --signal= to select the signal to send.

terminate ID...

Terminates a virtual machine or container. This kills all processes of the virtual machine or container and deallocates all resources attached to that instance.

Exit status

On success, 0 is returned, a non-zero failure code otherwise.

Environment

$SYSTEMD_PAGER

Pager to use when --no-pager is not given; overrides $PAGER. Setting this to an empty string or the value "cat" is equivalent to passing --no-pager.

$SYSTEMD_LESS

Override the default options passed to less ("FRSXMK").

See Also

systemd-machined.service(8), systemd-nspawn(1), systemd.special(7)