Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1563

Change subject: Remove Usages Of Jps To Enable Testing With JRE
......................................................................

Remove Usages Of Jps To Enable Testing With JRE

Change-Id: Iddb52d2a2696c8c43af92fda9b6806d9798bf881
---
M asterixdb/asterix-app/scripts/asterix/stopcc.sh
M asterixdb/asterix-app/scripts/asterix/stopnc.sh
M asterixdb/asterix-app/scripts/idefix/stopallncs.sh
M asterixdb/asterix-app/scripts/idefix/stopcc.sh
M asterixdb/asterix-app/scripts/rainbow/stopcc.sh
M asterixdb/asterix-app/scripts/rainbow/stopnc.sh
M asterixdb/asterix-events/src/main/resources/events/node_failure/nc_failure.sh
M 
asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java
M 
asterixdb/asterix-experiments/src/main/resources/ingestion-experiment-binary-and-configs/killdrivers.sh
M asterixdb/asterix-installer/src/main/resources/zookeeper/stop_zk
M 
asterixdb/asterix-installer/src/test/resources/integrationts/restart/scripts/feed-restart/issue-1636/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_index_only/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_default_secondary_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_ngram_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index_insert_and_delete/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_index_only/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_default_secondary_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_ngram_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_rtree_index/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataset_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/datatype_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataverse_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/delete_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/function_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/insert_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/load_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/secondary_index_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_dataset_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_delete_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_insert_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_load_after_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_secondary_index_recovery/kill_cc_and_nc.sh
M 
asterixdb/asterix-installer/src/test/resources/transactionts/scripts/setup_teardown/kill_cc_and_nc.sh
M asterixdb/asterix-replication/src/test/resources/scripts/kill_cc_and_nc.sh
M asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
M asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
42 files changed, 52 insertions(+), 51 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/63/1563/1

diff --git a/asterixdb/asterix-app/scripts/asterix/stopcc.sh 
b/asterixdb/asterix-app/scripts/asterix/stopcc.sh
index f618f90..2ae9aa3 100644
--- a/asterixdb/asterix-app/scripts/asterix/stopcc.sh
+++ b/asterixdb/asterix-app/scripts/asterix/stopcc.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/local/java/vms/java/bin/jps | grep CCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*CCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git a/asterixdb/asterix-app/scripts/asterix/stopnc.sh 
b/asterixdb/asterix-app/scripts/asterix/stopnc.sh
index aea6f17..640a44f 100644
--- a/asterixdb/asterix-app/scripts/asterix/stopnc.sh
+++ b/asterixdb/asterix-app/scripts/asterix/stopnc.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/local/java/vms/java/bin/jps | grep NCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*NCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git a/asterixdb/asterix-app/scripts/idefix/stopallncs.sh 
b/asterixdb/asterix-app/scripts/idefix/stopallncs.sh
index c02827c..640a44f 100644
--- a/asterixdb/asterix-app/scripts/idefix/stopallncs.sh
+++ b/asterixdb/asterix-app/scripts/idefix/stopallncs.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/bin/jps | grep NCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*NCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git a/asterixdb/asterix-app/scripts/idefix/stopcc.sh 
b/asterixdb/asterix-app/scripts/idefix/stopcc.sh
index 261acce..2ae9aa3 100644
--- a/asterixdb/asterix-app/scripts/idefix/stopcc.sh
+++ b/asterixdb/asterix-app/scripts/idefix/stopcc.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/bin/jps | grep CCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*CCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git a/asterixdb/asterix-app/scripts/rainbow/stopcc.sh 
b/asterixdb/asterix-app/scripts/rainbow/stopcc.sh
index f618f90..2ae9aa3 100644
--- a/asterixdb/asterix-app/scripts/rainbow/stopcc.sh
+++ b/asterixdb/asterix-app/scripts/rainbow/stopcc.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/local/java/vms/java/bin/jps | grep CCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*CCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git a/asterixdb/asterix-app/scripts/rainbow/stopnc.sh 
b/asterixdb/asterix-app/scripts/rainbow/stopnc.sh
index aea6f17..640a44f 100644
--- a/asterixdb/asterix-app/scripts/rainbow/stopnc.sh
+++ b/asterixdb/asterix-app/scripts/rainbow/stopnc.sh
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-PID=`/usr/local/java/vms/java/bin/jps | grep NCDriver | awk '{print $1}'`
+PID=`ps -ef | grep java.*NCDriver | awk '{print $2}'`
 
 echo $PID
 kill -9 $PID
