From 2eee9d95a3dc959c1dbc9735a550c4b09e17fa72 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Mar 2026 04:52:32 +0000 Subject: [PATCH] Fix postinstall.sh: restart service after upgrade preremove.sh stops the service during upgrades (to avoid stale venv binaries), but postinstall.sh wasn't restarting it. Now postinstall checks if the service was enabled and restarts it after the venv is rebuilt, so upgrades don't leave a previously running service down. https://claude.ai/code/session_01Vx1EsNrNySgsc8Y67dGzCn --- pkg/debian/scripts/postinstall.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/debian/scripts/postinstall.sh b/pkg/debian/scripts/postinstall.sh index a59a1537..a175c1b5 100755 --- a/pkg/debian/scripts/postinstall.sh +++ b/pkg/debian/scripts/postinstall.sh @@ -20,6 +20,13 @@ export ARCHIVEBOX_VERSION # Reload systemd to pick up the service file (skip if systemd is not running) if command -v systemctl >/dev/null 2>&1 && [ -d /run/systemd/system ]; then systemctl daemon-reload - echo "[i] To start ArchiveBox: sudo systemctl start archivebox" - echo "[i] To enable on boot: sudo systemctl enable archivebox" + + # On upgrade: restart the service if it was enabled (prerm stopped it) + if [ "$1" = "configure" ] && systemctl is-enabled archivebox >/dev/null 2>&1; then + systemctl start archivebox 2>/dev/null || true + echo "[+] Restarted archivebox service after upgrade" + else + echo "[i] To start ArchiveBox: sudo systemctl start archivebox" + echo "[i] To enable on boot: sudo systemctl enable archivebox" + fi fi