From 2209565eae0e679d50192ae588d5cc5a2c207079 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 15 Dec 2025 13:31:18 +0000 Subject: [PATCH] fix(sensor-proxy): skip selfheal reinstall when service is healthy The selfheal timer was running the full installer every 5 minutes even when the service was already running and healthy. This caused unnecessary: - Pulse service restarts - Config migrations - Socket setup - 172MB memory spikes and 15s CPU usage per run Now the selfheal exits early after checking service health, only proceeding to reinstall logic if the service is actually failing. Fixes #849 --- scripts/install-sensor-proxy.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.sh index 217f629..c153002 100755 --- a/scripts/install-sensor-proxy.sh +++ b/scripts/install-sensor-proxy.sh @@ -3523,6 +3523,13 @@ if ! command -v systemctl >/dev/null 2>&1; then exit 0 fi +# Early exit if service is healthy - no work needed +if systemctl is-active --quiet "${SERVICE}.service" 2>/dev/null; then + # Service is running - only do control plane reconcile if needed, skip everything else + attempt_control_plane_reconcile + exit 0 +fi + if ! systemctl list-unit-files 2>/dev/null | grep -q "^${SERVICE}\\.service"; then if [[ -x "$INSTALLER" && -f "$CTID_FILE" ]]; then log "Service unit missing; attempting reinstall"