diff --git 
a/asterixdb/asterix-events/src/main/resources/events/node_failure/nc_failure.sh 
b/asterixdb/asterix-events/src/main/resources/events/node_failure/nc_failure.sh
index 39a51db..9b0dcbb 100644
--- 
a/asterixdb/asterix-events/src/main/resources/events/node_failure/nc_failure.sh
+++ 
b/asterixdb/asterix-events/src/main/resources/events/node_failure/nc_failure.sh
@@ -25,10 +25,10 @@
 PID=`echo $PID_INFO | cut -d " " -f2`
 kill -15 $PID
 
-cmd_output=$(jps|grep "^$PID\s")
+cmd_output=$(ps -ef | awk '{print $2}' |grep "^$PID$")
 while [ ${#cmd_output} -ne 0 ]
 do
   sleep 1
   kill -15 $PID
-  cmd_output=$(jps|grep "^$PID\s")
+  cmd_output=$(ps -ef | awk '{print $2}' |grep "^$PID$")
 done
diff --git 
a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java
 
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java
index 44408e7..8425da7 100644
--- 
a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java
+++ 
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/action/derived/RemoteAsterixDriverKill.java
@@ -27,7 +27,8 @@
 
     @Override
     protected String getCommand() {
-        return "jps | awk '{if ($2 == \"NCDriver\" || $2 == \"CCDriver\") 
print $1;}' | xargs -n 1 kill -9";
+        return "ps -ef | grep 
'java.*org\\.apache\\.hyracks\\.control\\.[cn]c\\.[CN]CDriver' | awk '{print 
$2}' " +
+                "| xargs -n 1 kill -9";
     }
 
 }
diff --git 
a/asterixdb/asterix-experiments/src/main/resources/ingestion-experiment-binary-and-configs/killdrivers.sh
 
b/asterixdb/asterix-experiments/src/main/resources/ingestion-experiment-binary-and-configs/killdrivers.sh
index 9e1e7b0..b9fed96 100644
--- 
a/asterixdb/asterix-experiments/src/main/resources/ingestion-experiment-binary-and-configs/killdrivers.sh
+++ 
b/asterixdb/asterix-experiments/src/main/resources/ingestion-experiment-binary-and-configs/killdrivers.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-jps | grep Driver | awk '{print $1}' | xargs kill -9
+ps -ef | grep java.*Driver | awk '{print $2}' | xargs kill -9
diff --git a/asterixdb/asterix-installer/src/main/resources/zookeeper/stop_zk 
b/asterixdb/asterix-installer/src/main/resources/zookeeper/stop_zk
index 598ba27..5428ff3 100644
--- a/asterixdb/asterix-installer/src/main/resources/zookeeper/stop_zk
+++ b/asterixdb/asterix-installer/src/main/resources/zookeeper/stop_zk
@@ -21,5 +21,5 @@
 shift 1
 for zk_host in  $@
 do
-  ssh $zk_host "kill -15 `jps | grep QuorumPeerMain | cut -d " "  -f1`" &
+  ssh $zk_host "kill -15 `ps -ef | grep java.*QuorumPeerMain | awk '{print 
$2}'`" &
 done
diff --git 
a/asterixdb/asterix-installer/src/test/resources/integrationts/restart/scripts/feed-restart/issue-1636/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/integrationts/restart/scripts/feed-restart/issue-1636/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/integrationts/restart/scripts/feed-restart/issue-1636/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/integrationts/restart/scripts/feed-restart/issue-1636/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_index_only/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_index_only/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_index_only/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_index_only/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_default_secondary_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_default_secondary_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_default_secondary_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_default_secondary_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_ngram_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_ngram_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_ngram_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_ngram_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index_insert_and_delete/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index_insert_and_delete/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index_insert_and_delete/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/primary_plus_rtree_index_insert_and_delete/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_index_only/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_index_only/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_index_only/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_index_only/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_default_secondary_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_default_secondary_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_default_secondary_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_default_secondary_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_keyword_secondary_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_multiple_secondary_indices/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_ngram_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_ngram_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_ngram_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_ngram_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_rtree_index/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_rtree_index/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_rtree_index/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recover_after_abort/temp_primary_plus_rtree_index/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataset_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataset_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataset_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataset_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/datatype_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/datatype_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/datatype_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/datatype_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataverse_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataverse_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataverse_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/dataverse_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/delete_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/delete_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/delete_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/delete_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/function_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/function_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/function_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/function_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/insert_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/insert_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/insert_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/insert_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/load_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/load_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/load_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/load_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/secondary_index_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/secondary_index_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/secondary_index_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/secondary_index_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_dataset_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_dataset_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_dataset_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_dataset_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_delete_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_delete_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_delete_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_delete_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_insert_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_insert_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_insert_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_insert_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_load_after_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_load_after_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_load_after_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_load_after_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_secondary_index_recovery/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_secondary_index_recovery/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_secondary_index_recovery/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/recovery_ddl/temp_secondary_index_recovery/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/setup_teardown/kill_cc_and_nc.sh
 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/setup_teardown/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- 
