diff --git a/ci3/aws_handle_evict b/ci3/aws_handle_evict index bc0d6f07eabc..c38c9251a8db 100755 --- a/ci3/aws_handle_evict +++ b/ci3/aws_handle_evict @@ -19,7 +19,8 @@ while true; do if curl -fs -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/spot/termination-time &>/dev/null; then # Termination notice found, exit with 155. echo "Spot will be terminated! Exiting early." - fuser /dev/stdin /dev/stdout /dev/stderr 2>/dev/null | tr -s ' ' '\n' | grep -v $$ | xargs -r kill -9 + pids=$(fuser /dev/stdin /dev/stdout 2>/dev/null) + echo "$pids" | tr -s ' ' '\n' | grep -v $$ | xargs -r kill -9 exit 155 fi done