[Debconf-devel] Bug#1006147: debconf: dpkg-reconfigure fails to restart services after #994204

Dave Jones dave.jones at canonical.com
Sat Feb 19 20:21:45 GMT 2022


Package: debconf
Version: 1.5.73
Severity: important

Dear Maintainer,

As part of fixing an issue with restarting services in debhelper 
(#994204), I proposed a patch [1] that, in certain circumstances (when 
--no-restart-after-upgrade is specified) moves the duty of stopping 
services from the prerm maintainer script to the preinst maintainer 
script (see #994204 for the reasoning behind this change). That fix has 
been merged in Debian, although not yet released. In Ubuntu, the fix has 
also been merged and is currently in our -proposed pocket.

One issue [2] that arose during the testing of the fix was that, for the 
slapd service (part of the openldap package), dpkg-reconfigure now 
failed to restart the service. The slapd service is indeed declared with 
--no-restart-after-upgrade and, and digging into dpkg-reconfigure's code 
I found that it runs prerm, config, and postinst, but not preinst. 
Hence, with services using --no-restart-after-upgrade, prerm no longer 
stops the service and by the time it gets to postinst, the "start" 
operation there has nothing to do.

My assumption is that prerm was only in that sequence to stop services 
(it's seems a little odd to me for it to be in dpkg-reconfigure 
otherwise? Am I missing something else there?). However, I'm guessing 
that replacing prerm with preinst would lead to breakage in packages 
that assume prerm is still run by dpkg-reconfigure. Instead, I'm 
proposing to add preinst to the list of maintainer scripts run by 
dpkg-reconfigure. I'll propose a merge request to the debconf salsa repo 
that adds preinst to the list, and update this with the link shortly.

Many thanks for any attention you can give this, and for any light you 
can shed on my assumptions above. If you need any more detail on the 
reasoning behind the fix for #994204 (and its related issue #989155), 
please let me know.

[1]: https://salsa.debian.org/debian/debhelper/-/merge_requests/61

[2]: https://bugs.launchpad.net/bugs/1959054 (comment # 15 onwards)


Best regards,

Dave Jones.



More information about the Debconf-devel mailing list