Fix service inactive on dashboard after restart and update

Sync systemd service state after container restart so dashboard shows
Active. Patch conduit.service during update for existing snap Docker users.
This commit is contained in:
SamNet-dev
2026-01-31 12:33:36 -06:00
parent 749621ccfd
commit fbd2176b85

View File

@@ -2882,6 +2882,10 @@ restart_conduit() {
fi fi
# Regenerate tracker script and ensure service is running # Regenerate tracker script and ensure service is running
setup_tracker_service 2>/dev/null || true setup_tracker_service 2>/dev/null || true
# Sync systemd service state so dashboard shows "active"
if command -v systemctl &>/dev/null && systemctl is-enabled conduit.service &>/dev/null; then
systemctl restart conduit.service 2>/dev/null || true
fi
} }
change_settings() { change_settings() {
@@ -6551,6 +6555,11 @@ main() {
echo -e "${RED}Failed to update management script${NC}" echo -e "${RED}Failed to update management script${NC}"
exit 1 exit 1
fi fi
# Fix conduit.service: replace hard docker dependency for snap installs
if [ -f /etc/systemd/system/conduit.service ] && grep -q "Requires=docker.service" /etc/systemd/system/conduit.service 2>/dev/null; then
sed -i 's/Requires=docker.service/Wants=docker.service/g' /etc/systemd/system/conduit.service
systemctl daemon-reload 2>/dev/null || true
fi
setup_tracker_service 2>/dev/null || true setup_tracker_service 2>/dev/null || true
if [ "$TELEGRAM_ENABLED" = "true" ]; then if [ "$TELEGRAM_ENABLED" = "true" ]; then
telegram_generate_notify_script 2>/dev/null || true telegram_generate_notify_script 2>/dev/null || true