a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/setup_teardown/kill_cc_and_nc.sh
+++ 
b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/setup_teardown/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-replication/src/test/resources/scripts/kill_cc_and_nc.sh 
b/asterixdb/asterix-replication/src/test/resources/scripts/kill_cc_and_nc.sh
index 2582713..7e4dcc3 100755
--- a/asterixdb/asterix-replication/src/test/resources/scripts/kill_cc_and_nc.sh
+++ b/asterixdb/asterix-replication/src/test/resources/scripts/kill_cc_and_nc.sh
@@ -15,4 +15,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 
kill -9
+ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.[CN]CDriver' | awk 
'{print $2}' | xargs -n 1 kill -9
diff --git 
a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh 
b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
index d702e8a..4db0770 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
@@ -67,7 +67,7 @@
 $INSTALLDIR/bin/${HELPER_COMMAND} get_cluster_state -quiet \
     && echo "ERROR: sample cluster address (localhost:${LISTEN_PORT}) already 
in use" && exit 1
 
-if $JAVA_HOME/bin/jps | grep ' \(CCDriver\|NCDriver\|NCService\)$' > 
/tmp/$$_jps; then
+if ps -ef | grep 
'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)'
 > /tmp/$$_pids; then
   if [ $force ]; then
     severity=WARNING
   else
@@ -80,13 +80,13 @@
     echo "aborting"
     echo
     echo "Re-run with -f to ignore, or run stop-sample-cluster.sh -f to 
forcibly terminate all running ${PRODUCT} processes:"
-    cat /tmp/$$_jps | sed 's/^/  - /'
-    rm /tmp/$$_jps
+    cat /tmp/pids |  sed 's/^ *[0-9]* 
\([0-9]*\).*org\.apache\.hyracks\.control\.[cn]c[^ ]*\.\([^ ]*\) .*/\1 - \2/'
+    rm /tmp/$$_pids
     exit 1
   fi
 fi
 
-rm /tmp/$$_jps
+rm /tmp/$$_pids
 (
   echo "--------------------------"
   date
diff --git 
a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh 
b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
index 7ee5fdf..4ba5789 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
@@ -62,7 +62,7 @@
   first=1
   tries=0
   echo -n "INFO: Waiting up to 60s for cluster to shutdown"
-  while [ -n "$($JAVA_HOME/bin/jps | awk '/ (CCDriver|NCDriver|NCService)$/')" 
]; do
+  while [ -n "$(ps -ef | grep 
'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)')"
 ]; do
     if [ $tries -ge 60 ]; then
       echo "...timed out!"
       break
@@ -76,18 +76,18 @@
   echo "WARNING: sample cluster does not appear to be running"
 fi
 
-if $JAVA_HOME/bin/jps | grep ' \(CCDriver\|NCDriver\|NCService\)$' > 
/tmp/$$_jps; then
+if ps -ef | grep 
'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)'
 > /tmp/$$_pids; then
   echo -n "WARNING: ${PRODUCT} processes remain after cluster shutdown; "
   if [ $force ]; then
     echo "-f[orce] specified, forcibly terminating ${PRODUCT} processes:"
-    cat /tmp/$$_jps | while read line; do
+    cat /tmp/$$_pids | while read line; do
       echo -n "   - $line..."
-      echo $line | awk '{ print $1 }' | xargs -n1 kill -9
+      echo $line | awk '{ print $2 }' | xargs -n1 kill -9
       echo "killed"
     done
   else
     echo "re-run with -f|-force to forcibly terminate all ${PRODUCT} 
processes:"
-    cat /tmp/$$_jps | sed 's/^/  - /'
+    cat /tmp/pids |  sed 's/^ *[0-9]* 
\([0-9]*\).*org\.apache\.hyracks\.control\.[cn]c[^ ]*\.\([^ ]*\) .*/\1 - \2/'
   fi
 fi
-rm /tmp/$$_jps
+rm /tmp/$$_pids

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1563
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddb52d2a2696c8c43af92fda9b6806d9798bf881
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>

Reply via email to