Debian package upgrade fails to restart systemd service #21
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: olemd/skyview#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Problem
When upgrading the SkyView Debian package, the systemd service fails to restart properly even when it was previously enabled and running. This leaves the service in a stopped state after upgrade, requiring manual intervention to restart it.
Root Cause Analysis
After investigating the package maintenance scripts, I identified the issue in the interaction between
prerm
andpostinst
scripts during upgrade:Current Problematic Flow:
prerm script runs with parameter
upgrade
Package files are replaced
postinst script runs with parameter
configure
systemctl is-enabled skyview
❌ (returns false because prerm disabled it)Code Analysis
prerm script (lines 11-13):
postinst script (lines 32-35):
Expected Behavior
During package upgrade:
Impact
systemctl start skyview
after upgradeProposed Solution
Option 1: Fix prerm script (Recommended)
Don't disable service during upgrade - only disable during removal:
Option 2: Improve postinst script
Save enabled state before prerm runs and restore it:
Reproduction Steps
sudo dpkg -i skyview_0.0.3_amd64.deb
sudo systemctl enable skyview
sudo systemctl start skyview
sudo systemctl status skyview
sudo dpkg -i skyview_0.0.4_amd64.deb
sudo systemctl status skyview
Environment
Priority
High - This affects production deployments and automated upgrade processes.
Issue Status: Already resolved in current codebase.
Verification: Examined the Debian package scripts and found they were already fixed:
prerm script (
debian/DEBIAN/prerm
):upgrade
casepostinst script (
debian/DEBIAN/postinst
):Root Cause: The issue was likely fixed in a previous commit that updated the package maintenance scripts to follow Debian policy for service handling during upgrades.
Current Behavior: Service upgrades now preserve enabled state and automatically restart, eliminating the manual intervention requirement described in the original issue.