summaryrefslogtreecommitdiffstats
path: root/libexec/container/stop
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-05 06:22:39 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-05 07:27:23 +0000
commita6b3dc088b186db8a43349dc86853c35b1b05530 (patch)
tree79b5242519687c5c625ffd889cf12a2d77851a73 /libexec/container/stop
parentAdding default interactive mode for container stop command. (diff)
downloadcompute-tools-a6b3dc088b186db8a43349dc86853c35b1b05530.tar.xz
compute-tools-a6b3dc088b186db8a43349dc86853c35b1b05530.zip
Renaming force option in container stop command to kill in order to properly separate the three different stop modi (interactive, force, kill).
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/stop15
1 files changed, 11 insertions, 4 deletions
diff --git a/libexec/container/stop b/libexec/container/stop
index 59c8b76..2d81523 100755
--- a/libexec/container/stop
+++ b/libexec/container/stop
@@ -34,8 +34,8 @@ Parameters ()
{
OPTIONS_ALL=""
- GETOPT_LONGOPTIONS="name:,force,interactive,clean,verbose,"
- GETOPT_OPTIONS="n:,f,i,v,"
+ GETOPT_LONGOPTIONS="name:,force,interactive,kill,clean,verbose,"
+ GETOPT_OPTIONS="n:,f,i,k,v,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -69,6 +69,13 @@ Parameters ()
OPTIONS_ALL="${OPTIONS_ALL} --interactive"
;;
+ -k|--kill)
+ KILL="true"
+ shift 1
+
+ OPTIONS_ALL="${OPTIONS_ALL} --kill"
+ ;;
+
--clean)
# internal option
CLEAN="true"
@@ -270,7 +277,7 @@ case "${STATE}" in
;;
esac
-case "${FORCE}" in
+case "${KILL}" in
true)
MODE="terminate"
;;
@@ -306,7 +313,7 @@ esac
machinectl ${MODE} ${NAME}
-case "${FORCE}" in
+case "${KILL}" in
true)
VETHS="$(awk -Fnetwork-veth-extra= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf | awk -F: '{ print $1 }')"