add ability to kill off wizard and use sigterm to try to stop containers properly

This commit is contained in:
ryan.kuba 2022-06-29 16:14:35 -04:00
parent 6d025db119
commit 7d6d001436
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,14 @@
#!/usr/bin/with-contenv bash
_term() {
if [ -f "/opt/kasm/bin/stop" ]; then
echo "Caught SIGTERM signal!"
echo "Stopping Kasm Containers"
/opt/kasm/bin/stop
pid=$(pidof stop)
# terminate when the stop process dies
tail --pid=${pid} -f /dev/null
fi
}
exec /usr/local/bin/dockerd-entrypoint.sh -l error --data-root /opt/docker

View file

@ -8,5 +8,10 @@ while true; do
sleep 1
done
# Don't do anything if wizard is disabled
if [ -f "/opt/NO_WIZARD" ]; then
sleep infinity
fi
cd /wizard
/usr/bin/node index.js