Commit 72e8cb67 by Chavee Issariyapat

do not check pid when leaving cluster

parent e5faebb8
...@@ -122,12 +122,13 @@ siguser1_handler() { ...@@ -122,12 +122,13 @@ siguser1_handler() {
# SIGTERM-handler # SIGTERM-handler
sigterm_handler() { sigterm_handler() {
echo "Stopping VerneMQ Pod... VerneMQ@${IP_ADDRESS} " echo "Stopping VerneMQ Pod... VerneMQ@${IP_ADDRESS} "
if [[ $pid -ne 0 ]]; then echo "VerneMQ PID = ${pid}"
#if [[ $pid -ne 0 ]]; then
echo "Leaving cluster..." echo "Leaving cluster..."
# this will stop the VerneMQ process # this will stop the VerneMQ process
vmq-admin cluster leave node=VerneMQ@$IP_ADDRESS -k > /dev/null vmq-admin cluster leave node=VerneMQ@$IP_ADDRESS -k > /dev/null
wait "$pid" wait "$pid"
fi #fi
exit 143; # 128 + 15 -- SIGTERM exit 143; # 128 + 15 -- SIGTERM
} }
...@@ -150,5 +151,5 @@ touch /var/log/vernemq/console.log ...@@ -150,5 +151,5 @@ touch /var/log/vernemq/console.log
while true while true
do do
tail -f /var/log/vernemq/console.log & wait ${!} tail -f /var/log/vernemq/console.log & wait ${!}
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment