You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2019/05/03 16:31:11 UTC

[airavata] branch master updated: Fixing AIRAVATA-2955: Forcefully killing unresponsive processes

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new 8183162  Fixing AIRAVATA-2955: Forcefully killing unresponsive processes
8183162 is described below

commit 8183162556fcfb1ce81257d60f989d4cbbadd911
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri May 3 12:31:03 2019 -0400

    Fixing AIRAVATA-2955: Forcefully killing unresponsive processes
---
 .../resources/controller/bin/controller-daemon.sh  | 22 ++++++++++++++++++++++
 .../email-monitor/bin/email-monitor-daemon.sh      | 22 ++++++++++++++++++++++
 .../resources/parser-wm/bin/parser-wm-daemon.sh    | 22 ++++++++++++++++++++++
 .../participant/bin/participant-daemon.sh          | 22 ++++++++++++++++++++++
 .../bin/platform-monitor-daemon.sh                 | 22 ++++++++++++++++++++++
 .../main/resources/post-wm/bin/post-wm-daemon.sh   | 22 ++++++++++++++++++++++
 .../src/main/resources/pre-wm/bin/pre-wm-daemon.sh | 22 ++++++++++++++++++++++
 .../bin/realtime-monitor-daemon.sh                 | 22 ++++++++++++++++++++++
 8 files changed, 176 insertions(+)

diff --git a/modules/distribution/src/main/resources/controller/bin/controller-daemon.sh b/modules/distribution/src/main/resources/controller/bin/controller-daemon.sh
index 7b5fe08..f970d29 100644
--- a/modules/distribution/src/main/resources/controller/bin/controller-daemon.sh
+++ b/modules/distribution/src/main/resources/controller/bin/controller-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh b/modules/distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
index c87e5be..752a3d2 100644
--- a/modules/distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
+++ b/modules/distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/parser-wm/bin/parser-wm-daemon.sh b/modules/distribution/src/main/resources/parser-wm/bin/parser-wm-daemon.sh
index 228aff7..713ac59 100644
--- a/modules/distribution/src/main/resources/parser-wm/bin/parser-wm-daemon.sh
+++ b/modules/distribution/src/main/resources/parser-wm/bin/parser-wm-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/participant/bin/participant-daemon.sh b/modules/distribution/src/main/resources/participant/bin/participant-daemon.sh
index 00e0ba8..0d3a706 100644
--- a/modules/distribution/src/main/resources/participant/bin/participant-daemon.sh
+++ b/modules/distribution/src/main/resources/participant/bin/participant-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh b/modules/distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
index 684132c..dbeb9ef 100644
--- a/modules/distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
+++ b/modules/distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/post-wm/bin/post-wm-daemon.sh b/modules/distribution/src/main/resources/post-wm/bin/post-wm-daemon.sh
index 93dabb0..bdc0009 100644
--- a/modules/distribution/src/main/resources/post-wm/bin/post-wm-daemon.sh
+++ b/modules/distribution/src/main/resources/post-wm/bin/post-wm-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/pre-wm/bin/pre-wm-daemon.sh b/modules/distribution/src/main/resources/pre-wm/bin/pre-wm-daemon.sh
index 2ec7e31..1b731a6 100644
--- a/modules/distribution/src/main/resources/pre-wm/bin/pre-wm-daemon.sh
+++ b/modules/distribution/src/main/resources/pre-wm/bin/pre-wm-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."
diff --git a/modules/distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh b/modules/distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
index 87f2878..a3a2dd5 100644
--- a/modules/distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
+++ b/modules/distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
@@ -53,6 +53,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stoping ..."
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ..."
             rm $PID_PATH_NAME
         else
@@ -64,6 +75,17 @@ case $1 in
             PID=$(cat $PID_PATH_NAME);
             echo "$SERVICE_NAME stopping ...";
             kill $PID;
+            RETRY=0
+            while kill -0 $PID 2> /dev/null; do
+                echo "Waiting for the process $PID to be stopped"
+                RETRY=`expr ${RETRY} + 1`
+                if [ "${RETRY}" -gt "20" ]
+                then
+                    echo "Forcefully killing the process as it is not responding ..."
+                    kill -9 $PID
+                fi
+                sleep 1
+            done
             echo "$SERVICE_NAME stopped ...";
             rm $PID_PATH_NAME
             echo "$SERVICE_NAME starting ..."