summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-05 06:24:51 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-06-05 07:39:45 +0000
commit549e741c38b7d8e5f665b287511a513928d10552 (patch)
treed0a5f2428d73fc637ada5c7c0d5be9afe609bcce /libexec
parentRenaming force option in container stop command to kill in order to properly ... (diff)
downloadcompute-tools-549e741c38b7d8e5f665b287511a513928d10552.tar.xz
compute-tools-549e741c38b7d8e5f665b287511a513928d10552.zip
Tracking container state in run files in /var/lib/compute-tools.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/container/start3
-rwxr-xr-xlibexec/container/stop3
2 files changed, 6 insertions, 0 deletions
diff --git a/libexec/container/start b/libexec/container/start
index 7b95866..1f22325 100755
--- a/libexec/container/start
+++ b/libexec/container/start
@@ -556,6 +556,9 @@ case "${START}" in
;;
esac
+ mkdir -p "/var/lib/${SOFTWARE}/state"
+ echo "start" > "/var/lib/${SOFTWARE}/state/${NAME}.run"
+
${SETARCH} systemd-nspawn --keep-unit ${BIND} ${BIND_RO} ${BOOT} ${CAPABILITY} ${DIRECTORY} ${DROP_CAPABILITY} ${MACHINE} ${NETWORK_VETH_EXTRA} ${LINK_JOURNAL} ${REGISTER}
case "${VERBOSE}" in
diff --git a/libexec/container/stop b/libexec/container/stop
index 2d81523..793b323 100755
--- a/libexec/container/stop
+++ b/libexec/container/stop
@@ -326,6 +326,9 @@ case "${KILL}" in
;;
esac
+mkdir -p "/var/lib/${SOFTWARE}/state"
+echo "stop" > "/var/lib/${SOFTWARE}/state/${NAME}.run"
+
case "${VERBOSE}" in
true)
echo " done."