ruanwenjun commented on code in PR #11182:
URL: https://github.com/apache/dolphinscheduler/pull/11182#discussion_r948023668


##########
script/dolphinscheduler-daemon.sh:
##########
@@ -113,19 +108,19 @@ case $startStop in
       ;;
 
   (status)
-    # more details about the status can be added later
-    serverCount=`ps -ef | grep "$DOLPHINSCHEDULER_HOME" | grep "$CLASS" | grep 
-v "grep" | wc -l`
-    state="STOP"
-    #  font color - red
-    state="[ \033[1;31m $state \033[0m ]"
-    if [[ $serverCount -gt 0 ]];then
-      state="RUNNING"
-      # font color - green
-      state="[ \033[1;32m $state \033[0m ]"
-    fi
-    echo -e "$command  $state"
-    ;;
-
+      state="STOP"
+      state="[ \033[1;31m $state \033[0m ]"
+      if [ -f $pid ]; then
+        TARGET_PID=`cat $pid`
+        serverCount=`ps -p $TARGET_PID | wc -l`
+        if [[ $serverCount -gt 1 ]];then
+          state="RUNNING"
+          state="[ \033[1;32m $state \033[0m ]"
+        fi
+      echo -e "$command  $state"
+      fi
+      ;;
+      

Review Comment:
   This change is want to used the pid as filter rather than use the process 
name.
   If the pid file has been deleted, this method may return an incorrect status.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to