Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEB: disable service on purge instead of removal, restart on upgrade #218

Merged
merged 2 commits into from Feb 17, 2024

Conversation

marcosfrm
Copy link
Contributor

systemctl refuses to disable inexistent units. deb-systemd-helper can do the job for us, preserving enablement state on removal.

try-restart on upgrade is problematic because if the package is removed without purge, the next install is considered an upgrade as the version is still passed as postinst's second command line argument, leading to a stopped service. Let's just restart unconditionally. DEB package will diverge slightly from RPM in this regard.

systemctl refuses to disable inexistent units. deb-systemd-helper can do the job for us, preserving
enablement state on removal.

try-restart on upgrade is problematic because if the package is removed without purge, the next install is
considered an upgrade as the version is still passed as postinst's second command line argument, leading to a
stopped service. Let's just restart unconditionally. DEB package will diverge slightly from RPM in this
regard.
@marcosfrm
Copy link
Contributor Author

RPM after:

Enabled? Running?
Install Yes Yes
Upgrade If it was before If it was before
Removal No No

DEB after:

Enabled? Running?
Install (not installed or purged) Yes Yes
Install (previously removed) If it was before[*] Yes
Upgrade If it was before[*] Yes
Removal If it was before[†] No
Purge No No

[*] Special case: if previous version < 8.2.1, it will be enabled.
[†] Not useful until the package is installed again.

@jcoffland jcoffland merged commit 80b4789 into FoldingAtHome:master Feb 17, 2024
@marcosfrm marcosfrm deleted the systemd-helper branch February 17, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants