Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 571bcffa2 -> d5558d3c8


MINIFICPP-522 - more robust minifi.sh stop command

This closes #361.

Signed-off-by: Marc Parisi <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/d5558d3c
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/d5558d3c
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/d5558d3c

Branch: refs/heads/master
Commit: d5558d3c8abb475f16149462533d0a7721b4854e
Parents: 571bcff
Author: Dustin Rodrigues <[email protected]>
Authored: Wed Jun 20 00:11:44 2018 -0400
Committer: Marc Parisi <[email protected]>
Committed: Mon Jun 25 10:31:09 2018 -0400

----------------------------------------------------------------------
 bin/minifi.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d5558d3c/bin/minifi.sh
----------------------------------------------------------------------
diff --git a/bin/minifi.sh b/bin/minifi.sh
index 4fc7123..8c4d1ff 100755
--- a/bin/minifi.sh
+++ b/bin/minifi.sh
@@ -81,8 +81,12 @@ get_pid() {
 # Performs a check to see if the provided pid is one that currently exists
 active_pid() {
   pid=${1}
-  kill -s 0 ${pid} > /dev/null 2>&1
-  echo $?
+  if [ ${pid} -eq -1 ]; then
+    echo 1
+  else
+    kill -s 0 ${pid} > /dev/null 2>&1
+    echo $?
+  fi
 }
 
 install() {
@@ -148,8 +152,12 @@ get_pid() {
 # Performs a check to see if the provided pid is one that currently exists
 active_pid() {
   pid=\${1}
-  kill -s 0 \${pid} > /dev/null 2>&1
-  echo \$?
+  if [ \${pid} -eq -1 ]; then
+    echo 1
+  else
+    kill -s 0 \${pid} > /dev/null 2>&1
+    echo \$?
+  fi
 }
 
 saved_pid=\$(get_pid)

Reply via email to