Skip to content

Properly grab process names for use in No components running. display - #312

Merged
DomGarguilo merged 1 commit into
apache:mainfrom
DomGarguilo:fixProcNames
Mar 18, 2026
Merged

Properly grab process names for use in No components running. display#312
DomGarguilo merged 1 commit into
apache:mainfrom
DomGarguilo:fixProcNames

Conversation

@DomGarguilo

Copy link
Copy Markdown
Member

This allows uno status to properly display the name of the accumulo process. Without this change, everything appeared with the name proc

Comment thread bin/impl/commands.sh

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.

@DomGarguilo
DomGarguilo merged commit 325be36 into apache:main Mar 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants