mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
feat: add service start/stop orchestration scripts
Former-commit-id: 4e4335591be6f906229115cef4fe9c42c11d70f1
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
+# stop-all.sh — 按逆序停止所有服务
|
||||
+source "$(dirname "${BASH_SOURCE[0]}")/config/env.sh"
|
||||
+
|
||||
+log_info "Stopping all services..."
|
||||
+
|
||||
+for pid_file in "$LOG_DIR"/*.pid; do
|
||||
+ if [[ -f "$pid_file" ]]; then
|
||||
+ pid=$(cat "$pid_file")
|
||||
+ svc=$(basename "$pid_file" .pid)
|
||||
+ if kill -0 "$pid" 2>/dev/null; then
|
||||
+ log_info "Stopping $svc (pid=$pid)..."
|
||||
+ kill "$pid"
|
||||
+ sleep 2
|
||||
+ kill -9 "$pid" 2>/dev/null || true
|
||||
+ log_ok " $svc stopped"
|
||||
+ fi
|
||||
+ rm -f "$pid_file"
|
||||
+ fi
|
||||
+done
|
||||
+
|
||||
+log_info "All services stopped"
|
||||
Reference in New Issue
Block a user