apkipa пре 1 месец
родитељ
комит
c455e4f377
5 измењених фајлова са 13 додато и 17 уклоњено
  1. 2 2
      config/application.yaml
  2. 0 1
      package.sh
  3. 0 1
      watch-daemon-installer/install.sh
  4. 0 4
      watch-daemon/run.sh
  5. 11 9
      watch-daemon/status.sh

+ 2 - 2
config/application.yaml

@@ -1,9 +1,9 @@
 watching:
-  dir: "data/"
+  dir: "/tmp/tsdb_data/"
   tmpDir: "tmp/"
   uploadFileInterval: 3
 minio:
-  addr: "$(hostname).local:9010"
+  addr: "localhost:9010"
   bucket: "bucket"
   accessKeyID: "25cSXPqzdHrPwJkSIRkM"
   secretAccessKey: "FN3AhQaVo7z1wgvce3IWiI1CI68T02OVeSUKCeRf"

+ 0 - 1
package.sh

@@ -17,7 +17,6 @@ cp -rf $ROOT/config $ROOT/watch-daemon/
 cp -rf $ROOT/watch-daemon $ROOT/tmp/
 cp -rf $ROOT/watch-daemon-installer $ROOT/tmp/
 
-mkdir -p $ROOT/tmp/watch-daemon/lib
 mkdir -p $ROOT/tmp/watch-daemon/log
 
 cd $ROOT/tmp

+ 0 - 1
watch-daemon-installer/install.sh

@@ -21,6 +21,5 @@ if [ ! -r /opt/watch-daemon/watch-daemon  ];then
       echo "安装成功!"
   fi
 chmod +x /opt/watch-daemon/watch-daemon/*.sh
-chmod +x /opt/watch-daemon/watch-daemon/lib/*
 
 systemctl daemon-reload

+ 0 - 4
watch-daemon/run.sh

@@ -51,10 +51,6 @@ if [[ ! -d "$base_dir/log" ]]; then
 fi
 
 # preparation check
-if [[ ! -d "$base_dir/lib" ]]; then
-    log_err "缺少lib文件夹,请查证后重新运行此脚本" && exit 1
-fi
-
 if [[ ! -f "$base_dir/watch-daemon" ]]; then
     log_err "文件夹中缺少watch-daemon(主程序),无法运行" && exit 1
 fi

+ 11 - 9
watch-daemon/status.sh

@@ -8,18 +8,20 @@ base_dir=$(
     pwd
 )
 cd $base_dir
-server_pid=$(ps -auxc | grep watch-daemon | grep -vE "grep|-Xmx700m" | awk '{print $2}')
+server_pid=$(pgrep -x watch-daemon)
 if [[ $server_pid == "" ]]; then
     echo "watch-daemon 未在运行"
 else
-    running_time=$(ps -o etime= -p "$server_pid")
-    ports=$(ss -tnlp | grep watch-daemon | awk '{print $4}')
+    for pid in $server_pid; do
+        running_time=$(ps -o etime= -p "$pid")
+        ports=$(ss -tnlp | grep watch-daemon | awk '{print $4}')
 
-    echo "watch-daemon 当前PID: $server_pid"
-    echo "当前运行时间: $running_time" | tr -s " "
-    echo "当前运行端口:"
-    for i in "$ports"; do
-        echo "$i"
-	break
+        echo "watch-daemon 当前PID: $pid"
+        echo "当前运行时间: $running_time" | tr -s " "
+        echo "当前运行端口:"
+        for port in $ports; do
+            echo "$port"
+            break
+        done
     done
 fi