[debhelper-devel] Bug#837528: debhelper: dh_installinit --no-restart-on-upgrade now restarts after upgrade
Michael Biebl
biebl at debian.org
Sun Oct 2 00:23:28 UTC 2016
On Mon, 12 Sep 2016 09:19:38 +0100 Simon McVittie <smcv at debian.org> wrote:
> Package: debhelper
> Version: 10
> Severity: normal
>
> dbus contains a service that explicitly does not support being restarted
> without a reboot (it would require an init-style stateful re-exec with a
> lot of state to be transferred, which hasn't been implemented), so for a
> long time we've used
>
> dh_installinit -pdbus -r
>
> (where -r is the short form of --no-restart-on-upgrade) to suppress the
> restart that debhelper would normally put in the maintainer scripts.
>
> After upgrading dbus to compat level 10, I see this:
>
> --- /var/lib/dpkg/info/dbus.postinst 2016-08-15 22:05:45.000000000 +0100
> +++ dbus_1.10.10-2_amd64/DEBIAN/postinst 2016-08-26 11:07:56.000000000 +0100
> @@ -97,15 +97,18 @@
> if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
> if [ -x "/etc/init.d/dbus" ]; then
> update-rc.d dbus defaults >/dev/null
> - invoke-rc.d dbus start || exit $?
> + if [ -n "$2" ]; then
> + _dh_action=restart
> + else
> + _dh_action=start
> + fi
> + invoke-rc.d dbus $_dh_action || exit $?
> fi
> fi
> # End automatically added section
>
> i.e. the change of default in compat level 10 has meant we would now
> restart the service. Is this intended?
>
> It looks as though it'll be possible to work around this with
>
> dh_installinit -pdbus --no-restart-on-upgrade --no-restart-after-upgrade
>
> but that seems counter-intuitive: I would have expected
>
> dh_installinit -pdbus --no-restart-on-upgrade
>
> to be enough?
>
> I think this pseudo-patch would do what I expect:
>
> if (! $dh{NO_START}) {
> - if ($dh{RESTART_AFTER_UPGRADE}) {
> + if ($dh{RESTART_AFTER_UPGRADE} && ! $dh{R_FLAG}) {
>
> On the other hand, this change would likely also affect compat
> levels < 10 if they did
>
> dh_installinit -pdbus --no-restart-on-upgrade --restart-after-upgrade
For your particular case, I guess using compat level >= 10 and -r , it
would be somewhat reasonable to imply --no-restart-after-upgrade. This
would also be backwards compatible.
I think it's quite confusing that we now have
--no-restart-on-upgrade and
--no-restart-after-upgrade which mean something different. I'd say the
name for --no-restart-on-upgrade was poorly chosen.
Thoughts on whether/how to clean up this situation?
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20161002/49460e38/attachment-0001.sig>
More information about the debhelper-devel
mailing list