gateway-dk-ask: clear the upgrade restart marker on removal
Some checks are pending
Infrastructure: Mirror to Codeberg / codeberg (push) Waiting to run
Data: Sync board list / Send dispatch (push) Waiting to run
Infrastructure: Dispatch to fork / 📢 Run repository dispatch on fork (push) Waiting to run
Maintenance: Label merge conflicts / Needs rebase (push) Waiting to run
Maintenance: Security scan / Scorecards analysis (push) Waiting to run

prerm leaves /run/gateway-dk-ask.restart for postinst to start the
service again after an upgrade. If the upgrade fails between the two and
the package is then removed, the marker stays, and a fresh install later
in the same boot would start the service instead of only enabling it.
Clear it in postrm on remove and purge; an upgrade still keeps it.
This commit is contained in:
Tomaz Zaman 2026-11-25 14:49:59 +01:00 • committed by Igor
parent db833ec11e
commit 545459be50

View file

@ -672,8 +672,13 @@ systemctl stop ask-flowtable.service 2>/dev/null || true
EOF
chmod 755 "${pkgdir}/DEBIAN/prerm"
# An upgrade that fails after prerm can leave the restart marker behind; clear it on removal
# so a later fresh install in the same boot only enables the service, as installs do.
cat > "${pkgdir}/DEBIAN/postrm" << 'EOF'
#!/bin/bash
if [ "$1" = remove ] || [ "$1" = purge ]; then
rm -f /run/gateway-dk-ask.restart
fi
systemctl daemon-reload || true
EOF
chmod 755 "${pkgdir}/DEBIAN/postrm"