diff options
author | 2015-04-19 20:00:26 +0000 | |
---|---|---|
committer | 2015-04-19 20:00:26 +0000 | |
commit | e1d29739ccbc6efc20f400636a211dae0e75bff4 (patch) | |
tree | aedcf6421c126d56442223eb3f177ceb374a4271 | |
parent | 3e8a9a0eb41ae8d415eed0d1dc193532cda1406f (diff) | |
parent | f859b09dae82edb605ece5e2c4db03a48ea83a97 (diff) |
Merge "Correction of the auto-kill during deploy"
-rwxr-xr-x | fuel/prototypes/libvirt/deploy/deploy.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fuel/prototypes/libvirt/deploy/deploy.sh b/fuel/prototypes/libvirt/deploy/deploy.sh index 5d267e6..ba7f7cd 100755 --- a/fuel/prototypes/libvirt/deploy/deploy.sh +++ b/fuel/prototypes/libvirt/deploy/deploy.sh @@ -21,9 +21,14 @@ deployiso=${tmpdir}/deploy.iso exit_handler() { # Remove safety catch - kill $killpid + kill -9 `ps -p $killpid -o pid --no-headers` \ + `ps --ppid $killpid -o pid --no-headers`\ + > /dev/null 2>&1 } +# Set maximum allowed deploy time (default three hours) +MAXDEPLOYTIME=${MAXDEPLOYTIME-3h} + ####### MAIN ######## if [ "`whoami`" != "root" ]; then @@ -59,14 +64,14 @@ if [ ! -f $deafile ]; then fi -# Enable safety catch at three hours -(sleep 3h; kill $$) & +# Enable safety catch +echo "Enabling auto-kill if deployment exceeds $MAXDEPLOYTIME" +(sleep $MAXDEPLOYTIME; echo "Auto-kill of deploy after a timeout of $MAXDEPLOYTIME"; kill $$) & killpid=$! # Enable exit handler trap exit_handler exit - # Stop all VMs for node in controller1 controller2 controller3 compute4 compute5 fuel-master do |