From 7b9902f7889852274ecf0a345a31f45c20c3b15b Mon Sep 17 00:00:00 2001 From: cclohmar Date: Thu, 6 Aug 2026 15:04:03 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20pkill=20patterns=20=E2=80=94=20target=20?= =?UTF-8?q?binary=20paths,=20not=20script=20itself?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy_nvr.sh | 8 ++++---- remove.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy_nvr.sh b/deploy_nvr.sh index d33b924..e5119e2 100755 --- a/deploy_nvr.sh +++ b/deploy_nvr.sh @@ -42,12 +42,12 @@ fi # ── 1. Kill all existing instances ── log "Stopping any running NextNVR instances..." sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true -sudo pkill -9 -f "nextnvr" 2>/dev/null || true -sudo pkill -9 -f "go2rtc" 2>/dev/null || true -sudo pkill -9 -f "ffmpeg.*rec_" 2>/dev/null || true +sudo pkill -9 -f "/opt/nextnvr/nextnvr" 2>/dev/null || true +sudo pkill -9 -f "go2rtc -config" 2>/dev/null || true +sudo pkill -9 -f "ffmpeg.*-i rtsp" 2>/dev/null || true sleep 2 -if pgrep -f "nextnvr" > /dev/null 2>&1; then +if pgrep -f "/opt/nextnvr/nextnvr" > /dev/null 2>&1; then err "Cannot kill existing NextNVR processes. Please stop them manually and retry." exit 1 fi diff --git a/remove.sh b/remove.sh index 1691324..5724851 100755 --- a/remove.sh +++ b/remove.sh @@ -14,11 +14,11 @@ echo "Stopping service..." sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true -# Kill any lingering processes. +# Kill any lingering processes (target only NextNVR binaries, not the script). echo "Killing processes..." -sudo pkill -9 -f "nextnvr" 2>/dev/null || true -sudo pkill -9 -f "go2rtc" 2>/dev/null || true -sudo pkill -9 -f "ffmpeg.*rec_" 2>/dev/null || true +sudo pkill -9 -f "/opt/nextnvr/nextnvr" 2>/dev/null || true +sudo pkill -9 -f "go2rtc -config" 2>/dev/null || true +sudo pkill -9 -f "ffmpeg.*-i rtsp" 2>/dev/null || true sleep 1 # Remove systemd service file.