diff --git a/start-gnt-rapi.sh b/start-gnt-rapi.sh index 9658efc..515780c 100755 --- a/start-gnt-rapi.sh +++ b/start-gnt-rapi.sh @@ -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