• Bug#953997: obsolete conffiles after upgrade

    From Andrea Bolognani@21:1/5 to Andrea Bolognani on Sun Mar 16 22:00:01 2025
    On Mon, May 15, 2023 at 10:56:20PM +0200, Andrea Bolognani wrote:
    On Sat, May 13, 2023 at 06:09:22PM +0200, Christoph Anton Mitterer wrote:
    On Sat, 2023-05-13 at 12:09 +0200, Andrea Bolognani wrote:
    As said in my message #10 in this bug,... I don't think it's necessary
    that the conffiles are cleaned up exactly the version after they have
    been dropped.

    AFAIU, you'd simply replace the rm_conffile with a version right before that of the next upload.

    It's a bit more complicated than that, because the logic in dpkg-maintscript-helper looks at things such as whether the conffile
    is still considered part of the original package and is marked as an
    obsolete conffile... With multiple Debian release having happened in
    the meantime, I'm not sure what dpkg will report for these conffiles
    on systemd and sysvinit hosts.

    The only thing I'm not sure about:
    You still want the files to be conffiles (just in another package)...
    with rm_conffile you can specify the package,... not sure if dpkg is
    smart enough to keep the file as is (and you could just skip the whole copying stuff) if it sees that the file is a conffile for another
    package.

    Transferring conffiles between packages is trickier than dropping
    conffiles. We've done so in libvirt in the past, and it required some
    custom logic. In this case, we'd have to be even more careful.


    Anyway, I wouldn't do anything about these files right now, knowing
    that their state is most likely going to change again during the
    trixie cycle. When I start working on that, I'll try to keep in mind
    this half-completed migration and handle it in the best possible way.

    Coming back to this bug after a long, long time because I recently
    had to dig into the topic again due to #1094583.

    If you check out the solution I've proposed for that bug, you'll
    notice that it involves potentially leaving even more obsolete
    conffiles around. I don't love that, obviously, but it genuinely
    feels like the lesser evil, all things considered. I won't repeat all
    the relevant information here, just go read that bug report.

    Note that adding rm_conffile calls is *not a good idea*, despite
    intuitively looking like the correct thing to do. Our primary goal is
    to reliably transfer ownership of conffiles between packages, and the
    way dpkg-maintscript-helper implements this operation actively gets
    in the way.

    For example, imagine that you are moving ${conffile} from srcpkg to
    dstpkg. If the file contains local modifications, srcpkg's preinst
    will rename it to ${conffile}.dpkg-backup; afterwards, when dstpkg is
    unpacked, dpkg will not find the original version of ${conffile} and
    will thus just install the default version shipped with the package,
    causing the local customizations to be lost. If the packages are
    unpacked in the opposite order that won't be a problem, but the exact
    order of installation is not something that we can really rely on, so
    using rm_conffile is effectively out of the question.

    Based on all the above, I'm leaning towards simply closing this bug.
    I'll give you folks some time to weigh in before doing that though :)

    --
    Andrea Bolognani <eof@kiyuko.org>
    Resistance is futile, you will be garbage collected.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEO48t9niVypx3EjLf954fxUKFg6wFAmfXOQsACgkQ954fxUKF g6wx1hAAqNsvctbh6WdiRg5T+SRYEIQiH1IhsqKySfM59Km3fHTZpbBy4kV5SsN6 3eOAV689WO1lnxi6bQQm0uc1Bf6xRCQn/InTnhAVuTHsXSquQIieynKrAgiDOR3G Ricjy9ihZAzx3MHr/P3rIEdWF5gIUtZ//zIY8A0M602g9Ix66ZHBrmsna4kMvLRi KI4XpzcM7uGv0ANwethro1ieY1pjyYgkX6w/hQQfoQzPs2b1DJgqVem3nHwzZH0g 7sLxICYm233bfIRWStZ59G+d9VdBdY1kXpMcIl6nrLqhHo0MQalOIV72UwR2St4K Zj6B6xNqCOws9E0kK/+66uJr//A7hfxhFh3DKswtNo1vTq4JBSmz1uMDOx9b8DVW nKsOu68pnW6AYyVc8pE2k8W+glJhFN3phRgFXRo7RssoanPKmwro3Ybgz1V7VGlN TODBKDpTUgGd70CX8HUFub6C0kKOjPhwu4/zZZjp6BI1xFTKkez7wiqGks8dP6Wy mhqhqZp5jNSL3d/PhPVVWYgDqa1sYr4yXH2Mr8zEKaDNCDn6XLIfW17Ai/2iVt0k ubd+40TA8Cxatu/oDchChH4ZsLVv8fJ0mIe5SXXFi9gqMwKKb3ssrDZ1nmQwDQvq g0EQiP1xhhvudzKtWRU+6zAF1at29pr8Lv9YhfQzvzblbaAXlso=
    =D8aL
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrea Bolognani@21:1/5 to Michael Biebl on Sun Mar 16 22:30:02 2025
    On Sun, Mar 16, 2025 at 10:05:57PM +0100, Michael Biebl wrote:
    It's correct that there is no native support in dpkg(-maintscript-helper) to transfer ownership of conffiles properly from one package to another.

    It is doable though with some contortions, see e.g. https://salsa.debian.org/systemd-team/systemd/-/commit/d6483013d5779d4d465a1e174e44a754b941d0e6
    where
    /etc/dhcp/dhclient-exit-hooks.d/timesyncd and
    /etc/systemd/timesyncd.conf were moved from systemd into a newly split off package named systemd-timesyncd.

    Yes, I'm aware of that. libvirt currently does something similar,
    though not exactly identical.

    The changes I'm proposing in

    https://salsa.debian.org/libvirt-team/libvirt/-/merge_requests/256

    do away with all that logic in favor of using dpkg's built-in
    handling. It's a little less polished, specifically because of
    conffiles remaining around as obsolete for the old package in certain scenarios, but the gains in terms of simplicity and reliability IMO
    far outweigh those drawbacks.

    --
    Andrea Bolognani <eof@kiyuko.org>
    Resistance is futile, you will be garbage collected.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEO48t9niVypx3EjLf954fxUKFg6wFAmfXQG8ACgkQ954fxUKF g6yaAhAA255c7MYO+lIZPxzYd4RnX02uO8h7WV+5OrFgwOF8NmP978KjMvGJ9YQC mwzLxyAPCPQb7J/KDWq5y+0pd5mtX+G9RvON2xoUAGICvh9S29SY3k4Wtrd+kUd2 T+LuyQV9tDTO5TSjBKEvgkFfF2dbc44u81OkI+DSAMjc0W+ZSUkvBelqgfHOOIzu 5IoneV4Ho7tYvxWP2Wwl2+V3kKGuFQ6x2Kk8wuo5EyzQaBeLWcwxGF719yQ0qMai Oooo71HX0D849t8rdStc9zx1myDMfk/NT3TtP+Wyoods+TJYkg7su3npZsBKrS7t 07Nz0MBlLMetsCa/1x5LIhgPuqH/lgNimQU7a15fYmC07uj4YX5sRdb8HDH7xRre CY2q8JoyAuCbTsD2q4px/PE7w52dunPXLxV0MKMTzhMLqYq1gbKy72UgYY6NPFT6 26ehoQtKrrihGz61mbplOMBeYw+D9btTYZx0rh2q/lHipb9q9jSwbdyjzje1XcvV SjDiHz54S35PieQkOuVUNhCEDxXM7i2QNg9M3Rj+zfrzL6oEiv08DWb98qwLCDq3 aMFBM/6DhLh5qHh1D2dCqBLrnUVxrBZWkPuFozsQa21S8FNxDtAOkve9VbfWmQCU ubaE+9p50RvhI3NCTbMvEKUlS6hBk2Pk3PRS17VVGWLZX7uEds0=
    =PP/v
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)