fix(postinst): robust service restart on upgrade

- Always enable service (not conditional on is-enabled)
- try-restart: reinicia si ya estaba corriendo
- start fallback: arranca si quedó inactive después del try-restart
- Covers: fresh install, running disabled, stopped manual, failed
- Like baby-nas but handles the "running-but-not-enabled" edge case
This commit is contained in:
2026-07-07 23:54:08 -04:00
parent 1e516cb746
commit f5f3b2263e
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -35,8 +35,11 @@ EOF
if command -v systemctl > /dev/null 2>&1; then
systemctl daemon-reload 2>/dev/null || true
systemctl is-enabled --quiet syncserver.service 2>/dev/null && systemctl enable syncserver.service 2>/dev/null || true
systemctl enable syncserver.service 2>/dev/null || true
systemctl try-restart syncserver.service 2>/dev/null || true
if ! systemctl is-active --quiet syncserver.service; then
systemctl start syncserver.service 2>/dev/null || true
fi
fi
;;