You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/11/05 13:15:37 UTC

[iotdb] branch master updated: [IOTDB-978]lsof does not exist in stop-server.sh (#1955)

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

qiaojialin 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 21b61ad  [IOTDB-978]lsof does not exist in stop-server.sh (#1955)
21b61ad is described below

commit 21b61ad9bd056e83aa404041d9095f0f197aeded
Author: yanhong wang <67...@users.noreply.github.com>
AuthorDate: Thu Nov 5 21:12:50 2020 +0800

    [IOTDB-978]lsof does not exist in stop-server.sh (#1955)
---
 server/src/assembly/resources/sbin/stop-server.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/src/assembly/resources/sbin/stop-server.sh b/server/src/assembly/resources/sbin/stop-server.sh
index d353833..5fb53f5 100755
--- a/server/src/assembly/resources/sbin/stop-server.sh
+++ b/server/src/assembly/resources/sbin/stop-server.sh
@@ -21,10 +21,14 @@
 
 IOTDB_CONF="`dirname "$0"`/../conf"
 rpc_port=`sed '/^rpc_port=/!d;s/.*=//' ${IOTDB_CONF}/iotdb-engine.properties`
-PID=$(lsof -t -i:${rpc_port})
-
-if [ "$PID" = "" ]; then
+if type lsof > /dev/null; then
+  PID=$(lsof -t -i:${rpc_port})
+else
+  PID=$(ps ax | grep -i 'IoTDB' | grep java | grep -v grep | awk '{print $1}')
+fi
+if [ -z "$PID" ]; then
   echo "No IoTDB server to stop"
+  exit 1
 else
   kill -s TERM $PID
   echo "close IoTDB"