Skip to content

Commit

Permalink
Gracefully shutdown the cluster when the container stops
Browse files Browse the repository at this point in the history
  • Loading branch information
geigi committed Oct 16, 2020
1 parent 575bf11 commit ee90cf8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion start-gnt-rapi.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/bin/bash

su --preserve-environment -s /bin/bash -c '/usr/bin/python /usr/sbin/ganeti-rapi --debug -b 0.0.0.0 -f' gnt-rapi
cleanup() {
echo "Stopping Cluster..."
/opt/ganeti-vcluster/stop-all
}

trap 'true' SIGTERM

su --preserve-environment -s /bin/bash -c '/usr/bin/python /usr/sbin/ganeti-rapi --debug -b 0.0.0.0 -f' gnt-rapi &

wait $!

cleanup

0 comments on commit ee90cf8

Please sign in to comment.