From 1c865cd16497accf338d3dfec4633610263108e7 Mon Sep 17 00:00:00 2001 From: ReturnFI <151555003+ReturnFI@users.noreply.github.com> Date: Fri, 12 Sep 2025 20:43:27 +0000 Subject: [PATCH] fix(upgrade): improve service restart reliability --- upgrade.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/upgrade.sh b/upgrade.sh index c1ef122..d75288a 100644 --- a/upgrade.sh +++ b/upgrade.sh @@ -270,7 +270,17 @@ if [ ${#ACTIVE_SERVICES_BEFORE_UPGRADE[@]} -eq 0 ]; then warn "No relevant services were active before the upgrade. Skipping restart." else for SERVICE in "${ACTIVE_SERVICES_BEFORE_UPGRADE[@]}"; do - systemctl restart "$SERVICE" && success "$SERVICE restarted." || warn "$SERVICE failed to restart." + info "Attempting to restart $SERVICE..." + systemctl enable "$SERVICE" &>/dev/null || warn "Could not enable $SERVICE. It might not exist." + systemctl restart "$SERVICE" + sleep 2 + if systemctl is-active --quiet "$SERVICE"; then + success "$SERVICE restarted successfully and is active." + else + warn "$SERVICE failed to restart or is not active." + warn "Showing last 5 log entries for $SERVICE:" + journalctl -u "$SERVICE" -n 5 --no-pager + fi done fi