Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

feat: thorough uninstall cleans up legacy agents and all artifacts

rcourtmane7524d02647b
diff --git a/scripts/install.sh b/scripts/install.sh
index 1b1e46db7d..aed9e2b8a0 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -135,21 +135,56 @@ done
# --- Uninstall Logic ---
if [[ "$UNINSTALL" == "true" ]]; then
- log_info "Uninstalling ${AGENT_NAME}..."
+ log_info "Uninstalling ${AGENT_NAME} and cleaning up legacy agents..."
- # Systemd
+ # Kill any running agent processes first
+ pkill -f "pulse-agent" 2>/dev/null || true
+ pkill -f "pulse-host-agent" 2>/dev/null || true
+ pkill -f "pulse-docker-agent" 2>/dev/null || true
+ sleep 1
+
+ # Systemd - unified agent
if command -v systemctl >/dev/null 2>&1; then
systemctl stop "${AGENT_NAME}" 2>/dev/null || true
systemctl disable "${AGENT_NAME}" 2>/dev/null || true
rm -f "/etc/systemd/system/${AGENT_NAME}.service"
+
+ # Legacy agents cleanup
+ systemctl stop pulse-host-agent 2>/dev/null || true
+ systemctl disable pulse-host-agent 2>/dev/null || true
+ rm -f /etc/systemd/system/pulse-host-agent.service
+
+ systemctl stop pulse-docker-agent 2>/dev/null || true
+ systemctl disable pulse-docker-agent 2>/dev/null || true
+ rm -f /etc/systemd/system/pulse-docker-agent.service
+
systemctl daemon-reload 2>/dev/null || true
fi
+ # Remove legacy binaries
+ rm -f /usr/local/bin/pulse-host-agent
+ rm -f /usr/local/bin/pulse-docker-agent
+
+ # Remove agent state directory (contains agent ID, proxmox registration state, etc.)
+ rm -rf /var/lib/pulse-agent
+
+ # Remove log files
+ rm -f /var/log/pulse-agent.log
+ rm -f /var/log/pulse-host-agent.log
+ rm -f /var/log/pulse-docker-agent.log
+
# Launchd (macOS)
if [[ "$(uname -s)" == "Darwin" ]]; then
+ # Unified agent
PLIST="/Library/LaunchDaemons/com.pulse.agent.plist"
launchctl unload "$PLIST" 2>/dev/null || true
rm -f "$PLIST"
+
+ # Legacy agents
+ launchctl unload /Library/LaunchDaemons/com.pulse.host-agent.plist 2>/dev/null || true
+ rm -f /Library/LaunchDaemons/com.pulse.host-agent.plist
+ launchctl unload /Library/LaunchDaemons/com.pulse.docker-agent.plist 2>/dev/null || true
+ rm -f /Library/LaunchDaemons/com.pulse.docker-agent.plist
fi
# Synology DSM (handles both DSM 7+ systemd and DSM 6.x upstart)