Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/impl/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ EOF
}

function uno_status_main() {
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' ' ')"
atmp="$(pgrep -f accumulo\\.start -a | awk '{pid = $1;for(i=1;i<=NF;i++)if($i=="org.apache.accumulo.start.Main"){name=$(i+1);if(name=="proc")name=$(i+2);if(name!="")print name "("pid")"}}' | tr '\n' ' ')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the check for empty string for?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its probably not needed but I added it just in case a malformed command line is found. If for some reason there is nothing after org.apache.accumulo.start.Main or nothing after org.apache.accumulo.start.Main proc this will fail a bit more gracefully. Again, I'm not sure how this might happen I just added it as an extra guard.

htmp="$(pgrep -f hadoop\\. -a | tr '.' ' ' | awk '{print $NF "(" $1 ")"}' | tr '\n' ' ')"
ztmp="$(pgrep -f QuorumPeerMain | awk '{print "zoo(" $1 ")"}' | tr '\n' ' ')"

Expand Down
Loading