Many thanks to Andreas for the report, and the logs. I suppose it was
too much to hope that this went through entirely smoothly, and so it has
come to pass! After digging into the logs above, and then dpkg-
reconfigure's code it appears that it does the following (see [1] for
details):

* Run the package's prerm script (if it exists)
* Run the package's config script (ditto)
* Run the package's postinst script (ditto)

This may seem a little odd; why run the prerm script if you don't intend
on removing the package? Presumably because, prior to the change made
above, that's where the "stop services" action went if --no-restart-
after-upgrade was specified in d/rules. However, as discussed above,
that leaves the restart behaviour of a package spread across two
distinct versions in the case of an upgrade (because it's actually the
*old* version's prerm that runs, followed by the *new* versions's
postinst to start them up again). Now, it's the package's preinst script
that handles stopping services.

Therefore, if we were being strict, dpkg-reconfigure ought to run just
the preinst, config, and postinst scripts, avoiding the prerm entirely.
Unfortunately, I suspect that's likely to break anything that relies
upon it running the prerm script, so that's probably not a wise idea.
I'll propose a change upstream to add preinst to the running order,
leaving prerm alone for now, and I'll post a debdiff with a similar
change here.

[1]: https://salsa.debian.org/pkg-debconf/debconf/-/blob/master/dpkg-
reconfigure#L196-198

** Also affects: debconf (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: debconf (Ubuntu Jammy)
     Assignee: (unassigned) => Dave Jones (waveform)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to debconf in Ubuntu.
https://bugs.launchpad.net/bugs/1959054

Title:
  debhelper restarts services marked --no-restart-on-upgrade

Status in debconf package in Ubuntu:
  New
Status in debhelper package in Ubuntu:
  Confirmed
Status in docker.io package in Ubuntu:
  Confirmed
Status in libvirt package in Ubuntu:
  Triaged
Status in debconf source package in Jammy:
  New
Status in debhelper source package in Jammy:
  Confirmed
Status in docker.io source package in Jammy:
  Confirmed
Status in libvirt source package in Jammy:
  Triaged
Status in debhelper package in Debian:
  New

Bug description:
  Debian bug #994204 (https://bugs.debian.org/cgi-
  bin/bugreport.cgi?bug=994204) describes a flaw in debhelper that
  results in the postinst being generated in such a fashion that
  services marked --no-stop-on-upgrade (or its deprecated alias --no-
  restart-on-upgrade), restart anyway.

  Please note: this is nothing to do with the --no-restart-after-upgrade
  flag (which is, somewhat confusingly IMO, unrelated).

  I've confirmed that the flaw appears to be present in the jammy
  version of debhelper (though not impish) and that packages generated
  with it appear to contain the flawed postinst (I first encountered
  this whilst working on the open-iscsi merge), though I haven't yet
  managed to test that the flaw exhibits itself on upgrade (though I'd
  say from the presence of the flaw in the postinst, that it's a
  reasonable inference that it will).

  In dbus (the merge of which I'm currently working on), Debian has
  worked around this but given I've now run into two affected packages
  (open-iscsi and dbus), only one of which has a work-around, I'd much
  rather we got debhelper fixed up and rebuilt affected packages?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/1959054/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to