forked from OpenSenseNova/MemSense
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-bash.sh
More file actions
executable file
·28 lines (23 loc) · 862 Bytes
/
Copy pathstop-bash.sh
File metadata and controls
executable file
·28 lines (23 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
mkdir -p .runtime
for pid_file in .runtime/bge.pid .runtime/server.pid .runtime/worker.pid .runtime/tag-worker.pid .runtime/tag-worker-*.pid; do
if [[ -f "$pid_file" ]]; then
name="$(basename "$pid_file" .pid)"
pid="$(cat "$pid_file")"
if kill "$pid" 2>/dev/null; then
echo "[memsense] stopped $name (pid: $pid)"
else
echo "[memsense] $name was not running (pid: $pid)"
fi
rm -f "$pid_file"
fi
done
pkill -f "scripts/bge_local_server.py" 2>/dev/null || true
pkill -f "src/worker/tag-worker.js" 2>/dev/null || true
pkill -f "src/worker/index.js" 2>/dev/null || true
pkill -f "src/server/index.js" 2>/dev/null || true
find .runtime -maxdepth 1 -type f -delete
echo "[memsense] local bash services stopped"