This is an automated email from the ASF dual-hosted git repository.

critas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new f4429dc338c Fix default paramters cannot stop ainode (#15531)
f4429dc338c is described below

commit f4429dc338c5739f5cfe0a1c1e4c2275d41e665e
Author: 张正明 <[email protected]>
AuthorDate: Fri May 23 12:01:08 2025 +0800

    Fix default paramters cannot stop ainode (#15531)
---
 scripts/sbin/stop-ainode.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/sbin/stop-ainode.sh b/scripts/sbin/stop-ainode.sh
index 4580ce6fd3e..d6560d98f8d 100644
--- a/scripts/sbin/stop-ainode.sh
+++ b/scripts/sbin/stop-ainode.sh
@@ -19,7 +19,16 @@
 #
 
 AINODE_CONF="`dirname "$0"`/../conf"
-ain_inference_rpc_port=`sed '/^ain_inference_rpc_port=/!d;s/.*=//' 
${AINODE_CONF}/iotdb-ainode.properties`
+if [ -f "${AINODE_CONF}/iotdb-ainode.properties" ]; then
+    ain_inference_rpc_port=$(sed '/^ain_inference_rpc_port=/!d;s/.*=//' 
"${AINODE_CONF}"/iotdb-ainode.properties)
+    # trim the port
+    ain_inference_rpc_port=$(echo "$ain_inference_rpc_port" | sed -e 
's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
+fi
+
+if [ -z "$ain_inference_rpc_port" ]; then
+    echo "WARNING: ain_inference_rpc_port not found in the configuration file. 
Using default value ain_inference_rpc_port=10810"
+    ain_inference_rpc_port=10810
+fi
 
 # fetch parameters with names
 while getopts "i:t:r" opt; do

Reply via email to