Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: only terminate vtadmin if it was started #13433

Merged
merged 14 commits into from
Jul 5, 2023
7 changes: 6 additions & 1 deletion examples/common/scripts/vtadmin-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ function stop_vtadmin() {

mattlord marked this conversation as resolved.
Show resolved Hide resolved
if [[ -e "$file" ]]; then
echo "Stopping $name..."
kill -9 "$(cat "$file")"
local pid=$(cat "$file")
kill $pid
# Wait for the process to terminate
while ps -p $pid > /dev/null; do
jfg956 marked this conversation as resolved.
Show resolved Hide resolved
sleep 1
done
else
echo "Skipping stopping $name because no pid file."
fi
Expand Down