[PKG-OpenRC-Debian] Bug#829488: openrc: upgrade jessie -> stretch fails: util-linux.postinst: update-rc.d: not found

Andreas Henriksson andreas at fatal.se
Wed Jul 13 13:19:32 UTC 2016


Control: reassign -1 openrc
Control: retitle -1 dist-upgrading while switching from openrc to file-rc is broken

Hello Adam Borowski.

Please remember to (B)CC the receiving package when reassigning
bug reports to notify the receiver.

On Sun, Jul 03, 2016 at 11:19:40PM +0200, Adam Borowski wrote:
> On Sun, Jul 03, 2016 at 08:28:45PM +0200, Andreas Beckmann wrote:
> > Package: openrc
> > Version: 0.21-1
> > Severity: serious
> > 
> > during a test with piuparts I noticed your package fails to upgrade from
> > 'jessie'.
> > It installed fine in 'jessie', then the upgrade to 'stretch' fails.
> 
> > This seems to be related to openrc, since I haven't seen a similar failure
> > without openrc installed.
> 
> The problem here is that init-system-helpers can't be relied upon to provide
> update-rc.d without a versioned dependency as it's not yet present in
> jessie's version.
> 
> 
> Here's your log trimmed to interesting parts:
> 
>   The following packages will be REMOVED:
>     openrc systemd-sysv
>   The following NEW packages will be installed:
>     file-rc gcc-6-base init-system-helpers sysvinit-core [...]
> [...]
>   dpkg: openrc: dependency problems, but removing anyway as you requested:
>    initscripts depends on sysv-rc | file-rc; however:
>     Package sysv-rc is not installed.
>     Package openrc which provides sysv-rc is to be removed.
>     Package file-rc is not installed.
>    systemd depends on sysv-rc; however:
>     Package sysv-rc is not installed.
>     Package openrc which provides sysv-rc is to be removed.
>   
> (Reading database ... 7525 files and directories currently installed.)
>   Removing openrc (0.13.1-4) ...
> [...]
>   Setting up util-linux (2.28-5) ...
>   Installing new version of config file /etc/init.d/hwclock.sh ...
>   /var/lib/dpkg/info/util-linux.postinst: 35: /var/lib/dpkg/info/util-linux.postinst: update-rc.d: not fo
> und
> 
> 
> At that moment, openrc is already removed and init-system-helpers not yet
> upgraded, thus update-rc.d is not present.  Handing over essential
> functionality to another package requires a versioned dependency and is
> notoriously hard to do right.  Not sure what's the proper package that
> should express this dependency -- it's certainly not openrc though as at
> this point apt cares only about jessie's version of it.

The package handling this "handover" is called sysv-rc. The problem with
openrc is that it Conflicts and Provides sysv-rc. (But while sysv-rc
Pre-depends on init-system-helpers >= 1.29, openrc only recommends it which
is quite a bit weaker relation.)
You're pushing out sysv-rc and thus you can't rely on sysv-rc to
properly handle the upgrade path for you.... Please notice this interesting
part of the log as well:

  dpkg: openrc: dependency problems, but removing anyway as you requested:^M
   initscripts depends on sysv-rc | file-rc; however:^M
    Package sysv-rc is not installed.^M
    Package openrc which provides sysv-rc is to be removed.^M
    Package file-rc is not installed.^M
   systemd depends on sysv-rc; however:^M
    Package sysv-rc is not installed.^M
    Package openrc which provides sysv-rc is to be removed.^M
  ^M

Someone who knows apt better than me might be able to explain whats
happening here and how you avoid it.

We should not be working around this problem in thousands of packages
using update-rc.d (eg. any that uses dh_installinit, which util-linux
just happens to be one of) but rather fix the upgrade path to always
make sure the policy tools are available at all time without glitches.

I'm not sure this problem is at all related to init-system-helpers since
you're apparently running into a situation where you have neither
openrc (jessie), sysv-rc (jessie) or init-system-helpers (stretch) installed.
You should not be able to uninstall all of those at any time during the
upgrade process which is apparently possible when throwing openrc into
the mix. 

I also noticed that the log said:

 The following packages will be REMOVED:
    openrc systemd-sysv
  The following NEW packages will be installed:
    file-rc [...]

This is thus apparently an issue while upgrading and switching from openrc
to file-rc in the mix. AFAIK file-rc still has it's own policy tools
(and diverts the ones from init-system-helpers), but file-rc is not
being installed ASAP after openrc is removed. Thus noone provides the
tools inbetween where other packages gets a time to be configured.
I wonder who'd be crazy enough to dist-upgrade and switch from openrc
to file-rc at the same time instead of doing it in two separate steps.
Anyway, I'm not sure file-rc is targeted to be released with stretch
at all, so maybe just getting it removed would be the easiest way to
avoid piuparts triggering/testing this upgrade path at all....

I hope the above comments have provided some hints on what to investigate.

Regards,
Andreas Henriksson



More information about the OpenRC-devel mailing list