DarkAssassinator commented on code in PR #12118:
URL: https://github.com/apache/dolphinscheduler/pull/12118#discussion_r979265778


##########
script/dolphinscheduler-daemon.sh:
##########
@@ -81,8 +81,26 @@ else
   exit 1
 fi
 
+state=""
+function get_server_running_status() {
+  state="STOP"
+  if [ -f $pid ]; then
+    TARGET_PID=`cat $pid`
+    server_running_count=`ps -p $TARGET_PID --no-headers | wc -l`
+    if [[ $server_running_count -gt 0 ]];then
+      state="RUNNING"
+    fi
+  fi
+}

Review Comment:
   IMHO, i think that pid file may not a good idea, because pid just can keep 
only one process pid
   1. If there are two Master process running at same time, but this status 
function just find one. Becuase if use just call start.sh may start a process 
again.
   2. If user use `kill` command, cannot clear this pid
   3. Some misopeation may clear or modify this pid file. 
   i think the result of using the `ps -ef` check is more accurate and 
reliable. Personal opinion,just for reference.



-- 
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