Bug#802545: systemd: postinst may not have run correctly on upgrades from jessie

Andreas Beckmann anbe at debian.org
Tue Oct 20 23:05:37 BST 2015


Package: systemd
Version: 227-2
Severity: important
User: debian-qa at lists.debian.org
Usertags: piuparts
Control: block -1 with 801156

Due to a bug in dpkg (#801156) a postinst script may be called without
an "configured-version" parameter on upgrades and therefore act like on
initial installs, skipping actions that may be needed for upgrading.

So far systemd is the only package that exhibits this error in piuparts
tests upgrading from jessie since there are actions (removal of an
obsolete conffile and cleanup of hwclock-save.service symlinks) that are
sometimes skipped and therefore leave a footprint in the filesystem that
is noticed by piuparts while comparing the chroot after an distupgrade
test with a reference chroot.


>From the attached log:

# configuration of systemd while upgrading the reference chroot from jessie to stretch
  Setting up systemd (227-2) ...
  Installing new version of config file /etc/dbus-1/system.d/org.freedesktop.login1.conf ...
  Installing new version of config file /etc/dbus-1/system.d/org.freedesktop.systemd1.conf ...
  Installing new version of config file /etc/pam.d/systemd-user ...
  Installing new version of config file /etc/systemd/bootchart.conf ...
  Installing new version of config file /etc/systemd/journald.conf ...
  Installing new version of config file /etc/systemd/logind.conf ...
  Installing new version of config file /etc/systemd/resolved.conf ...
  Installing new version of config file /etc/systemd/system.conf ...
  Installing new version of config file /etc/systemd/timesyncd.conf ...
  Installing new version of config file /etc/systemd/user.conf ...
  Created symlink from /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service to /lib/systemd/system/systemd-timesyncd.service.
  addgroup: The group `systemd-journal' already exists as a system group. Exiting.

# configuration of systemd while upgrading the chroot with the package to be tested being installed from jessie to stretch
  Setting up systemd (227-2) ...
  Installing new version of config file /etc/dbus-1/system.d/org.freedesktop.login1.conf ...
  Installing new version of config file /etc/dbus-1/system.d/org.freedesktop.systemd1.conf ...
  Installing new version of config file /etc/pam.d/systemd-user ...
  Installing new version of config file /etc/systemd/bootchart.conf ...
  Installing new version of config file /etc/systemd/journald.conf ...
  Installing new version of config file /etc/systemd/logind.conf ...
  Installing new version of config file /etc/systemd/resolved.conf ...
  Installing new version of config file /etc/systemd/system.conf ...
  Installing new version of config file /etc/systemd/timesyncd.conf ...
  Installing new version of config file /etc/systemd/user.conf ...
  Created symlink from /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service to /lib/systemd/system/systemd-timesyncd.service.
  addgroup: The group `systemd-journal' already exists as a system group. Exiting.
  Removing obsolete conffile /etc/dbus-1/system.d/org.freedesktop.machine1.conf ...

# error while comparing the chroots (after removing the package to be tested + dependencies)
1m19.7s ERROR: FAIL: After purging files have disappeared:
  /etc/dbus-1/system.d/org.freedesktop.machine1.conf.dpkg-remove	 not owned
  /etc/systemd/system/halt.target.wants/	 not owned
  /etc/systemd/system/halt.target.wants/hwclock-save.service -> /lib/systemd/system/hwclock-save.service	 not owned
  /etc/systemd/system/poweroff.target.wants/	 not owned
  /etc/systemd/system/poweroff.target.wants/hwclock-save.service -> /lib/systemd/system/hwclock-save.service	 not owned
  /etc/systemd/system/reboot.target.wants/	 not owned
  /etc/systemd/system/reboot.target.wants/hwclock-save.service -> /lib/systemd/system/hwclock-save.service	 not owned


So it's actually wrong in the upgrade of the reference chroot and correct
in the "real" upgrade test where these files correctly "disappear".
But since there are only about 40 of these "failures", this implies that
all other tests that were run since this bug got "activated" by some
trigger stuff somewhere (it was lingering in dpkg for a long time)
are actually buggy since both the reference chroot upgrade *and* the
real upgrade have run the postinst incorrectly in the same way (and
piuparts did not complain). I haven't done a full recheck on
jessie2stretch, but all packages that migrate to testing get checked
immediately (there are 1700 new logs from just the last week, that did
not show any error and therefore are actually hit by this bug.)

Since this error manifests in many piuparts tests (by not showing an
error), I assume that the same can happen in some real world upgrade
scenarios and some systems that track testing or sid may have that stuff
still around.


For fixing this I would suggest:
* wait for a fixed dpkg to appear in sid
* upload a new version of systemd to sid that changes
  - systemd.postinst: the old-version of all post-jessie actions is bumped
    to the then current systemd version (rerunning these actions should
    be harmless if they were done previously)
  - systemd.maintscript: bump the old-version likewise
  - add a versioned Depends on the fixed dpkg (a Pre-Depends should not
    be neccessary since only the postinst requires to be run by the
    fixed dpkg)
* before the fixed dpkg (and systemd) migrate to stretch we can verify the
  fix on jessie2stretch2sid upgrades (jessie2stretch will be broken and
  stretch2sid should fix it up). Removal of org.freedesktop.machine1.conf
  should be a good indicator.


Andreas



More information about the Pkg-systemd-maintainers mailing list