Your message dated Fri, 25 Dec 2015 13:34:00 +0000
with message-id <e1acsvm-0006zg...@franck.debian.org>
and subject line Bug#801156: fixed in dpkg 1.18.4
has caused the Debian Bug report #801156,
regarding dpkg: sometimes does not pass old version to postinst on upgrade
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
801156: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801156
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: dpkg
Version: 1.18.3
Severity: serious
Hi Guillem,
dpkg does not always properly pass the old version number when
calling "postinst configure" on package upgrades, sometimes there
is either no or an empty argument.
I have two cases where an 'apt-get dist-upgrade' from jessie to
stretch calls 'systemd.postinst configure' differently:
* a minimal jessie chroot (incorrect behavior)
* a minimal jessie chroot + bash-completion (correct behavior)
I noticed this while analyzing some strange piuparts failures in jessie
to stretch upgrades. Unfortunately I neglected it for a long time since
I assumed to have hit a strange bug in some systemd support scripts:
1m41.2s 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
Digging into this I found the systemd.postinst from stretch performing
cleanup of hwclock-save.service and removal of that obsolete conffile
- but strangely only sometimes:
....
# Cleanup hwclock-save.service, which was shipped in jessie.
if dpkg --compare-versions "$2" lt-nl "219-8"; then
for t in reboot halt poweroff ; do
rm -fv /etc/systemd/system/${t}.target.wants/hwclock-save.service
rmdir --ignore-fail-on-non-empty /etc/systemd/system/${t}.target.wants
2> /dev/null || true
done
fi
....
#DEBHELPER#
(the #DEBHELPER# part gets several dkpm-maintscript-helper rm_conffile calls)
not here, which is wrong:
....
(Reading database ... 7446 files and directories currently installed.)
Preparing to unpack .../systemd_226-3_amd64.deb ...
Unpacking systemd (226-3) over (215-17+deb8u2) ...
Setting up util-linux (2.27-3) ...
Setting up systemd (226-3) ...
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.
(Reading database ...
....
but here, which is correct:
....
(Reading database ... 8034 files and directories currently installed.)
Preparing to unpack .../systemd_226-3_amd64.deb ...
Unpacking systemd (226-3) over (215-17+deb8u2) ...
Setting up util-linux (2.27-3) ...
Setting up systemd (226-3) ...
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
...
(Reading database ...
....
So I rebuilt systemd with more debug output in the postinst script to see the
following:
....
(Reading database ... 7446 files and directories currently installed.)
Preparing to unpack ..././systemd_226-4.1_amd64.deb ...
Unpacking systemd (226-4.1) over (215-17+deb8u2) ...
Setting up util-linux (2.27-3) ...
Setting up systemd (226-4.1) ...
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 ...
+ echo ** this is /var/lib/dpkg/info/systemd.postinst configure
** this is /var/lib/dpkg/info/systemd.postinst configure
+ set -e
+ [ configure = triggered ]
+ dpkg --compare-versions lt 214-1
+ systemctl enable getty@tty1.service
+ systemctl enable remote-fs.target
+ dpkg --compare-versions lt 218-11~
+ systemctl enable systemd-timesyncd.service
Created symlink from
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service to
/lib/systemd/system/systemd-timesyncd.service.
+ dpkg --compare-versions lt 33-1
+ [ -f /etc/default/rcS ]
+ . /etc/default/rcS
....
+ dpkg --compare-versions ge 204
+ [ -n ]
+ dpkg --compare-versions lt-nl 219-8
+ echo NO hwclock-save.service cleanup ()
NO hwclock-save.service cleanup ()
+ _systemctl is-active --quiet resolvconf
+ [ -d /run/systemd/system ]
+ _systemctl start systemd-networkd-resolvconf-update.path
+ [ -d /run/systemd/system ]
+ [ -d /run/systemd/system ]
+ dpkg-maintscript-helper rm_conffile
/etc/bash_completion.d/systemctl-bash-completion.sh 204-1~ systemd -- configure
+ dpkg-maintscript-helper rm_conffile
/etc/bash_completion.d/systemd-bash-completion.sh 204-1~ systemd -- configure
+ dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-logind.conf
/etc/systemd/logind.conf 204-1~ systemd -- configure
+ dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-journald.conf
/etc/systemd/journald.conf 204-1~ systemd -- configure
+ dpkg-maintscript-helper rm_conffile
/etc/dbus-1/system.d/org.freedesktop.machine1.conf 224-2~ systemd -- configure
(Reading database ...
....
So the postinst script is called without a "$2" parameter of "215-17+deb8u2"
causing several postinst actions to be skipped. It may be that there is an
empty string being passed instead, since 'echo "** this is $0 $@"' emitted
a trailing space:
"** this is /var/lib/dpkg/info/systemd.postinst configure "
And this is the output in the case where it is correct:
....
(Reading database ... 8034 files and directories currently installed.)
Preparing to unpack ..././systemd_226-4.1_amd64.deb ...
Unpacking systemd (226-4.1) over (215-17+deb8u2) ...
Setting up util-linux (2.27-3) ...
Setting up systemd (226-4.1) ...
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 ...
+ echo ** this is /var/lib/dpkg/info/systemd.postinst configure 215-17+deb8u2
** this is /var/lib/dpkg/info/systemd.postinst configure 215-17+deb8u2
+ set -e
+ [ configure = triggered ]
+ dpkg --compare-versions 215-17+deb8u2 lt 214-1
+ dpkg --compare-versions 215-17+deb8u2 lt 218-11~
+ systemctl enable systemd-timesyncd.service
Created symlink from
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service to
/lib/systemd/system/systemd-timesyncd.service.
+ dpkg --compare-versions 215-17+deb8u2 lt 33-1
....
+ [ -n 215-17+deb8u2 ]
+ _systemctl daemon-reexec
+ [ -d /run/systemd/system ]
+ _systemctl try-restart systemd-networkd.service
+ [ -d /run/systemd/system ]
+ _systemctl try-restart systemd-resolved.service
+ [ -d /run/systemd/system ]
+ _systemctl try-restart systemd-timesyncd.service
+ [ -d /run/systemd/system ]
+ dpkg --compare-versions 215-17+deb8u2 lt-nl 219-8
+ echo cleanup hwclock-save.service
cleanup hwclock-save.service
+ rm -fv /etc/systemd/system/reboot.target.wants/hwclock-save.service
removed '/etc/systemd/system/reboot.target.wants/hwclock-save.service'
+ rmdir --ignore-fail-on-non-empty /etc/systemd/system/reboot.target.wants
+ rm -fv /etc/systemd/system/halt.target.wants/hwclock-save.service
removed '/etc/systemd/system/halt.target.wants/hwclock-save.service'
+ rmdir --ignore-fail-on-non-empty /etc/systemd/system/halt.target.wants
+ rm -fv /etc/systemd/system/poweroff.target.wants/hwclock-save.service
removed '/etc/systemd/system/poweroff.target.wants/hwclock-save.service'
+ rmdir --ignore-fail-on-non-empty /etc/systemd/system/poweroff.target.wants
+ _systemctl is-active --quiet resolvconf
+ [ -d /run/systemd/system ]
+ _systemctl start systemd-networkd-resolvconf-update.path
+ [ -d /run/systemd/system ]
+ [ -d /run/systemd/system ]
+ dpkg-maintscript-helper rm_conffile
/etc/bash_completion.d/systemctl-bash-completion.sh 204-1~ systemd -- configure
215-17+deb8u2
+ dpkg-maintscript-helper rm_conffile
/etc/bash_completion.d/systemd-bash-completion.sh 204-1~ systemd -- configure
215-17+deb8u2
+ dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-logind.conf
/etc/systemd/logind.conf 204-1~ systemd -- configure 215-17+deb8u2
+ dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-journald.conf
/etc/systemd/journald.conf 204-1~ systemd -- configure 215-17+deb8u2
+ dpkg-maintscript-helper rm_conffile
/etc/dbus-1/system.d/org.freedesktop.machine1.conf 224-2~ systemd -- configure
215-17+deb8u2
Removing obsolete conffile /etc/dbus-1/system.d/org.freedesktop.machine1.conf
...
(Reading database ...
So in these two cases completely different codepaths in the postinst are taken.
I don't know about other packages, since this is (so far) the only one leaving
a visible trace from this mistreatment in piuparts. (Well, there are several
other systemd symlink related problems that nobody managed to debug so far.)
Attached are two logs where I did this upgrade test with piuparts, but
it should be quite easy to reproduce it manually.
Andreas
bad.log.gz
Description: application/gzip
good.log.gz
Description: application/gzip
--- End Message ---
--- Begin Message ---
Source: dpkg
Source-Version: 1.18.4
We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 801...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Guillem Jover <guil...@debian.org> (supplier of updated dpkg package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Fri, 25 Dec 2015 13:20:26 +0100
Source: dpkg
Binary: libdpkg-dev dpkg dpkg-dev libdpkg-perl dselect
Architecture: source
Version: 1.18.4
Distribution: unstable
Urgency: medium
Maintainer: Dpkg Developers <debian-d...@lists.debian.org>
Changed-By: Guillem Jover <guil...@debian.org>
Description:
dpkg - Debian package management system
dpkg-dev - Debian package development tools
dselect - Debian package management front-end
libdpkg-dev - Debian package management static library
libdpkg-perl - Dpkg perl modules
Closes: 760248 799046 799432 799875 800513 800649 801156 801329 801958 805872
806315 807156 808912
Changes:
dpkg (1.18.4) unstable; urgency=medium
.
[ Guillem Jover ]
* Switch dpkg-scansources and dpkg-scanpackages to use File::Find instead
of find(1), as the former is more portable with more consistent behavior,
and always canonicalizes the pathnames. Closes: #800649
* Initialize Config-Version also for packages previously in triggers-pending
state, otherwise we end up not passing the previously configured version
to «postinst configure», which might consider this a first install instead
of an upgrade. Closes: #801156
* Fix memory leaks in «dpkg --verify» and dpkg infodb format upgrade logic.
* Merge all update-alternatives action handling into a single if-else-if
block, to unify the code an allow a future switch into a shared library.
* Perform any necessary cleanups on normal exit from dpkg-divert --add and
--remove commands.
* Make dpkg-architecture warning on non-matching GNU system type compiler
agnostic.
* Add ‘.gitreview’ to the default dpkg-source ignore lists.
* Add support for DPKG_MAINTSCRIPT_DEBUG environment variable to dpkg.
* Fix dpkg-checkbuilddeps exit code to be 1 instead of a random error value
on unsatisfied dependencies. Regression introduced in dpkg 1.18.3.
* Fix an off-by-one write access in dpkg-deb when parsing the old format
.deb control member size. Thanks to Hanno Böck <ha...@hboeck.de>.
Fixes CVE-2015-0860.
* Fix an off-by-one read access in dpkg-deb when parsing ar member names.
Thanks to Hanno Böck <ha...@hboeck.de>.
* Add experimental multithreaded xz compression support in libdpkg, which
requires xz >= 5.2.0.
* Fix physical file offset comparison in dpkg. Closes: #808912
Thanks to Yuri Gribov <tetra2...@gmail.com>.
* Fix usage of dpkg-architecture -s after other action options.
Reported by Niels Thykier <ni...@thykier.net>.
* Add NIOS2 support to cputable. Thanks to Marek Vasut <ma...@denx.de>.
* On Debian and derivatives enable timeless build flag feature by default.
Thanks to Paul Wise <p...@debian.org>. Closes: #805872
* Perl modules:
- Add support for Build-Essential field. Closes: #806315
* Test suite:
- Improve perl code test coverage.
* Build system:
- Set PERL5LIB globally for the test suite to the local modules directory,
to avoid using the system modules. Regression introduced in dpkg 1.17.8.
Reported by Jérémy Bobbio <lu...@debian.org>. Closes: #801329
- Use absolute buildir pathnames in PATH variable for the test suite.
- Descend into scripts directory when cleaning up code coverage files.
- Add new configure option --disable-devel-docs to select the kind of docs
to generate, default for now is development documentation.
- Try to use AM_GNU_GETTEXT_REQUIRE_VERSION to benefit from the latest
installed gettext version, while guaranteeing a minimal required version.
* Packaging:
- Add missing Build-Depends for restriction formula support.
* Documentation:
- Move description for “target architecture” from the dpkg-architecture(1)
‘-A’ option to the TERMS section. Closes: #799046
- Clarify that the md5sum check on «dpkg --verify» is performed on the
file contents, and failures denote changed content. Closes: #760248
- Document that dpkg-buildpacakge -nc -S implies -d.
- Clarify role of Build-Depends in deb-src-control(5).
Prompted by Johannes Schauer <j.scha...@email.de>.
- Document supported feature areas.
- Clarify in dpkg-query(1) when binary:Package gets arch-qualified.
Closes: #801958
- Add a subsection separating external from internal environment variables
in dpkg(1).
.
[ Updated programs translations ]
* Dutch (Frans Spiesschaert). Closes: #800513
* Japanese (Kenshi Muto). Closes: #799432
* Turkish (Mert Dirik). Closes: #799875
.
[ Updated scripts translations ]
* German (Helge Kreutzmann).
.
[ Updated manpages translations ]
* German (Helge Kreutzmann, Julian R). Closes: #807156
Checksums-Sha1:
4f1df693463e7279d4d0362dbb00b6116353a933 2053 dpkg_1.18.4.dsc
87707de6726d27f2c60fbd95bfaf90f888e2afe8 4377024 dpkg_1.18.4.tar.xz
Checksums-Sha256:
bcf295adfb7d467220586789f3e7b2de78ded2ea035c9c0ba4e97283d39eeb6f 2053
dpkg_1.18.4.dsc
fe89243868888ce715bf45861f26264f767d4e4dbd0d6f1a26ce60bbbbf106da 4377024
dpkg_1.18.4.tar.xz
Files:
32a406117e41c649a0df42289d2a8860 2053 admin required dpkg_1.18.4.dsc
e95b513c89693f6ec3ab53b6b1c3defd 4377024 admin required dpkg_1.18.4.tar.xz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWfUNzAAoJELlyvz6krlejO5YP/iDDalDQ7TIRBiR9MysEkzcx
M6p9FZ0eSZY0a3sL9UZ8rYJXPmGuZSRCp9ekFucwMY0wEb/qHjy9roDWWDv7ih9b
WPqIPKPv/nuWX7hOqWXAyrkmyeTKS8nhRrf2jBSKSVhm/uGpKiB9Q2i1+7SYSIDf
OPzO+RmDeQuFRiTrAeUrTxz+qyEfbnlWer5ZyEGDNssV6TQQHSwEkYxyhc9jsoE6
xz5AeF2DhV04rM9m9qk5dBPAN8YWTJK7xqE1MC9lQ/UZp35jhryvChbnWbWAC49M
k8xe5AfrDDWclBfSbCeyoISuTNq9m2KLHbNAAhCqPWZFWgT/7rY9QnRxFXNsjPvr
Vr2kfpBy0oR7JEFS4YZvUkVNgDUopgCEEwi5b4wdm6X/NeUHfInfq9DLvyOKeDGa
LY0hazSYNxi4c7ek0TvR1APZEDcN7LVdi3XDc5A3b/y6zcSwhesMCFKro88QDvEO
YwTqznU3gwRPMyAhrINnJIfOdrgLMC8iwqtNDrDqCTJmxGBhTlbRueVXhBcJ9ue9
7i4pdfTx6KVRBVDJNQfp1krITYv6KbqqbqZE4Hui6knXdfamWBkQaCf7uLy4GGv9
RIATMrUBOZK8YNUwIiaaCl+N8X2MybEf7OayWNQsqtkEj7FRX6yR7vNY1rtXprGa
Mfc5QPR0ZmEcbjscpws/
=ZS2K
-----END PGP SIGNATURE-----
--- End Message ---