You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluo.apache.org by ct...@apache.org on 2020/12/14 18:16:22 UTC

[fluo-uno] branch main updated: Fixes #262 - 'uno status' shows shell as "secret(pid)" instead of "shell(pid)" (#263)

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

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluo-uno.git


The following commit(s) were added to refs/heads/main by this push:
     new 63e6bdc  Fixes #262 - 'uno status' shows shell as "secret(pid)" instead of "shell(pid)" (#263)
63e6bdc is described below

commit 63e6bdcd48c787341dfa1a02314b53c08309bcc5
Author: Dom G <47...@users.noreply.github.com>
AuthorDate: Mon Dec 14 13:16:13 2020 -0500

    Fixes #262 - 'uno status' shows shell as "secret(pid)" instead of "shell(pid)" (#263)
    
    * converted to pgrep
    * altered script to display correct process name
---
 bin/impl/commands.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/impl/commands.sh b/bin/impl/commands.sh
index 1a9df24..5ca3e90 100755
--- a/bin/impl/commands.sh
+++ b/bin/impl/commands.sh
@@ -261,11 +261,8 @@ EOF
 }
 
 function uno_status_main() {
-  # TODO this should be converted to using pgrep
-  # shellcheck disable=SC2009
-  atmp="$(ps -ef | grep accumulo\\.start | awk '{print $NF "(" $2 ")"}' | tr '\n' ' ')"
-  # shellcheck disable=SC2009
-  htmp="$(ps -ef | grep -e hadoop\\.hdfs -e hadoop\\.yarn | tr '.' ' ' | awk '{print $NF "(" $2 ")"}' | tr '\n' ' ')"
+  atmp="$(pgrep -f accumulo\\.start -a | awk '{pid = $1;for(i=1;i<=NF;i++)if($i=="org.apache.accumulo.start.Main")print $(i+1) "("pid")"}' | tr '\n' ' ')"
+  htmp="$(pgrep -f hadoop\\. -a | tr '.' ' ' | awk '{print $NF "(" $1 ")"}' | tr '\n' ' ')"
   ztmp="$(pgrep -f QuorumPeerMain | awk '{print "zoo(" $1 ")"}' | tr '\n' ' ')"
 
   if [[ -n $atmp || -n $ztmp || -n $htmp ]]; then
@@ -273,7 +270,7 @@ function uno_status_main() {
     [[ -n $ztmp ]] && echo "ZooKeeper processes running: $ztmp"
     [[ -n $htmp ]] && echo "Hadoop processes running: $htmp"
   else
-    echo "No components runnning."
+    echo "No components running."
   fi
 }