Created
June 27, 2019 01:21
-
-
Save jerry-sl/8c121fe5b8bef46270a3af52f4ece264 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
pid=`ps -ef |grep binary_name |grep -v grep |awk '{print $2}'` | |
if [ -n "$pid" ]; then | |
kill -15 $pid | |
echo "The process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently..." | |
sleep 1 | |
else | |
echo "binary_name process killed successfully!" | |
break | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment