]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machinectl: Added stop as alias for poweroff (#3406)
authorChristian Rebischke <Chris.Rebischke@posteo.de>
Mon, 6 Jun 2016 15:06:20 +0000 (17:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 Jun 2016 15:06:20 +0000 (17:06 +0200)
man/machinectl.xml
shell-completion/bash/machinectl
shell-completion/zsh/_machinectl
src/machine/machinectl.c

index 4b7f9a0391817b71b250b59e155a6dd67b665908..d3891332e40507409d1370875b75a8ef7f0c511b 100644 (file)
         <para>To interactively start a container on the command line
         with full access to the container's console, please invoke
         <command>systemd-nspawn</command> directly. To stop a running
-        container use <command>machinectl poweroff</command>, see
-        below.</para></listitem>
+        container use <command>machinectl poweroff</command>.</para></listitem>
       </varlistentry>
 
       <varlistentry>
         <listitem><para>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
+        down cleanly. Use <command>stop</command> as alias for <command>poweroff</command>.
+        This operation does not work on containers that do not run a
         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>-compatible
         init system, such as sysvinit. Use
         <command>terminate</command> (see below) to immediately
index e7829ca968f68eb44d6cc55f6b349d2e7c9bf7d9..aebe48304da4aaeaf1346a6196da9fcb8b7fe1fe 100644 (file)
@@ -41,7 +41,7 @@ _machinectl() {
 
         local -A VERBS=(
                [STANDALONE]='list list-images pull-tar pull-raw import-tar import-raw export-tar export-raw list-transfers cancel-transfer'
-                 [MACHINES]='status show start login shell enable disable poweroff reboot terminate kill copy-to copy-from image-status show-image clone rename read-only remove set-limit'
+                 [MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill copy-to copy-from image-status show-image clone rename read-only remove set-limit'
         )
 
         _init_completion || return
index 198fa28f7b3720da78e0e78200ea14eb677177c9..92d77109a5b70f1696e36861d394ab787c3b44dc 100644 (file)
@@ -23,6 +23,7 @@ _available_machines() {
     "status:Show VM/container status"
     "show:Show properties of one or more VMs/containers"
     "start:Start container as a service"
+    "stop:Stop container (equal to poweroff)"
     "login:Get a login prompt on a VM/container"
     "enable:Enable automatic container start at boot"
     "disable:Disable automatic container start at boot"
index 8e4ffa9a394a3cc2af557507839b8773eece29a7..afe50263736bf18e7adb95aaabc0afb976f54c6d 100644 (file)
@@ -2720,6 +2720,7 @@ static int machinectl_main(int argc, char *argv[], sd_bus *bus) {
                 { "terminate",       2,        VERB_ANY, 0,            terminate_machine },
                 { "reboot",          2,        VERB_ANY, 0,            reboot_machine    },
                 { "poweroff",        2,        VERB_ANY, 0,            poweroff_machine  },
+                { "stop",            2,        VERB_ANY, 0,            poweroff_machine  }, /* Convenience alias */
                 { "kill",            2,        VERB_ANY, 0,            kill_machine      },
                 { "login",           VERB_ANY, 2,        0,            login_machine     },
                 { "shell",           VERB_ANY, VERB_ANY, 0,            shell_machine     },