Online upgrade of init-ifupdown breaks the rest of upgrade process

Issue #318 resolved
Peter Urbanec created an issue

When doing an online upgrade of many packages, the upgrade process start failing after init-ifupdown due to inability to download packages. It seems that this is caused by the upgrade script finishing execution while networking is down.

Upgrading init-ifupdown from 1.0-r7.0 to 1.0-r7.1 on root.
Downloading http://peteru.net/T3/4.2/mips32el/init-ifupdown_1.0-r7.1_mips32el.ipk.
Deconfiguring network interfaces... killall: smbd: no process killed
killall: nmbd: no process killed
killall: smbd: no process killed
killall: nmbd: no process killed
done.
update-rc.d: /etc/init.d/networking exists during rc.d purge (continuing)
 Removing any system startup links for networking ...
  /etc/rc0.d/K80networking
  /etc/rc1.d/K80networking
  /etc/rc2.d/S01networking
  /etc/rc3.d/S01networking
  /etc/rc4.d/S01networking
  /etc/rc5.d/S01networking
  /etc/rc6.d/K80networking
Upgrading ntpdate from 4.2.6p5-r6.0.0 to 4.2.6p5-r6.0.1 on root.
Downloading http://peteru.net/T3/4.2/mips32el/ntpdate_4.2.6p5-r6.0.1_mips32el.ipk.
wget: bad address 'peteru.net'
Upgrading libfaad2 from 2.7-r1.0 to 2.7-r1.1 on root.
Downloading http://peteru.net/T3/4.2/mips32el/libfaad2_2.7-r1.1_mips32el.ipk.
wget: bad address 'peteru.net'

Comments (3)

  1. Peter Urbanec reporter

    init-ifupdown inherits from update-rc.d which provides default implementations of prerm, postrm, preinst and postinst

    Unfortunately these default implementations are "dumb" and completely ignore the "upgrade" argument.

    What ends up happening is that opkg starts downloading and unpacking packages sequentially. As it downloads and unpacks each package, it calls prerm, preinst and postrm hook scripts. Once all packages are unpacked, the postinst script is finally called.

    The default prerm and preinst scripts stop networking. Networking is not brought up again until postinst is called, but that only happens after all the packages have been downloaded, unpacked and installed. This leaves a window where any package that needs to be downloaded after init-ifupdown is encountered will fail.

    The quick fix appears to leave networking up in prerm, pay attention to the "upgrade" argument to preinst and and finally stop/start network in postinst.

    A more thorough fix is to enhance opkg to also provide the "upgrade" argument to prerm and postrm, to match dpkg. I have submitted a patch to the opkg-devel list and am also preparing a submission to openembedded-devel. Once those patches are accepted, I'll create patch for the update-rc.d class.

  2. Peter Urbanec reporter
    • removed issue_status

    The issue was updated with the following change(s):

    • The status has been updated, from New to Confirmed.
  3. Log in to comment