deb postinst fails when replacing stock caddy with masked service unit #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
When installing
madcat-caddyon a host that has stockcaddywith a maskedcaddy.serviceunit (/etc/systemd/system/caddy.service -> /dev/null), the postinst script fails:dpkg --force-confold -iremoves the oldcaddypackage/etc/systemd/system/caddy.service -> /dev/null) is removed bysystemctl unmask/usr/lib/systemd/system/caddy.service) is not unpacked — it was listed in the manifest but never landed on disksystemctl enable caddy.servicein postinst fails with "Unit file caddy.service does not exist"dpkg --configurefailsWorkaround
Manually extract the unit from the deb and copy it:
Reproduction
Confirmed on:
Expected fix
The postinst script should:
/usr/lib/systemd/system/caddy.servicebefore trying to enableconffiles-safe pathsystemctl daemon-reloadbeforesystemctl enableAlso
The
caddy-api.servicemask on sin (/etc/systemd/system/caddy-api.service -> /dev/null) triggers a harmless warning during preinst (Failed to stop caddy-api.service: Unit caddy-api.service not loaded) — should be guarded with|| true.