提交 e840bbf7 编写于 作者: U Ufuk Celebi

[FLINK-3517] [dist] Only count active PIDs in start script

This closes #1716.
上级 49069823
......@@ -85,8 +85,16 @@ case $STARTSTOP in
# Print a warning if daemons are already running on host
if [ -f $pid ]; then
count=$(wc -l $pid | awk '{print $1}')
echo "[WARNING] $count instance(s) of $DAEMON are already running on $HOSTNAME."
active=()
while IFS='' read -r p || [[ -n "$p" ]]; do
kill -0 $p >/dev/null 2>&1
if [ $? -eq 0 ]; then
active+=($p)
fi
done < "${pid}"
count="${#active[@]}"
echo "[INFO] $count instance(s) of $DAEMON are already running on $HOSTNAME."
fi
echo "Starting $DAEMON daemon on host $HOSTNAME."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册