ddanielr commented on code in PR #5502:
URL: https://github.com/apache/accumulo/pull/5502#discussion_r2223672952


##########
assemble/bin/accumulo-service:
##########
@@ -215,9 +225,20 @@ function kill_service() {
 function list_processes() {
   local service_type=$1
   find_processes "$service_type"
-  echo "Currently running ${service_type} processes:"
+  echo "Currently running ${service_type} processes (fields: process pid 
port):"
   for process in "${RUNNING_PROCESSES[@]}"; do
-    echo "$process"
+    local pid_file
+    local pid
+    local port
+    pid_file="${ACCUMULO_PID_DIR}/accumulo-${process}.pid"
+    pid=$(<"$pid_file")
+    port=$(netstat -tnlp 2>/dev/null | grep "$pid" | awk '{print $4}' | awk -F 
':' '{print $NF}' | paste -sd "," -)

Review Comment:
   Switched to using `ss` vs `netstat` as it's more likely to be installed by 
default. 
   Also, `ss` presents a slightly better match output for pids 
`users:(("java",pid=640697,fd=415))` so I updated the grep -F statement to 
check for `pid=$pid,` in #5750



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to